Nishad Kamdar | d995830 | 2020-03-15 16:25:07 +0530 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Richard Zhao | d142d6b | 2012-09-12 14:58:05 +0300 | [diff] [blame] | 2 | /* |
| 3 | * Copyright 2012 Freescale Semiconductor, Inc. |
Richard Zhao | d142d6b | 2012-09-12 14:58:05 +0300 | [diff] [blame] | 4 | */ |
| 5 | |
Rahul Bedarkar | 292abc9 | 2013-12-31 21:58:11 +0530 | [diff] [blame] | 6 | #ifndef __DRIVER_USB_CHIPIDEA_CI_HDRC_IMX_H |
| 7 | #define __DRIVER_USB_CHIPIDEA_CI_HDRC_IMX_H |
| 8 | |
Sascha Hauer | 05986ba | 2013-08-14 12:44:16 +0300 | [diff] [blame] | 9 | struct imx_usbmisc_data { |
Stefan Agner | f40017e | 2014-09-22 08:14:15 +0800 | [diff] [blame] | 10 | struct device *dev; |
Richard Zhao | d142d6b | 2012-09-12 14:58:05 +0300 | [diff] [blame] | 11 | int index; |
| 12 | |
Fabio Estevam | 7b8bc3a | 2013-01-27 22:45:05 -0200 | [diff] [blame] | 13 | unsigned int disable_oc:1; /* over current detect disabled */ |
Uwe Kleine-König | a82bf69 | 2018-12-04 09:31:29 +0100 | [diff] [blame] | 14 | |
| 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 Puschmann | 5f0632c | 2019-02-27 06:51:34 +0000 | [diff] [blame] | 21 | unsigned int pwr_pol:1; /* power polarity */ |
Michael Grzeschik | a068533 | 2013-03-30 12:54:01 +0200 | [diff] [blame] | 22 | unsigned int evdo:1; /* set external vbus divider option */ |
Fabien Lahoudere | d13631b | 2016-09-26 13:14:19 +0200 | [diff] [blame] | 23 | unsigned int ulpi:1; /* connected to an ULPI phy */ |
Peter Chen | 7c8e890 | 2018-10-16 09:17:02 +0800 | [diff] [blame] | 24 | unsigned int hsic:1; /* HSIC controlller */ |
Li Jun | 93c2c73 | 2019-09-09 14:41:41 +0800 | [diff] [blame] | 25 | unsigned int ext_id:1; /* ID from exteranl event */ |
| 26 | unsigned int ext_vbus:1; /* Vbus from exteranl event */ |
Jun Li | 746f316 | 2020-01-23 14:35:58 +0800 | [diff] [blame] | 27 | struct usb_phy *usb_phy; |
Peter Chen | d6f93d2 | 2020-07-28 14:12:11 +0800 | [diff] [blame] | 28 | enum usb_dr_mode available_role; /* runtime usb dr mode */ |
Peter Chen | 58a3cef | 2019-09-30 13:56:26 +0800 | [diff] [blame] | 29 | int emp_curr_control; |
| 30 | int dc_vol_level_adjust; |
Richard Zhao | d142d6b | 2012-09-12 14:58:05 +0300 | [diff] [blame] | 31 | }; |
| 32 | |
Peter Chen | 7c8e890 | 2018-10-16 09:17:02 +0800 | [diff] [blame] | 33 | int imx_usbmisc_init(struct imx_usbmisc_data *data); |
| 34 | int imx_usbmisc_init_post(struct imx_usbmisc_data *data); |
| 35 | int imx_usbmisc_set_wakeup(struct imx_usbmisc_data *data, bool enabled); |
| 36 | int imx_usbmisc_hsic_set_connect(struct imx_usbmisc_data *data); |
| 37 | int imx_usbmisc_hsic_set_clk(struct imx_usbmisc_data *data, bool on); |
Jun Li | 746f316 | 2020-01-23 14:35:58 +0800 | [diff] [blame] | 38 | int imx_usbmisc_charger_detection(struct imx_usbmisc_data *data, bool connect); |
Rahul Bedarkar | 292abc9 | 2013-12-31 21:58:11 +0530 | [diff] [blame] | 39 | |
| 40 | #endif /* __DRIVER_USB_CHIPIDEA_CI_HDRC_IMX_H */ |