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 */
247013b262SJulia Lawall 	unsigned int hsic:1; /* HSIC controller */
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 */
2958a3cefbSPeter Chen 	int emp_curr_control;
3058a3cefbSPeter Chen 	int dc_vol_level_adjust;
31*3bd442e4SXu Yang 	int rise_fall_time_adjust;
328e22978cSAlexander Shishkin };
338e22978cSAlexander Shishkin 
347c8e8909SPeter Chen int imx_usbmisc_init(struct imx_usbmisc_data *data);
357c8e8909SPeter Chen int imx_usbmisc_init_post(struct imx_usbmisc_data *data);
367c8e8909SPeter Chen int imx_usbmisc_hsic_set_connect(struct imx_usbmisc_data *data);
37746f316bSJun Li int imx_usbmisc_charger_detection(struct imx_usbmisc_data *data, bool connect);
38b332d6d5SLi Jun int imx_usbmisc_suspend(struct imx_usbmisc_data *data, bool wakeup);
39b332d6d5SLi Jun int imx_usbmisc_resume(struct imx_usbmisc_data *data, bool wakeup);
40292abc90SRahul Bedarkar 
41292abc90SRahul Bedarkar #endif /* __DRIVER_USB_CHIPIDEA_CI_HDRC_IMX_H */
42