Alexander Shishkin | e443b33 | 2012-05-11 17:25:46 +0300 | [diff] [blame] | 1 | /* |
| 2 | * Platform data for the chipidea USB dual role controller |
| 3 | */ |
| 4 | |
| 5 | #ifndef __LINUX_USB_CHIPIDEA_H |
| 6 | #define __LINUX_USB_CHIPIDEA_H |
| 7 | |
Richard Zhao | a2c3d69 | 2012-07-07 22:56:46 +0800 | [diff] [blame] | 8 | #include <linux/usb/otg.h> |
| 9 | |
Alexander Shishkin | 8e22978 | 2013-06-24 14:46:36 +0300 | [diff] [blame] | 10 | struct ci_hdrc; |
| 11 | struct ci_hdrc_platform_data { |
Alexander Shishkin | e443b33 | 2012-05-11 17:25:46 +0300 | [diff] [blame] | 12 | const char *name; |
| 13 | /* offset of the capability registers */ |
| 14 | uintptr_t capoffset; |
Alexander Shishkin | bd84198 | 2012-05-11 17:25:55 +0300 | [diff] [blame] | 15 | unsigned power_budget; |
Antoine Tenart | 1e5e2d3 | 2014-10-30 18:41:19 +0100 | [diff] [blame] | 16 | struct phy *phy; |
| 17 | /* old usb_phy interface */ |
Antoine Tenart | ef44cb4 | 2014-10-30 18:41:16 +0100 | [diff] [blame] | 18 | struct usb_phy *usb_phy; |
Michael Grzeschik | 40dcd0e | 2013-06-13 17:59:56 +0300 | [diff] [blame] | 19 | enum usb_phy_interface phy_mode; |
Alexander Shishkin | e443b33 | 2012-05-11 17:25:46 +0300 | [diff] [blame] | 20 | unsigned long flags; |
Alexander Shishkin | 8e22978 | 2013-06-24 14:46:36 +0300 | [diff] [blame] | 21 | #define CI_HDRC_REGS_SHARED BIT(0) |
Peter Chen | 1f874ed | 2015-02-11 12:44:45 +0800 | [diff] [blame] | 22 | #define CI_HDRC_SUPPORTS_RUNTIME_PM BIT(2) |
Alexander Shishkin | 8e22978 | 2013-06-24 14:46:36 +0300 | [diff] [blame] | 23 | #define CI_HDRC_DISABLE_STREAMING BIT(3) |
Peter Chen | 577b232 | 2013-08-14 12:44:08 +0300 | [diff] [blame] | 24 | /* |
| 25 | * Only set it when DCCPARAMS.DC==1 and DCCPARAMS.HC==1, |
| 26 | * but otg is not supported (no register otgsc). |
| 27 | */ |
| 28 | #define CI_HDRC_DUAL_ROLE_NOT_OTG BIT(4) |
Peter Chen | ed8f831 | 2014-01-10 13:51:27 +0800 | [diff] [blame] | 29 | #define CI_HDRC_IMX28_WRITE_FIX BIT(5) |
Michael Grzeschik | 4f6743d | 2014-02-19 13:41:43 +0800 | [diff] [blame] | 30 | #define CI_HDRC_FORCE_FULLSPEED BIT(6) |
Li Jun | 6adb9b7b | 2015-02-11 12:45:01 +0800 | [diff] [blame^] | 31 | #define CI_HDRC_TURN_VBUS_EARLY_ON BIT(7) |
Sascha Hauer | 691962d | 2013-06-13 17:59:57 +0300 | [diff] [blame] | 32 | enum usb_dr_mode dr_mode; |
Alexander Shishkin | 8e22978 | 2013-06-24 14:46:36 +0300 | [diff] [blame] | 33 | #define CI_HDRC_CONTROLLER_RESET_EVENT 0 |
| 34 | #define CI_HDRC_CONTROLLER_STOPPED_EVENT 1 |
| 35 | void (*notify_event) (struct ci_hdrc *ci, unsigned event); |
Peter Chen | 1542d9c | 2013-08-14 12:44:03 +0300 | [diff] [blame] | 36 | struct regulator *reg_vbus; |
Peter Chen | f6a9ff0 | 2014-08-19 09:51:56 +0800 | [diff] [blame] | 37 | bool tpl_support; |
Alexander Shishkin | e443b33 | 2012-05-11 17:25:46 +0300 | [diff] [blame] | 38 | }; |
| 39 | |
| 40 | /* Default offset of capability registers */ |
| 41 | #define DEF_CAPOFFSET 0x100 |
| 42 | |
Alexander Shishkin | 8e22978 | 2013-06-24 14:46:36 +0300 | [diff] [blame] | 43 | /* Add ci hdrc device */ |
| 44 | struct platform_device *ci_hdrc_add_device(struct device *dev, |
Richard Zhao | cbc6dc2 | 2012-07-07 22:56:41 +0800 | [diff] [blame] | 45 | struct resource *res, int nres, |
Alexander Shishkin | 8e22978 | 2013-06-24 14:46:36 +0300 | [diff] [blame] | 46 | struct ci_hdrc_platform_data *platdata); |
| 47 | /* Remove ci hdrc device */ |
| 48 | void ci_hdrc_remove_device(struct platform_device *pdev); |
Richard Zhao | cbc6dc2 | 2012-07-07 22:56:41 +0800 | [diff] [blame] | 49 | |
Alexander Shishkin | e443b33 | 2012-05-11 17:25:46 +0300 | [diff] [blame] | 50 | #endif |