18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Copyright (C) 2013-2014 Freescale Semiconductor, Inc. 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Author: Peter Chen 68c2ecf20Sopenharmony_ci */ 78c2ecf20Sopenharmony_ci 88c2ecf20Sopenharmony_ci#ifndef __DRIVERS_USB_CHIPIDEA_OTG_H 98c2ecf20Sopenharmony_ci#define __DRIVERS_USB_CHIPIDEA_OTG_H 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ciu32 hw_read_otgsc(struct ci_hdrc *ci, u32 mask); 128c2ecf20Sopenharmony_civoid hw_write_otgsc(struct ci_hdrc *ci, u32 mask, u32 data); 138c2ecf20Sopenharmony_ciint ci_hdrc_otg_init(struct ci_hdrc *ci); 148c2ecf20Sopenharmony_civoid ci_hdrc_otg_destroy(struct ci_hdrc *ci); 158c2ecf20Sopenharmony_cienum ci_role ci_otg_role(struct ci_hdrc *ci); 168c2ecf20Sopenharmony_civoid ci_handle_vbus_change(struct ci_hdrc *ci); 178c2ecf20Sopenharmony_cistatic inline void ci_otg_queue_work(struct ci_hdrc *ci) 188c2ecf20Sopenharmony_ci{ 198c2ecf20Sopenharmony_ci disable_irq_nosync(ci->irq); 208c2ecf20Sopenharmony_ci if (queue_work(ci->wq, &ci->work) == false) 218c2ecf20Sopenharmony_ci enable_irq(ci->irq); 228c2ecf20Sopenharmony_ci} 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ci#endif /* __DRIVERS_USB_CHIPIDEA_OTG_H */ 25