chipidea.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Platform data for the chipidea USB dual role controller
  3. */
  4. #ifndef __LINUX_USB_CHIPIDEA_H
  5. #define __LINUX_USB_CHIPIDEA_H
  6. #include <linux/usb/otg.h>
  7. struct ci_hdrc;
  8. struct ci_hdrc_platform_data {
  9. const char *name;
  10. /* offset of the capability registers */
  11. uintptr_t capoffset;
  12. unsigned power_budget;
  13. struct usb_phy *phy;
  14. enum usb_phy_interface phy_mode;
  15. unsigned long flags;
  16. #define CI_HDRC_REGS_SHARED BIT(0)
  17. #define CI_HDRC_REQUIRE_TRANSCEIVER BIT(1)
  18. #define CI_HDRC_DISABLE_STREAMING BIT(3)
  19. /*
  20. * Only set it when DCCPARAMS.DC==1 and DCCPARAMS.HC==1,
  21. * but otg is not supported (no register otgsc).
  22. */
  23. #define CI_HDRC_DUAL_ROLE_NOT_OTG BIT(4)
  24. enum usb_dr_mode dr_mode;
  25. #define CI_HDRC_CONTROLLER_RESET_EVENT 0
  26. #define CI_HDRC_CONTROLLER_STOPPED_EVENT 1
  27. void (*notify_event) (struct ci_hdrc *ci, unsigned event);
  28. struct regulator *reg_vbus;
  29. };
  30. /* Default offset of capability registers */
  31. #define DEF_CAPOFFSET 0x100
  32. /* Add ci hdrc device */
  33. struct platform_device *ci_hdrc_add_device(struct device *dev,
  34. struct resource *res, int nres,
  35. struct ci_hdrc_platform_data *platdata);
  36. /* Remove ci hdrc device */
  37. void ci_hdrc_remove_device(struct platform_device *pdev);
  38. #endif