2020-03-15 18:55:07 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2012-09-12 19:58:05 +08:00
|
|
|
/*
|
|
|
|
* Copyright 2012 Freescale Semiconductor, Inc.
|
|
|
|
*/
|
|
|
|
|
2014-01-01 00:28:11 +08:00
|
|
|
#ifndef __DRIVER_USB_CHIPIDEA_CI_HDRC_IMX_H
|
|
|
|
#define __DRIVER_USB_CHIPIDEA_CI_HDRC_IMX_H
|
|
|
|
|
2013-08-14 17:44:16 +08:00
|
|
|
struct imx_usbmisc_data {
|
2014-09-22 08:14:15 +08:00
|
|
|
struct device *dev;
|
2012-09-12 19:58:05 +08:00
|
|
|
int index;
|
|
|
|
|
2013-01-28 08:45:05 +08:00
|
|
|
unsigned int disable_oc:1; /* over current detect disabled */
|
2018-12-04 16:31:29 +08:00
|
|
|
|
|
|
|
/* true if over-current polarity is active low */
|
|
|
|
unsigned int oc_pol_active_low:1;
|
|
|
|
|
|
|
|
/* true if dt specifies polarity */
|
|
|
|
unsigned int oc_pol_configured:1;
|
|
|
|
|
2019-02-27 14:51:34 +08:00
|
|
|
unsigned int pwr_pol:1; /* power polarity */
|
2013-03-30 18:54:01 +08:00
|
|
|
unsigned int evdo:1; /* set external vbus divider option */
|
2016-09-26 19:14:19 +08:00
|
|
|
unsigned int ulpi:1; /* connected to an ULPI phy */
|
2018-10-16 09:17:02 +08:00
|
|
|
unsigned int hsic:1; /* HSIC controlller */
|
2019-09-09 14:41:41 +08:00
|
|
|
unsigned int ext_id:1; /* ID from exteranl event */
|
|
|
|
unsigned int ext_vbus:1; /* Vbus from exteranl event */
|
2020-01-23 14:35:58 +08:00
|
|
|
struct usb_phy *usb_phy;
|
2020-07-28 14:12:11 +08:00
|
|
|
enum usb_dr_mode available_role; /* runtime usb dr mode */
|
2019-09-30 13:56:26 +08:00
|
|
|
int emp_curr_control;
|
|
|
|
int dc_vol_level_adjust;
|
2012-09-12 19:58:05 +08:00
|
|
|
};
|
|
|
|
|
2018-10-16 09:17:02 +08:00
|
|
|
int imx_usbmisc_init(struct imx_usbmisc_data *data);
|
|
|
|
int imx_usbmisc_init_post(struct imx_usbmisc_data *data);
|
|
|
|
int imx_usbmisc_set_wakeup(struct imx_usbmisc_data *data, bool enabled);
|
|
|
|
int imx_usbmisc_hsic_set_connect(struct imx_usbmisc_data *data);
|
|
|
|
int imx_usbmisc_hsic_set_clk(struct imx_usbmisc_data *data, bool on);
|
2020-01-23 14:35:58 +08:00
|
|
|
int imx_usbmisc_charger_detection(struct imx_usbmisc_data *data, bool connect);
|
2014-01-01 00:28:11 +08:00
|
|
|
|
|
|
|
#endif /* __DRIVER_USB_CHIPIDEA_CI_HDRC_IMX_H */
|