#include <linux/module.h>
#include <linux/of.h>
#include <linux/err.h>
#include <linux/io.h>
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/usb/otg.h>
#include "ci_hdrc_imx.h"
#define MX25_USB_PHY_CTRL_OFFSET …
#define MX25_BM_EXTERNAL_VBUS_DIVIDER …
#define MX25_EHCI_INTERFACE_SINGLE_UNI …
#define MX25_EHCI_INTERFACE_DIFF_UNI …
#define MX25_EHCI_INTERFACE_MASK …
#define MX25_OTG_SIC_SHIFT …
#define MX25_OTG_SIC_MASK …
#define MX25_OTG_PM_BIT …
#define MX25_OTG_PP_BIT …
#define MX25_OTG_OCPOL_BIT …
#define MX25_H1_SIC_SHIFT …
#define MX25_H1_SIC_MASK …
#define MX25_H1_PP_BIT …
#define MX25_H1_PM_BIT …
#define MX25_H1_IPPUE_UP_BIT …
#define MX25_H1_IPPUE_DOWN_BIT …
#define MX25_H1_TLL_BIT …
#define MX25_H1_USBTE_BIT …
#define MX25_H1_OCPOL_BIT …
#define MX27_H1_PM_BIT …
#define MX27_H2_PM_BIT …
#define MX27_OTG_PM_BIT …
#define MX53_USB_OTG_PHY_CTRL_0_OFFSET …
#define MX53_USB_OTG_PHY_CTRL_1_OFFSET …
#define MX53_USB_CTRL_1_OFFSET …
#define MX53_USB_CTRL_1_H2_XCVR_CLK_SEL_MASK …
#define MX53_USB_CTRL_1_H2_XCVR_CLK_SEL_ULPI …
#define MX53_USB_CTRL_1_H3_XCVR_CLK_SEL_MASK …
#define MX53_USB_CTRL_1_H3_XCVR_CLK_SEL_ULPI …
#define MX53_USB_UH2_CTRL_OFFSET …
#define MX53_USB_UH3_CTRL_OFFSET …
#define MX53_USB_CLKONOFF_CTRL_OFFSET …
#define MX53_USB_CLKONOFF_CTRL_H2_INT60CKOFF …
#define MX53_USB_CLKONOFF_CTRL_H3_INT60CKOFF …
#define MX53_BM_OVER_CUR_DIS_H1 …
#define MX53_BM_OVER_CUR_DIS_OTG …
#define MX53_BM_OVER_CUR_DIS_UHx …
#define MX53_USB_CTRL_1_UH2_ULPI_EN …
#define MX53_USB_CTRL_1_UH3_ULPI_EN …
#define MX53_USB_UHx_CTRL_WAKE_UP_EN …
#define MX53_USB_UHx_CTRL_ULPI_INT_EN …
#define MX53_USB_PHYCTRL1_PLLDIV_MASK …
#define MX53_USB_PLL_DIV_24_MHZ …
#define MX6_BM_NON_BURST_SETTING …
#define MX6_BM_OVER_CUR_DIS …
#define MX6_BM_OVER_CUR_POLARITY …
#define MX6_BM_PWR_POLARITY …
#define MX6_BM_WAKEUP_ENABLE …
#define MX6_BM_UTMI_ON_CLOCK …
#define MX6_BM_ID_WAKEUP …
#define MX6_BM_VBUS_WAKEUP …
#define MX6SX_BM_DPDM_WAKEUP_EN …
#define MX6_BM_WAKEUP_INTR …
#define MX6_USB_HSIC_CTRL_OFFSET …
#define MX6SX_BM_HSIC_AUTO_RESUME …
#define MX6_BM_HSIC_DEV_CONN …
#define MX6_BM_HSIC_EN …
#define MX6_BM_HSIC_CLK_ON …
#define MX6_USB_OTG1_PHY_CTRL …
#define MX6_USB_OTG2_PHY_CTRL …
#define MX6SX_USB_VBUS_WAKEUP_SOURCE(v) …
#define MX6SX_USB_VBUS_WAKEUP_SOURCE_VBUS …
#define MX6SX_USB_VBUS_WAKEUP_SOURCE_AVALID …
#define MX6SX_USB_VBUS_WAKEUP_SOURCE_BVALID …
#define MX6SX_USB_VBUS_WAKEUP_SOURCE_SESS_END …
#define VF610_OVER_CUR_DIS …
#define MX7D_USBNC_USB_CTRL2 …
#define MX7D_USB_VBUS_WAKEUP_SOURCE_MASK …
#define MX7D_USB_VBUS_WAKEUP_SOURCE(v) …
#define MX7D_USB_VBUS_WAKEUP_SOURCE_VBUS …
#define MX7D_USB_VBUS_WAKEUP_SOURCE_AVALID …
#define MX7D_USB_VBUS_WAKEUP_SOURCE_BVALID …
#define MX7D_USB_VBUS_WAKEUP_SOURCE_SESS_END …
#define MX7D_USBNC_AUTO_RESUME …
#define MX7D_USBNC_USB_CTRL2_OPMODE(v) …
#define MX7D_USBNC_USB_CTRL2_OPMODE_NON_DRIVING …
#define MX7D_USBNC_USB_CTRL2_OPMODE_OVERRIDE_MASK …
#define MX7D_USBNC_USB_CTRL2_OPMODE_OVERRIDE_EN …
#define MX7D_USBNC_USB_CTRL2_DP_OVERRIDE_VAL …
#define MX7D_USBNC_USB_CTRL2_DP_OVERRIDE_EN …
#define MX7D_USBNC_USB_CTRL2_DM_OVERRIDE_VAL …
#define MX7D_USBNC_USB_CTRL2_DM_OVERRIDE_EN …
#define MX7D_USBNC_USB_CTRL2_DP_DM_MASK …
#define MX7D_USB_OTG_PHY_CFG2_CHRG_CHRGSEL …
#define MX7D_USB_OTG_PHY_CFG2_CHRG_VDATDETENB0 …
#define MX7D_USB_OTG_PHY_CFG2_CHRG_VDATSRCENB0 …
#define MX7D_USB_OTG_PHY_CFG2_CHRG_DCDENB …
#define MX7D_USB_OTG_PHY_CFG2_DRVVBUS0 …
#define MX7D_USB_OTG_PHY_CFG2 …
#define MX7D_USB_OTG_PHY_STATUS …
#define MX7D_USB_OTG_PHY_STATUS_LINE_STATE0 …
#define MX7D_USB_OTG_PHY_STATUS_LINE_STATE1 …
#define MX7D_USB_OTG_PHY_STATUS_VBUS_VLD …
#define MX7D_USB_OTG_PHY_STATUS_CHRGDET …
#define MX7D_USB_OTG_PHY_CFG1 …
#define TXPREEMPAMPTUNE0_BIT …
#define TXPREEMPAMPTUNE0_MASK …
#define TXRISETUNE0_BIT …
#define TXRISETUNE0_MASK …
#define TXVREFTUNE0_BIT …
#define TXVREFTUNE0_MASK …
#define MX6_USB_OTG_WAKEUP_BITS …
struct usbmisc_ops { … };
struct imx_usbmisc { … };
static inline bool is_imx53_usbmisc(struct imx_usbmisc_data *data);
static int usbmisc_imx25_init(struct imx_usbmisc_data *data)
{ … }
static int usbmisc_imx25_post(struct imx_usbmisc_data *data)
{ … }
static int usbmisc_imx27_init(struct imx_usbmisc_data *data)
{ … }
static int usbmisc_imx53_init(struct imx_usbmisc_data *data)
{ … }
static u32 usbmisc_wakeup_setting(struct imx_usbmisc_data *data)
{ … }
static int usbmisc_imx6q_set_wakeup
(struct imx_usbmisc_data *data, bool enabled)
{ … }
static int usbmisc_imx6q_init(struct imx_usbmisc_data *data)
{ … }
static int usbmisc_imx6_hsic_get_reg_offset(struct imx_usbmisc_data *data)
{ … }
static int usbmisc_imx6_hsic_set_connect(struct imx_usbmisc_data *data)
{ … }
static int usbmisc_imx6_hsic_set_clk(struct imx_usbmisc_data *data, bool on)
{ … }
static int usbmisc_imx6sx_init(struct imx_usbmisc_data *data)
{ … }
static int usbmisc_vf610_init(struct imx_usbmisc_data *data)
{ … }
static int usbmisc_imx7d_set_wakeup
(struct imx_usbmisc_data *data, bool enabled)
{ … }
static int usbmisc_imx7d_init(struct imx_usbmisc_data *data)
{ … }
static int imx7d_charger_secondary_detection(struct imx_usbmisc_data *data)
{ … }
static void imx7_disable_charger_detector(struct imx_usbmisc_data *data)
{ … }
static int imx7d_charger_data_contact_detect(struct imx_usbmisc_data *data)
{ … }
static int imx7d_charger_primary_detection(struct imx_usbmisc_data *data)
{ … }
static int imx7d_charger_detection(struct imx_usbmisc_data *data)
{ … }
static void usbmisc_imx7d_vbus_comparator_on(struct imx_usbmisc_data *data,
bool on)
{ … }
static int usbmisc_imx7ulp_init(struct imx_usbmisc_data *data)
{ … }
static int usbmisc_imx7d_power_lost_check(struct imx_usbmisc_data *data)
{ … }
static int usbmisc_imx6sx_power_lost_check(struct imx_usbmisc_data *data)
{ … }
static const struct usbmisc_ops imx25_usbmisc_ops = …;
static const struct usbmisc_ops imx27_usbmisc_ops = …;
static const struct usbmisc_ops imx51_usbmisc_ops = …;
static const struct usbmisc_ops imx53_usbmisc_ops = …;
static const struct usbmisc_ops imx6q_usbmisc_ops = …;
static const struct usbmisc_ops vf610_usbmisc_ops = …;
static const struct usbmisc_ops imx6sx_usbmisc_ops = …;
static const struct usbmisc_ops imx7d_usbmisc_ops = …;
static const struct usbmisc_ops imx7ulp_usbmisc_ops = …;
static inline bool is_imx53_usbmisc(struct imx_usbmisc_data *data)
{ … }
int imx_usbmisc_init(struct imx_usbmisc_data *data)
{ … }
EXPORT_SYMBOL_GPL(…);
int imx_usbmisc_init_post(struct imx_usbmisc_data *data)
{ … }
EXPORT_SYMBOL_GPL(…);
int imx_usbmisc_hsic_set_connect(struct imx_usbmisc_data *data)
{ … }
EXPORT_SYMBOL_GPL(…);
int imx_usbmisc_charger_detection(struct imx_usbmisc_data *data, bool connect)
{ … }
EXPORT_SYMBOL_GPL(…);
int imx_usbmisc_suspend(struct imx_usbmisc_data *data, bool wakeup)
{ … }
EXPORT_SYMBOL_GPL(…);
int imx_usbmisc_resume(struct imx_usbmisc_data *data, bool wakeup)
{ … }
EXPORT_SYMBOL_GPL(…);
static const struct of_device_id usbmisc_imx_dt_ids[] = …;
MODULE_DEVICE_TABLE(of, usbmisc_imx_dt_ids);
static int usbmisc_imx_probe(struct platform_device *pdev)
{ … }
static struct platform_driver usbmisc_imx_driver = …;
module_platform_driver(…) …;
MODULE_ALIAS(…) …;
MODULE_LICENSE(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;