chipidea.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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_PULLUP_ON_VBUS BIT(2)
  19. #define CI_HDRC_DISABLE_STREAMING BIT(3)
  20. /*
  21. * Only set it when DCCPARAMS.DC==1 and DCCPARAMS.HC==1,
  22. * but otg is not supported (no register otgsc).
  23. */
  24. #define CI_HDRC_DUAL_ROLE_NOT_OTG BIT(4)
  25. enum usb_dr_mode dr_mode;
  26. #define CI_HDRC_CONTROLLER_RESET_EVENT 0
  27. #define CI_HDRC_CONTROLLER_STOPPED_EVENT 1
  28. void (*notify_event) (struct ci_hdrc *ci, unsigned event);
  29. struct regulator *reg_vbus;
  30. };
  31. /* Default offset of capability registers */
  32. #define DEF_CAPOFFSET 0x100
  33. /* Add ci hdrc device */
  34. struct platform_device *ci_hdrc_add_device(struct device *dev,
  35. struct resource *res, int nres,
  36. struct ci_hdrc_platform_data *platdata);
  37. /* Remove ci hdrc device */
  38. void ci_hdrc_remove_device(struct platform_device *pdev);
  39. #endif