otg.h 965 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (C) 2013 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. #ifndef __DRIVERS_USB_CHIPIDEA_OTG_H
  11. #define __DRIVERS_USB_CHIPIDEA_OTG_H
  12. static inline void ci_clear_otg_interrupt(struct ci_hdrc *ci, u32 bits)
  13. {
  14. /* Only clear request bits */
  15. hw_write(ci, OP_OTGSC, OTGSC_INT_STATUS_BITS, bits);
  16. }
  17. static inline void ci_enable_otg_interrupt(struct ci_hdrc *ci, u32 bits)
  18. {
  19. hw_write(ci, OP_OTGSC, bits, bits);
  20. }
  21. static inline void ci_disable_otg_interrupt(struct ci_hdrc *ci, u32 bits)
  22. {
  23. hw_write(ci, OP_OTGSC, bits, 0);
  24. }
  25. int ci_hdrc_otg_init(struct ci_hdrc *ci);
  26. void ci_hdrc_otg_destroy(struct ci_hdrc *ci);
  27. enum ci_role ci_otg_role(struct ci_hdrc *ci);
  28. void ci_handle_vbus_change(struct ci_hdrc *ci);
  29. #endif /* __DRIVERS_USB_CHIPIDEA_OTG_H */