blob: 999c65390b7f1c20cf505fa95a9b73fa7e076abb [file] [log] [blame]
Nishad Kamdard9958302020-03-15 16:25:07 +05301/* SPDX-License-Identifier: GPL-2.0+ */
Richard Zhaod142d6b2012-09-12 14:58:05 +03002/*
3 * Copyright 2012 Freescale Semiconductor, Inc.
Richard Zhaod142d6b2012-09-12 14:58:05 +03004 */
5
Rahul Bedarkar292abc92013-12-31 21:58:11 +05306#ifndef __DRIVER_USB_CHIPIDEA_CI_HDRC_IMX_H
7#define __DRIVER_USB_CHIPIDEA_CI_HDRC_IMX_H
8
Sascha Hauer05986ba2013-08-14 12:44:16 +03009struct imx_usbmisc_data {
Stefan Agnerf40017e2014-09-22 08:14:15 +080010 struct device *dev;
Richard Zhaod142d6b2012-09-12 14:58:05 +030011 int index;
12
Fabio Estevam7b8bc3a2013-01-27 22:45:05 -020013 unsigned int disable_oc:1; /* over current detect disabled */
Uwe Kleine-Königa82bf692018-12-04 09:31:29 +010014
15 /* true if over-current polarity is active low */
16 unsigned int oc_pol_active_low:1;
17
18 /* true if dt specifies polarity */
19 unsigned int oc_pol_configured:1;
20
Philipp Puschmann5f0632c2019-02-27 06:51:34 +000021 unsigned int pwr_pol:1; /* power polarity */
Michael Grzeschika0685332013-03-30 12:54:01 +020022 unsigned int evdo:1; /* set external vbus divider option */
Fabien Lahoudered13631b2016-09-26 13:14:19 +020023 unsigned int ulpi:1; /* connected to an ULPI phy */
Peter Chen7c8e8902018-10-16 09:17:02 +080024 unsigned int hsic:1; /* HSIC controlller */
Li Jun93c2c732019-09-09 14:41:41 +080025 unsigned int ext_id:1; /* ID from exteranl event */
26 unsigned int ext_vbus:1; /* Vbus from exteranl event */
Jun Li746f3162020-01-23 14:35:58 +080027 struct usb_phy *usb_phy;
Peter Chend6f93d22020-07-28 14:12:11 +080028 enum usb_dr_mode available_role; /* runtime usb dr mode */
Peter Chen58a3cef2019-09-30 13:56:26 +080029 int emp_curr_control;
30 int dc_vol_level_adjust;
Richard Zhaod142d6b2012-09-12 14:58:05 +030031};
32
Peter Chen7c8e8902018-10-16 09:17:02 +080033int imx_usbmisc_init(struct imx_usbmisc_data *data);
34int imx_usbmisc_init_post(struct imx_usbmisc_data *data);
35int imx_usbmisc_set_wakeup(struct imx_usbmisc_data *data, bool enabled);
36int imx_usbmisc_hsic_set_connect(struct imx_usbmisc_data *data);
37int imx_usbmisc_hsic_set_clk(struct imx_usbmisc_data *data, bool on);
Jun Li746f3162020-01-23 14:35:58 +080038int imx_usbmisc_charger_detection(struct imx_usbmisc_data *data, bool connect);
Rahul Bedarkar292abc92013-12-31 21:58:11 +053039
40#endif /* __DRIVER_USB_CHIPIDEA_CI_HDRC_IMX_H */