1d9958306SNishad Kamdar /* SPDX-License-Identifier: GPL-2.0+ */
28e22978cSAlexander Shishkin /*
38e22978cSAlexander Shishkin  * Copyright 2012 Freescale Semiconductor, Inc.
48e22978cSAlexander Shishkin  */
58e22978cSAlexander Shishkin 
6292abc90SRahul Bedarkar #ifndef __DRIVER_USB_CHIPIDEA_CI_HDRC_IMX_H
7292abc90SRahul Bedarkar #define __DRIVER_USB_CHIPIDEA_CI_HDRC_IMX_H
8292abc90SRahul Bedarkar 
905986ba9SSascha Hauer struct imx_usbmisc_data {
10f40017e0SStefan Agner 	struct device *dev;
118e22978cSAlexander Shishkin 	int index;
128e22978cSAlexander Shishkin 
138e22978cSAlexander Shishkin 	unsigned int disable_oc:1; /* over current detect disabled */
14a82bf696SUwe Kleine-König 
15a82bf696SUwe Kleine-König 	/* true if over-current polarity is active low */
16a82bf696SUwe Kleine-König 	unsigned int oc_pol_active_low:1;
17a82bf696SUwe Kleine-König 
18a82bf696SUwe Kleine-König 	/* true if dt specifies polarity */
19a82bf696SUwe Kleine-König 	unsigned int oc_pol_configured:1;
20a82bf696SUwe Kleine-König 
215f0632c4SPhilipp Puschmann 	unsigned int pwr_pol:1; /* power polarity */
228e22978cSAlexander Shishkin 	unsigned int evdo:1; /* set external vbus divider option */
23d13631bbSFabien Lahoudere 	unsigned int ulpi:1; /* connected to an ULPI phy */
247c8e8909SPeter Chen 	unsigned int hsic:1; /* HSIC controlller */
2593c2c733SLi Jun 	unsigned int ext_id:1; /* ID from exteranl event */
2693c2c733SLi Jun 	unsigned int ext_vbus:1; /* Vbus from exteranl event */
27746f316bSJun Li 	struct usb_phy *usb_phy;
28d6f93d21SPeter Chen 	enum usb_dr_mode available_role; /* runtime usb dr mode */
298e22978cSAlexander Shishkin };
308e22978cSAlexander Shishkin 
317c8e8909SPeter Chen int imx_usbmisc_init(struct imx_usbmisc_data *data);
327c8e8909SPeter Chen int imx_usbmisc_init_post(struct imx_usbmisc_data *data);
337c8e8909SPeter Chen int imx_usbmisc_set_wakeup(struct imx_usbmisc_data *data, bool enabled);
347c8e8909SPeter Chen int imx_usbmisc_hsic_set_connect(struct imx_usbmisc_data *data);
357c8e8909SPeter Chen int imx_usbmisc_hsic_set_clk(struct imx_usbmisc_data *data, bool on);
36746f316bSJun Li int imx_usbmisc_charger_detection(struct imx_usbmisc_data *data, bool connect);
37292abc90SRahul Bedarkar 
38292abc90SRahul Bedarkar #endif /* __DRIVER_USB_CHIPIDEA_CI_HDRC_IMX_H */
39