Loading...
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Copyright (C) 2013-2014 Freescale Semiconductor, Inc.
4 *
5 * Author: Peter Chen
6 */
7
8#ifndef __DRIVERS_USB_CHIPIDEA_OTG_H
9#define __DRIVERS_USB_CHIPIDEA_OTG_H
10
11u32 hw_read_otgsc(struct ci_hdrc *ci, u32 mask);
12void hw_write_otgsc(struct ci_hdrc *ci, u32 mask, u32 data);
13int ci_hdrc_otg_init(struct ci_hdrc *ci);
14void ci_hdrc_otg_destroy(struct ci_hdrc *ci);
15enum ci_role ci_otg_role(struct ci_hdrc *ci);
16void ci_handle_vbus_change(struct ci_hdrc *ci);
17void ci_handle_id_switch(struct ci_hdrc *ci);
18static inline void ci_otg_queue_work(struct ci_hdrc *ci)
19{
20 disable_irq_nosync(ci->irq);
21 if (queue_work(ci->wq, &ci->work) == false)
22 enable_irq(ci->irq);
23}
24
25#endif /* __DRIVERS_USB_CHIPIDEA_OTG_H */
1/*
2 * Copyright (C) 2013-2014 Freescale Semiconductor, Inc.
3 *
4 * Author: Peter Chen
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __DRIVERS_USB_CHIPIDEA_OTG_H
12#define __DRIVERS_USB_CHIPIDEA_OTG_H
13
14u32 hw_read_otgsc(struct ci_hdrc *ci, u32 mask);
15void hw_write_otgsc(struct ci_hdrc *ci, u32 mask, u32 data);
16int ci_hdrc_otg_init(struct ci_hdrc *ci);
17void ci_hdrc_otg_destroy(struct ci_hdrc *ci);
18enum ci_role ci_otg_role(struct ci_hdrc *ci);
19void ci_handle_vbus_change(struct ci_hdrc *ci);
20static inline void ci_otg_queue_work(struct ci_hdrc *ci)
21{
22 disable_irq_nosync(ci->irq);
23 queue_work(ci->wq, &ci->work);
24}
25
26#endif /* __DRIVERS_USB_CHIPIDEA_OTG_H */