xref: /linux/include/linux/usb/chipidea.h (revision ed8f8318d2ef3e5f9e4ddf79349508c116b68d7f)
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;
16a2c3d690SRichard Zhao 	struct usb_phy	*phy;
1740dcd0e8SMichael Grzeschik 	enum usb_phy_interface phy_mode;
18e443b333SAlexander Shishkin 	unsigned long	 flags;
198e22978cSAlexander Shishkin #define CI_HDRC_REGS_SHARED		BIT(0)
208e22978cSAlexander Shishkin #define CI_HDRC_REQUIRE_TRANSCEIVER	BIT(1)
218e22978cSAlexander Shishkin #define CI_HDRC_DISABLE_STREAMING	BIT(3)
22577b232fSPeter Chen 	/*
23577b232fSPeter Chen 	 * Only set it when DCCPARAMS.DC==1 and DCCPARAMS.HC==1,
24577b232fSPeter Chen 	 * but otg is not supported (no register otgsc).
25577b232fSPeter Chen 	 */
26577b232fSPeter Chen #define CI_HDRC_DUAL_ROLE_NOT_OTG	BIT(4)
27*ed8f8318SPeter Chen #define CI_HDRC_IMX28_WRITE_FIX		BIT(5)
28691962d1SSascha Hauer 	enum usb_dr_mode	dr_mode;
298e22978cSAlexander Shishkin #define CI_HDRC_CONTROLLER_RESET_EVENT		0
308e22978cSAlexander Shishkin #define CI_HDRC_CONTROLLER_STOPPED_EVENT	1
318e22978cSAlexander Shishkin 	void	(*notify_event) (struct ci_hdrc *ci, unsigned event);
321542d9c3SPeter Chen 	struct regulator	*reg_vbus;
33e443b333SAlexander Shishkin };
34e443b333SAlexander Shishkin 
35e443b333SAlexander Shishkin /* Default offset of capability registers */
36e443b333SAlexander Shishkin #define DEF_CAPOFFSET		0x100
37e443b333SAlexander Shishkin 
388e22978cSAlexander Shishkin /* Add ci hdrc device */
398e22978cSAlexander Shishkin struct platform_device *ci_hdrc_add_device(struct device *dev,
40cbc6dc2aSRichard Zhao 			struct resource *res, int nres,
418e22978cSAlexander Shishkin 			struct ci_hdrc_platform_data *platdata);
428e22978cSAlexander Shishkin /* Remove ci hdrc device */
438e22978cSAlexander Shishkin void ci_hdrc_remove_device(struct platform_device *pdev);
44cbc6dc2aSRichard Zhao 
45e443b333SAlexander Shishkin #endif
46