xref: /linux/include/linux/usb/chipidea.h (revision a2c3d6902f6f9916b5376c44baa8c1d08bf92a27)
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 
8*a2c3d690SRichard Zhao #include <linux/usb/otg.h>
9*a2c3d690SRichard Zhao 
10e443b333SAlexander Shishkin struct ci13xxx;
1177c4400fSRichard Zhao struct ci13xxx_platform_data {
12e443b333SAlexander Shishkin 	const char	*name;
13e443b333SAlexander Shishkin 	/* offset of the capability registers */
14e443b333SAlexander Shishkin 	uintptr_t	 capoffset;
15bd841986SAlexander Shishkin 	unsigned	 power_budget;
16*a2c3d690SRichard Zhao 	struct usb_phy	*phy;
17e443b333SAlexander Shishkin 	unsigned long	 flags;
18e443b333SAlexander Shishkin #define CI13XXX_REGS_SHARED		BIT(0)
19e443b333SAlexander Shishkin #define CI13XXX_REQUIRE_TRANSCEIVER	BIT(1)
20e443b333SAlexander Shishkin #define CI13XXX_PULLUP_ON_VBUS		BIT(2)
21e443b333SAlexander Shishkin #define CI13XXX_DISABLE_STREAMING	BIT(3)
22e443b333SAlexander Shishkin 
23e443b333SAlexander Shishkin #define CI13XXX_CONTROLLER_RESET_EVENT		0
24e443b333SAlexander Shishkin #define CI13XXX_CONTROLLER_STOPPED_EVENT	1
2526c696c6SRichard Zhao 	void	(*notify_event) (struct ci13xxx *ci, unsigned event);
26e443b333SAlexander Shishkin };
27e443b333SAlexander Shishkin 
28e443b333SAlexander Shishkin /* Default offset of capability registers */
29e443b333SAlexander Shishkin #define DEF_CAPOFFSET		0x100
30e443b333SAlexander Shishkin 
31cbc6dc2aSRichard Zhao /* Add ci13xxx device */
32cbc6dc2aSRichard Zhao struct platform_device *ci13xxx_add_device(struct device *dev,
33cbc6dc2aSRichard Zhao 			struct resource *res, int nres,
34cbc6dc2aSRichard Zhao 			struct ci13xxx_platform_data *platdata);
35cbc6dc2aSRichard Zhao /* Remove ci13xxx device */
36cbc6dc2aSRichard Zhao void ci13xxx_remove_device(struct platform_device *pdev);
37cbc6dc2aSRichard Zhao 
38e443b333SAlexander Shishkin #endif
39