otg.h 695 B

12345678910111213141516171819202122232425
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright (C) 2013-2014 Freescale Semiconductor, Inc.
  4. *
  5. * Author: Peter Chen
  6. */
  7. #ifndef __DRIVERS_USB_CHIPIDEA_OTG_H
  8. #define __DRIVERS_USB_CHIPIDEA_OTG_H
  9. u32 hw_read_otgsc(struct ci_hdrc *ci, u32 mask);
  10. void hw_write_otgsc(struct ci_hdrc *ci, u32 mask, u32 data);
  11. int ci_hdrc_otg_init(struct ci_hdrc *ci);
  12. void ci_hdrc_otg_destroy(struct ci_hdrc *ci);
  13. enum ci_role ci_otg_role(struct ci_hdrc *ci);
  14. void ci_handle_vbus_change(struct ci_hdrc *ci);
  15. static inline void ci_otg_queue_work(struct ci_hdrc *ci)
  16. {
  17. disable_irq_nosync(ci->irq);
  18. if (queue_work(ci->wq, &ci->work) == false)
  19. enable_irq(ci->irq);
  20. }
  21. #endif /* __DRIVERS_USB_CHIPIDEA_OTG_H */