1e443b333SAlexander Shishkin /* 2e443b333SAlexander Shishkin * Platform data for the chipidea USB dual role controller 3e443b333SAlexander Shishkin */ 4e443b333SAlexander Shishkin 5e443b333SAlexander Shishkin #ifndef __LINUX_USB_CHIPIDEA_H 6e443b333SAlexander Shishkin #define __LINUX_USB_CHIPIDEA_H 7e443b333SAlexander Shishkin 8a2c3d690SRichard Zhao #include <linux/usb/otg.h> 9a2c3d690SRichard Zhao 108e22978cSAlexander Shishkin struct ci_hdrc; 118e22978cSAlexander Shishkin struct ci_hdrc_platform_data { 12e443b333SAlexander Shishkin const char *name; 13e443b333SAlexander Shishkin /* offset of the capability registers */ 14e443b333SAlexander Shishkin uintptr_t capoffset; 15bd841986SAlexander Shishkin unsigned power_budget; 161e5e2d3dSAntoine Tenart struct phy *phy; 171e5e2d3dSAntoine Tenart /* old usb_phy interface */ 18ef44cb42SAntoine Tenart struct usb_phy *usb_phy; 1940dcd0e8SMichael Grzeschik enum usb_phy_interface phy_mode; 20e443b333SAlexander Shishkin unsigned long flags; 218e22978cSAlexander Shishkin #define CI_HDRC_REGS_SHARED BIT(0) 22*8022d3d5SPeter Chen #define CI_HDRC_DISABLE_DEVICE_STREAMING BIT(1) 231f874edcSPeter Chen #define CI_HDRC_SUPPORTS_RUNTIME_PM BIT(2) 24*8022d3d5SPeter Chen #define CI_HDRC_DISABLE_HOST_STREAMING BIT(3) 25*8022d3d5SPeter Chen #define CI_HDRC_DISABLE_STREAMING (CI_HDRC_DISABLE_DEVICE_STREAMING | \ 26*8022d3d5SPeter Chen CI_HDRC_DISABLE_HOST_STREAMING) 27577b232fSPeter Chen /* 28577b232fSPeter Chen * Only set it when DCCPARAMS.DC==1 and DCCPARAMS.HC==1, 29577b232fSPeter Chen * but otg is not supported (no register otgsc). 30577b232fSPeter Chen */ 31577b232fSPeter Chen #define CI_HDRC_DUAL_ROLE_NOT_OTG BIT(4) 32ed8f8318SPeter Chen #define CI_HDRC_IMX28_WRITE_FIX BIT(5) 334f6743d5SMichael Grzeschik #define CI_HDRC_FORCE_FULLSPEED BIT(6) 346adb9b7bSLi Jun #define CI_HDRC_TURN_VBUS_EARLY_ON BIT(7) 3528362673SPeter Chen #define CI_HDRC_SET_NON_ZERO_TTHA BIT(8) 36691962d1SSascha Hauer enum usb_dr_mode dr_mode; 378e22978cSAlexander Shishkin #define CI_HDRC_CONTROLLER_RESET_EVENT 0 388e22978cSAlexander Shishkin #define CI_HDRC_CONTROLLER_STOPPED_EVENT 1 398e22978cSAlexander Shishkin void (*notify_event) (struct ci_hdrc *ci, unsigned event); 401542d9c3SPeter Chen struct regulator *reg_vbus; 41f6a9ff07SPeter Chen bool tpl_support; 42df96ed8dSPeter Chen /* interrupt threshold setting */ 43df96ed8dSPeter Chen u32 itc_setting; 44e443b333SAlexander Shishkin }; 45e443b333SAlexander Shishkin 46e443b333SAlexander Shishkin /* Default offset of capability registers */ 47e443b333SAlexander Shishkin #define DEF_CAPOFFSET 0x100 48e443b333SAlexander Shishkin 498e22978cSAlexander Shishkin /* Add ci hdrc device */ 508e22978cSAlexander Shishkin struct platform_device *ci_hdrc_add_device(struct device *dev, 51cbc6dc2aSRichard Zhao struct resource *res, int nres, 528e22978cSAlexander Shishkin struct ci_hdrc_platform_data *platdata); 538e22978cSAlexander Shishkin /* Remove ci hdrc device */ 548e22978cSAlexander Shishkin void ci_hdrc_remove_device(struct platform_device *pdev); 55cbc6dc2aSRichard Zhao 56e443b333SAlexander Shishkin #endif 57