Greg Kroah-Hartman | 5fd54ac | 2017-11-03 11:28:30 +0100 | [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 | |
| 6 | #include <linux/module.h> |
| 7 | #include <linux/of_platform.h> |
Richard Zhao | d142d6b | 2012-09-12 14:58:05 +0300 | [diff] [blame] | 8 | #include <linux/err.h> |
| 9 | #include <linux/io.h> |
Michael Grzeschik | a068533 | 2013-03-30 12:54:01 +0200 | [diff] [blame] | 10 | #include <linux/delay.h> |
Richard Zhao | d142d6b | 2012-09-12 14:58:05 +0300 | [diff] [blame] | 11 | |
Alexander Shishkin | 8e22978 | 2013-06-24 14:46:36 +0300 | [diff] [blame] | 12 | #include "ci_hdrc_imx.h" |
Richard Zhao | d142d6b | 2012-09-12 14:58:05 +0300 | [diff] [blame] | 13 | |
Michael Grzeschik | a068533 | 2013-03-30 12:54:01 +0200 | [diff] [blame] | 14 | #define MX25_USB_PHY_CTRL_OFFSET 0x08 |
| 15 | #define MX25_BM_EXTERNAL_VBUS_DIVIDER BIT(23) |
| 16 | |
Denis Carikli | 72ee92d | 2014-04-23 15:56:36 +0800 | [diff] [blame] | 17 | #define MX25_EHCI_INTERFACE_SINGLE_UNI (2 << 0) |
| 18 | #define MX25_EHCI_INTERFACE_DIFF_UNI (0 << 0) |
| 19 | #define MX25_EHCI_INTERFACE_MASK (0xf) |
| 20 | |
| 21 | #define MX25_OTG_SIC_SHIFT 29 |
| 22 | #define MX25_OTG_SIC_MASK (0x3 << MX25_OTG_SIC_SHIFT) |
| 23 | #define MX25_OTG_PM_BIT BIT(24) |
| 24 | #define MX25_OTG_PP_BIT BIT(11) |
| 25 | #define MX25_OTG_OCPOL_BIT BIT(3) |
| 26 | |
| 27 | #define MX25_H1_SIC_SHIFT 21 |
| 28 | #define MX25_H1_SIC_MASK (0x3 << MX25_H1_SIC_SHIFT) |
| 29 | #define MX25_H1_PP_BIT BIT(18) |
| 30 | #define MX25_H1_PM_BIT BIT(16) |
| 31 | #define MX25_H1_IPPUE_UP_BIT BIT(7) |
| 32 | #define MX25_H1_IPPUE_DOWN_BIT BIT(6) |
| 33 | #define MX25_H1_TLL_BIT BIT(5) |
| 34 | #define MX25_H1_USBTE_BIT BIT(4) |
| 35 | #define MX25_H1_OCPOL_BIT BIT(2) |
| 36 | |
Alexander Shiyan | 9f90e11 | 2013-12-06 16:35:14 +0800 | [diff] [blame] | 37 | #define MX27_H1_PM_BIT BIT(8) |
| 38 | #define MX27_H2_PM_BIT BIT(16) |
| 39 | #define MX27_OTG_PM_BIT BIT(24) |
| 40 | |
Michael Grzeschik | f0c910b | 2013-03-30 12:54:00 +0200 | [diff] [blame] | 41 | #define MX53_USB_OTG_PHY_CTRL_0_OFFSET 0x08 |
Fabio Estevam | 33f92a8 | 2014-05-04 09:24:39 +0800 | [diff] [blame] | 42 | #define MX53_USB_OTG_PHY_CTRL_1_OFFSET 0x0c |
Fabien Lahoudere | d13631b | 2016-09-26 13:14:19 +0200 | [diff] [blame] | 43 | #define MX53_USB_CTRL_1_OFFSET 0x10 |
| 44 | #define MX53_USB_CTRL_1_H2_XCVR_CLK_SEL_MASK (0x11 << 2) |
| 45 | #define MX53_USB_CTRL_1_H2_XCVR_CLK_SEL_ULPI BIT(2) |
| 46 | #define MX53_USB_CTRL_1_H3_XCVR_CLK_SEL_MASK (0x11 << 6) |
| 47 | #define MX53_USB_CTRL_1_H3_XCVR_CLK_SEL_ULPI BIT(6) |
Michael Grzeschik | f0c910b | 2013-03-30 12:54:00 +0200 | [diff] [blame] | 48 | #define MX53_USB_UH2_CTRL_OFFSET 0x14 |
| 49 | #define MX53_USB_UH3_CTRL_OFFSET 0x18 |
Fabien Lahoudere | 3be3251 | 2016-09-26 13:14:20 +0200 | [diff] [blame] | 50 | #define MX53_USB_CLKONOFF_CTRL_OFFSET 0x24 |
| 51 | #define MX53_USB_CLKONOFF_CTRL_H2_INT60CKOFF BIT(21) |
| 52 | #define MX53_USB_CLKONOFF_CTRL_H3_INT60CKOFF BIT(22) |
Michael Grzeschik | f0c910b | 2013-03-30 12:54:00 +0200 | [diff] [blame] | 53 | #define MX53_BM_OVER_CUR_DIS_H1 BIT(5) |
| 54 | #define MX53_BM_OVER_CUR_DIS_OTG BIT(8) |
| 55 | #define MX53_BM_OVER_CUR_DIS_UHx BIT(30) |
Fabien Lahoudere | d13631b | 2016-09-26 13:14:19 +0200 | [diff] [blame] | 56 | #define MX53_USB_CTRL_1_UH2_ULPI_EN BIT(26) |
| 57 | #define MX53_USB_CTRL_1_UH3_ULPI_EN BIT(27) |
| 58 | #define MX53_USB_UHx_CTRL_WAKE_UP_EN BIT(7) |
| 59 | #define MX53_USB_UHx_CTRL_ULPI_INT_EN BIT(8) |
Fabio Estevam | 33f92a8 | 2014-05-04 09:24:39 +0800 | [diff] [blame] | 60 | #define MX53_USB_PHYCTRL1_PLLDIV_MASK 0x3 |
| 61 | #define MX53_USB_PLL_DIV_24_MHZ 0x01 |
Michael Grzeschik | f0c910b | 2013-03-30 12:54:00 +0200 | [diff] [blame] | 62 | |
Peter Chen | ed6e5eb | 2014-11-05 14:58:32 +0800 | [diff] [blame] | 63 | #define MX6_BM_NON_BURST_SETTING BIT(1) |
Marc Kleine-Budde | e609108 | 2013-03-30 12:53:59 +0200 | [diff] [blame] | 64 | #define MX6_BM_OVER_CUR_DIS BIT(7) |
Li Jun | 9dba516 | 2016-07-20 16:02:42 +0800 | [diff] [blame] | 65 | #define MX6_BM_OVER_CUR_POLARITY BIT(8) |
Peter Chen | f636cec | 2015-02-11 12:44:46 +0800 | [diff] [blame] | 66 | #define MX6_BM_WAKEUP_ENABLE BIT(10) |
| 67 | #define MX6_BM_ID_WAKEUP BIT(16) |
| 68 | #define MX6_BM_VBUS_WAKEUP BIT(17) |
Peter Chen | 8721a75 | 2015-02-11 12:44:53 +0800 | [diff] [blame] | 69 | #define MX6SX_BM_DPDM_WAKEUP_EN BIT(29) |
Peter Chen | f636cec | 2015-02-11 12:44:46 +0800 | [diff] [blame] | 70 | #define MX6_BM_WAKEUP_INTR BIT(31) |
Peter Chen | 8721a75 | 2015-02-11 12:44:53 +0800 | [diff] [blame] | 71 | #define MX6_USB_OTG1_PHY_CTRL 0x18 |
| 72 | /* For imx6dql, it is host-only controller, for later imx6, it is otg's */ |
| 73 | #define MX6_USB_OTG2_PHY_CTRL 0x1c |
| 74 | #define MX6SX_USB_VBUS_WAKEUP_SOURCE(v) (v << 8) |
| 75 | #define MX6SX_USB_VBUS_WAKEUP_SOURCE_VBUS MX6SX_USB_VBUS_WAKEUP_SOURCE(0) |
| 76 | #define MX6SX_USB_VBUS_WAKEUP_SOURCE_AVALID MX6SX_USB_VBUS_WAKEUP_SOURCE(1) |
| 77 | #define MX6SX_USB_VBUS_WAKEUP_SOURCE_BVALID MX6SX_USB_VBUS_WAKEUP_SOURCE(2) |
| 78 | #define MX6SX_USB_VBUS_WAKEUP_SOURCE_SESS_END MX6SX_USB_VBUS_WAKEUP_SOURCE(3) |
Richard Zhao | d142d6b | 2012-09-12 14:58:05 +0300 | [diff] [blame] | 79 | |
Stefan Agner | f40017e | 2014-09-22 08:14:15 +0800 | [diff] [blame] | 80 | #define VF610_OVER_CUR_DIS BIT(7) |
| 81 | |
Peter Chen | 5cb377c | 2015-09-09 16:33:02 +0800 | [diff] [blame] | 82 | #define MX7D_USBNC_USB_CTRL2 0x4 |
| 83 | #define MX7D_USB_VBUS_WAKEUP_SOURCE_MASK 0x3 |
| 84 | #define MX7D_USB_VBUS_WAKEUP_SOURCE(v) (v << 0) |
| 85 | #define MX7D_USB_VBUS_WAKEUP_SOURCE_VBUS MX7D_USB_VBUS_WAKEUP_SOURCE(0) |
| 86 | #define MX7D_USB_VBUS_WAKEUP_SOURCE_AVALID MX7D_USB_VBUS_WAKEUP_SOURCE(1) |
| 87 | #define MX7D_USB_VBUS_WAKEUP_SOURCE_BVALID MX7D_USB_VBUS_WAKEUP_SOURCE(2) |
| 88 | #define MX7D_USB_VBUS_WAKEUP_SOURCE_SESS_END MX7D_USB_VBUS_WAKEUP_SOURCE(3) |
| 89 | |
Sascha Hauer | 05986ba | 2013-08-14 12:44:16 +0300 | [diff] [blame] | 90 | struct usbmisc_ops { |
| 91 | /* It's called once when probe a usb device */ |
| 92 | int (*init)(struct imx_usbmisc_data *data); |
| 93 | /* It's called once after adding a usb device */ |
| 94 | int (*post)(struct imx_usbmisc_data *data); |
Peter Chen | f636cec | 2015-02-11 12:44:46 +0800 | [diff] [blame] | 95 | /* It's called when we need to enable/disable usb wakeup */ |
| 96 | int (*set_wakeup)(struct imx_usbmisc_data *data, bool enabled); |
Sascha Hauer | 05986ba | 2013-08-14 12:44:16 +0300 | [diff] [blame] | 97 | }; |
| 98 | |
Michael Grzeschik | a7bc2fd | 2013-03-30 12:53:56 +0200 | [diff] [blame] | 99 | struct imx_usbmisc { |
Richard Zhao | d142d6b | 2012-09-12 14:58:05 +0300 | [diff] [blame] | 100 | void __iomem *base; |
| 101 | spinlock_t lock; |
Marc Kleine-Budde | e609108 | 2013-03-30 12:53:59 +0200 | [diff] [blame] | 102 | const struct usbmisc_ops *ops; |
Richard Zhao | d142d6b | 2012-09-12 14:58:05 +0300 | [diff] [blame] | 103 | }; |
| 104 | |
Andrey Smirnov | 62b97d5 | 2017-05-15 06:48:58 -0700 | [diff] [blame] | 105 | static inline bool is_imx53_usbmisc(struct imx_usbmisc_data *data); |
| 106 | |
Denis Carikli | 72ee92d | 2014-04-23 15:56:36 +0800 | [diff] [blame] | 107 | static int usbmisc_imx25_init(struct imx_usbmisc_data *data) |
| 108 | { |
Stefan Agner | f40017e | 2014-09-22 08:14:15 +0800 | [diff] [blame] | 109 | struct imx_usbmisc *usbmisc = dev_get_drvdata(data->dev); |
Denis Carikli | 72ee92d | 2014-04-23 15:56:36 +0800 | [diff] [blame] | 110 | unsigned long flags; |
| 111 | u32 val = 0; |
| 112 | |
| 113 | if (data->index > 1) |
| 114 | return -EINVAL; |
| 115 | |
| 116 | spin_lock_irqsave(&usbmisc->lock, flags); |
| 117 | switch (data->index) { |
| 118 | case 0: |
| 119 | val = readl(usbmisc->base); |
| 120 | val &= ~(MX25_OTG_SIC_MASK | MX25_OTG_PP_BIT); |
| 121 | val |= (MX25_EHCI_INTERFACE_DIFF_UNI & MX25_EHCI_INTERFACE_MASK) << MX25_OTG_SIC_SHIFT; |
| 122 | val |= (MX25_OTG_PM_BIT | MX25_OTG_OCPOL_BIT); |
| 123 | writel(val, usbmisc->base); |
| 124 | break; |
| 125 | case 1: |
| 126 | val = readl(usbmisc->base); |
| 127 | val &= ~(MX25_H1_SIC_MASK | MX25_H1_PP_BIT | MX25_H1_IPPUE_UP_BIT); |
| 128 | val |= (MX25_EHCI_INTERFACE_SINGLE_UNI & MX25_EHCI_INTERFACE_MASK) << MX25_H1_SIC_SHIFT; |
| 129 | val |= (MX25_H1_PM_BIT | MX25_H1_OCPOL_BIT | MX25_H1_TLL_BIT | |
| 130 | MX25_H1_USBTE_BIT | MX25_H1_IPPUE_DOWN_BIT); |
| 131 | |
| 132 | writel(val, usbmisc->base); |
| 133 | |
| 134 | break; |
| 135 | } |
| 136 | spin_unlock_irqrestore(&usbmisc->lock, flags); |
| 137 | |
| 138 | return 0; |
| 139 | } |
| 140 | |
Sascha Hauer | 05986ba | 2013-08-14 12:44:16 +0300 | [diff] [blame] | 141 | static int usbmisc_imx25_post(struct imx_usbmisc_data *data) |
Richard Zhao | d142d6b | 2012-09-12 14:58:05 +0300 | [diff] [blame] | 142 | { |
Stefan Agner | f40017e | 2014-09-22 08:14:15 +0800 | [diff] [blame] | 143 | struct imx_usbmisc *usbmisc = dev_get_drvdata(data->dev); |
Michael Grzeschik | a068533 | 2013-03-30 12:54:01 +0200 | [diff] [blame] | 144 | void __iomem *reg; |
| 145 | unsigned long flags; |
| 146 | u32 val; |
| 147 | |
Sascha Hauer | 05986ba | 2013-08-14 12:44:16 +0300 | [diff] [blame] | 148 | if (data->index > 2) |
| 149 | return -EINVAL; |
Michael Grzeschik | a068533 | 2013-03-30 12:54:01 +0200 | [diff] [blame] | 150 | |
Sascha Hauer | 05986ba | 2013-08-14 12:44:16 +0300 | [diff] [blame] | 151 | if (data->evdo) { |
Michael Grzeschik | a068533 | 2013-03-30 12:54:01 +0200 | [diff] [blame] | 152 | spin_lock_irqsave(&usbmisc->lock, flags); |
Fabio Estevam | 8d1dc4d | 2014-11-26 13:44:25 +0800 | [diff] [blame] | 153 | reg = usbmisc->base + MX25_USB_PHY_CTRL_OFFSET; |
Michael Grzeschik | a068533 | 2013-03-30 12:54:01 +0200 | [diff] [blame] | 154 | val = readl(reg); |
| 155 | writel(val | MX25_BM_EXTERNAL_VBUS_DIVIDER, reg); |
| 156 | spin_unlock_irqrestore(&usbmisc->lock, flags); |
| 157 | usleep_range(5000, 10000); /* needed to stabilize voltage */ |
| 158 | } |
| 159 | |
| 160 | return 0; |
| 161 | } |
| 162 | |
Alexander Shiyan | 9f90e11 | 2013-12-06 16:35:14 +0800 | [diff] [blame] | 163 | static int usbmisc_imx27_init(struct imx_usbmisc_data *data) |
| 164 | { |
Stefan Agner | f40017e | 2014-09-22 08:14:15 +0800 | [diff] [blame] | 165 | struct imx_usbmisc *usbmisc = dev_get_drvdata(data->dev); |
Alexander Shiyan | 9f90e11 | 2013-12-06 16:35:14 +0800 | [diff] [blame] | 166 | unsigned long flags; |
| 167 | u32 val; |
| 168 | |
| 169 | switch (data->index) { |
| 170 | case 0: |
| 171 | val = MX27_OTG_PM_BIT; |
| 172 | break; |
| 173 | case 1: |
| 174 | val = MX27_H1_PM_BIT; |
| 175 | break; |
| 176 | case 2: |
| 177 | val = MX27_H2_PM_BIT; |
| 178 | break; |
| 179 | default: |
| 180 | return -EINVAL; |
Fabio Estevam | aa90e99 | 2015-05-09 12:15:24 -0300 | [diff] [blame] | 181 | } |
Alexander Shiyan | 9f90e11 | 2013-12-06 16:35:14 +0800 | [diff] [blame] | 182 | |
| 183 | spin_lock_irqsave(&usbmisc->lock, flags); |
| 184 | if (data->disable_oc) |
| 185 | val = readl(usbmisc->base) | val; |
| 186 | else |
| 187 | val = readl(usbmisc->base) & ~val; |
| 188 | writel(val, usbmisc->base); |
| 189 | spin_unlock_irqrestore(&usbmisc->lock, flags); |
| 190 | |
| 191 | return 0; |
| 192 | } |
| 193 | |
Sascha Hauer | 05986ba | 2013-08-14 12:44:16 +0300 | [diff] [blame] | 194 | static int usbmisc_imx53_init(struct imx_usbmisc_data *data) |
Michael Grzeschik | f0c910b | 2013-03-30 12:54:00 +0200 | [diff] [blame] | 195 | { |
Stefan Agner | f40017e | 2014-09-22 08:14:15 +0800 | [diff] [blame] | 196 | struct imx_usbmisc *usbmisc = dev_get_drvdata(data->dev); |
Michael Grzeschik | f0c910b | 2013-03-30 12:54:00 +0200 | [diff] [blame] | 197 | void __iomem *reg = NULL; |
| 198 | unsigned long flags; |
| 199 | u32 val = 0; |
| 200 | |
Sascha Hauer | 05986ba | 2013-08-14 12:44:16 +0300 | [diff] [blame] | 201 | if (data->index > 3) |
| 202 | return -EINVAL; |
Michael Grzeschik | f0c910b | 2013-03-30 12:54:00 +0200 | [diff] [blame] | 203 | |
Fabio Estevam | 33f92a8 | 2014-05-04 09:24:39 +0800 | [diff] [blame] | 204 | /* Select a 24 MHz reference clock for the PHY */ |
Fabio Estevam | 4a1d6cf | 2014-11-26 13:44:26 +0800 | [diff] [blame] | 205 | val = readl(usbmisc->base + MX53_USB_OTG_PHY_CTRL_1_OFFSET); |
Fabio Estevam | 33f92a8 | 2014-05-04 09:24:39 +0800 | [diff] [blame] | 206 | val &= ~MX53_USB_PHYCTRL1_PLLDIV_MASK; |
| 207 | val |= MX53_USB_PLL_DIV_24_MHZ; |
| 208 | writel(val, usbmisc->base + MX53_USB_OTG_PHY_CTRL_1_OFFSET); |
| 209 | |
Fabien Lahoudere | d13631b | 2016-09-26 13:14:19 +0200 | [diff] [blame] | 210 | spin_lock_irqsave(&usbmisc->lock, flags); |
| 211 | |
| 212 | switch (data->index) { |
| 213 | case 0: |
| 214 | if (data->disable_oc) { |
Michael Grzeschik | f0c910b | 2013-03-30 12:54:00 +0200 | [diff] [blame] | 215 | reg = usbmisc->base + MX53_USB_OTG_PHY_CTRL_0_OFFSET; |
| 216 | val = readl(reg) | MX53_BM_OVER_CUR_DIS_OTG; |
Fabien Lahoudere | d13631b | 2016-09-26 13:14:19 +0200 | [diff] [blame] | 217 | writel(val, reg); |
| 218 | } |
| 219 | break; |
| 220 | case 1: |
| 221 | if (data->disable_oc) { |
Michael Grzeschik | f0c910b | 2013-03-30 12:54:00 +0200 | [diff] [blame] | 222 | reg = usbmisc->base + MX53_USB_OTG_PHY_CTRL_0_OFFSET; |
| 223 | val = readl(reg) | MX53_BM_OVER_CUR_DIS_H1; |
Fabien Lahoudere | d13631b | 2016-09-26 13:14:19 +0200 | [diff] [blame] | 224 | writel(val, reg); |
| 225 | } |
| 226 | break; |
| 227 | case 2: |
| 228 | if (data->ulpi) { |
| 229 | /* set USBH2 into ULPI-mode. */ |
| 230 | reg = usbmisc->base + MX53_USB_CTRL_1_OFFSET; |
| 231 | val = readl(reg) | MX53_USB_CTRL_1_UH2_ULPI_EN; |
| 232 | /* select ULPI clock */ |
| 233 | val &= ~MX53_USB_CTRL_1_H2_XCVR_CLK_SEL_MASK; |
| 234 | val |= MX53_USB_CTRL_1_H2_XCVR_CLK_SEL_ULPI; |
| 235 | writel(val, reg); |
| 236 | /* Set interrupt wake up enable */ |
| 237 | reg = usbmisc->base + MX53_USB_UH2_CTRL_OFFSET; |
| 238 | val = readl(reg) | MX53_USB_UHx_CTRL_WAKE_UP_EN |
| 239 | | MX53_USB_UHx_CTRL_ULPI_INT_EN; |
| 240 | writel(val, reg); |
Andrey Smirnov | 62b97d5 | 2017-05-15 06:48:58 -0700 | [diff] [blame] | 241 | if (is_imx53_usbmisc(data)) { |
| 242 | /* Disable internal 60Mhz clock */ |
| 243 | reg = usbmisc->base + |
| 244 | MX53_USB_CLKONOFF_CTRL_OFFSET; |
| 245 | val = readl(reg) | |
| 246 | MX53_USB_CLKONOFF_CTRL_H2_INT60CKOFF; |
| 247 | writel(val, reg); |
| 248 | } |
| 249 | |
Fabien Lahoudere | d13631b | 2016-09-26 13:14:19 +0200 | [diff] [blame] | 250 | } |
| 251 | if (data->disable_oc) { |
Michael Grzeschik | f0c910b | 2013-03-30 12:54:00 +0200 | [diff] [blame] | 252 | reg = usbmisc->base + MX53_USB_UH2_CTRL_OFFSET; |
| 253 | val = readl(reg) | MX53_BM_OVER_CUR_DIS_UHx; |
Fabien Lahoudere | d13631b | 2016-09-26 13:14:19 +0200 | [diff] [blame] | 254 | writel(val, reg); |
| 255 | } |
| 256 | break; |
| 257 | case 3: |
| 258 | if (data->ulpi) { |
| 259 | /* set USBH3 into ULPI-mode. */ |
| 260 | reg = usbmisc->base + MX53_USB_CTRL_1_OFFSET; |
| 261 | val = readl(reg) | MX53_USB_CTRL_1_UH3_ULPI_EN; |
| 262 | /* select ULPI clock */ |
| 263 | val &= ~MX53_USB_CTRL_1_H3_XCVR_CLK_SEL_MASK; |
| 264 | val |= MX53_USB_CTRL_1_H3_XCVR_CLK_SEL_ULPI; |
| 265 | writel(val, reg); |
| 266 | /* Set interrupt wake up enable */ |
| 267 | reg = usbmisc->base + MX53_USB_UH3_CTRL_OFFSET; |
| 268 | val = readl(reg) | MX53_USB_UHx_CTRL_WAKE_UP_EN |
| 269 | | MX53_USB_UHx_CTRL_ULPI_INT_EN; |
| 270 | writel(val, reg); |
Andrey Smirnov | 62b97d5 | 2017-05-15 06:48:58 -0700 | [diff] [blame] | 271 | |
| 272 | if (is_imx53_usbmisc(data)) { |
| 273 | /* Disable internal 60Mhz clock */ |
| 274 | reg = usbmisc->base + |
| 275 | MX53_USB_CLKONOFF_CTRL_OFFSET; |
| 276 | val = readl(reg) | |
| 277 | MX53_USB_CLKONOFF_CTRL_H3_INT60CKOFF; |
| 278 | writel(val, reg); |
| 279 | } |
Fabien Lahoudere | d13631b | 2016-09-26 13:14:19 +0200 | [diff] [blame] | 280 | } |
| 281 | if (data->disable_oc) { |
Michael Grzeschik | f0c910b | 2013-03-30 12:54:00 +0200 | [diff] [blame] | 282 | reg = usbmisc->base + MX53_USB_UH3_CTRL_OFFSET; |
| 283 | val = readl(reg) | MX53_BM_OVER_CUR_DIS_UHx; |
Michael Grzeschik | f0c910b | 2013-03-30 12:54:00 +0200 | [diff] [blame] | 284 | writel(val, reg); |
Fabien Lahoudere | d13631b | 2016-09-26 13:14:19 +0200 | [diff] [blame] | 285 | } |
| 286 | break; |
Michael Grzeschik | f0c910b | 2013-03-30 12:54:00 +0200 | [diff] [blame] | 287 | } |
| 288 | |
Fabien Lahoudere | d13631b | 2016-09-26 13:14:19 +0200 | [diff] [blame] | 289 | spin_unlock_irqrestore(&usbmisc->lock, flags); |
| 290 | |
Michael Grzeschik | f0c910b | 2013-03-30 12:54:00 +0200 | [diff] [blame] | 291 | return 0; |
| 292 | } |
| 293 | |
Peter Chen | f636cec | 2015-02-11 12:44:46 +0800 | [diff] [blame] | 294 | static int usbmisc_imx6q_set_wakeup |
| 295 | (struct imx_usbmisc_data *data, bool enabled) |
| 296 | { |
| 297 | struct imx_usbmisc *usbmisc = dev_get_drvdata(data->dev); |
| 298 | unsigned long flags; |
| 299 | u32 val; |
| 300 | u32 wakeup_setting = (MX6_BM_WAKEUP_ENABLE | |
| 301 | MX6_BM_VBUS_WAKEUP | MX6_BM_ID_WAKEUP); |
| 302 | int ret = 0; |
| 303 | |
| 304 | if (data->index > 3) |
| 305 | return -EINVAL; |
| 306 | |
| 307 | spin_lock_irqsave(&usbmisc->lock, flags); |
| 308 | val = readl(usbmisc->base + data->index * 4); |
| 309 | if (enabled) { |
| 310 | val |= wakeup_setting; |
| 311 | writel(val, usbmisc->base + data->index * 4); |
| 312 | } else { |
| 313 | if (val & MX6_BM_WAKEUP_INTR) |
| 314 | pr_debug("wakeup int at ci_hdrc.%d\n", data->index); |
| 315 | val &= ~wakeup_setting; |
| 316 | writel(val, usbmisc->base + data->index * 4); |
| 317 | } |
| 318 | spin_unlock_irqrestore(&usbmisc->lock, flags); |
| 319 | |
| 320 | return ret; |
| 321 | } |
| 322 | |
Sascha Hauer | 05986ba | 2013-08-14 12:44:16 +0300 | [diff] [blame] | 323 | static int usbmisc_imx6q_init(struct imx_usbmisc_data *data) |
Richard Zhao | d142d6b | 2012-09-12 14:58:05 +0300 | [diff] [blame] | 324 | { |
Stefan Agner | f40017e | 2014-09-22 08:14:15 +0800 | [diff] [blame] | 325 | struct imx_usbmisc *usbmisc = dev_get_drvdata(data->dev); |
Richard Zhao | d142d6b | 2012-09-12 14:58:05 +0300 | [diff] [blame] | 326 | unsigned long flags; |
| 327 | u32 reg; |
| 328 | |
Sascha Hauer | 05986ba | 2013-08-14 12:44:16 +0300 | [diff] [blame] | 329 | if (data->index > 3) |
| 330 | return -EINVAL; |
Richard Zhao | d142d6b | 2012-09-12 14:58:05 +0300 | [diff] [blame] | 331 | |
Peter Chen | ed6e5eb | 2014-11-05 14:58:32 +0800 | [diff] [blame] | 332 | spin_lock_irqsave(&usbmisc->lock, flags); |
| 333 | |
Li Jun | 9dba516 | 2016-07-20 16:02:42 +0800 | [diff] [blame] | 334 | reg = readl(usbmisc->base + data->index * 4); |
Sascha Hauer | 05986ba | 2013-08-14 12:44:16 +0300 | [diff] [blame] | 335 | if (data->disable_oc) { |
Li Jun | 9dba516 | 2016-07-20 16:02:42 +0800 | [diff] [blame] | 336 | reg |= MX6_BM_OVER_CUR_DIS; |
| 337 | } else if (data->oc_polarity == 1) { |
| 338 | /* High active */ |
| 339 | reg &= ~(MX6_BM_OVER_CUR_DIS | MX6_BM_OVER_CUR_POLARITY); |
Richard Zhao | d142d6b | 2012-09-12 14:58:05 +0300 | [diff] [blame] | 340 | } |
Li Jun | 9dba516 | 2016-07-20 16:02:42 +0800 | [diff] [blame] | 341 | writel(reg, usbmisc->base + data->index * 4); |
Richard Zhao | d142d6b | 2012-09-12 14:58:05 +0300 | [diff] [blame] | 342 | |
Peter Chen | ed6e5eb | 2014-11-05 14:58:32 +0800 | [diff] [blame] | 343 | /* SoC non-burst setting */ |
| 344 | reg = readl(usbmisc->base + data->index * 4); |
| 345 | writel(reg | MX6_BM_NON_BURST_SETTING, |
| 346 | usbmisc->base + data->index * 4); |
| 347 | |
| 348 | spin_unlock_irqrestore(&usbmisc->lock, flags); |
| 349 | |
Peter Chen | f636cec | 2015-02-11 12:44:46 +0800 | [diff] [blame] | 350 | usbmisc_imx6q_set_wakeup(data, false); |
| 351 | |
Richard Zhao | d142d6b | 2012-09-12 14:58:05 +0300 | [diff] [blame] | 352 | return 0; |
| 353 | } |
| 354 | |
Peter Chen | 8721a75 | 2015-02-11 12:44:53 +0800 | [diff] [blame] | 355 | static int usbmisc_imx6sx_init(struct imx_usbmisc_data *data) |
| 356 | { |
| 357 | void __iomem *reg = NULL; |
| 358 | unsigned long flags; |
| 359 | struct imx_usbmisc *usbmisc = dev_get_drvdata(data->dev); |
| 360 | u32 val; |
Peter Chen | 8721a75 | 2015-02-11 12:44:53 +0800 | [diff] [blame] | 361 | |
| 362 | usbmisc_imx6q_init(data); |
| 363 | |
| 364 | if (data->index == 0 || data->index == 1) { |
| 365 | reg = usbmisc->base + MX6_USB_OTG1_PHY_CTRL + data->index * 4; |
| 366 | spin_lock_irqsave(&usbmisc->lock, flags); |
| 367 | /* Set vbus wakeup source as bvalid */ |
| 368 | val = readl(reg); |
| 369 | writel(val | MX6SX_USB_VBUS_WAKEUP_SOURCE_BVALID, reg); |
| 370 | /* |
| 371 | * Disable dp/dm wakeup in device mode when vbus is |
| 372 | * not there. |
| 373 | */ |
| 374 | val = readl(usbmisc->base + data->index * 4); |
| 375 | writel(val & ~MX6SX_BM_DPDM_WAKEUP_EN, |
| 376 | usbmisc->base + data->index * 4); |
| 377 | spin_unlock_irqrestore(&usbmisc->lock, flags); |
| 378 | } |
| 379 | |
kbuild test robot | 1fcefbd | 2015-03-25 07:23:52 +0100 | [diff] [blame] | 380 | return 0; |
Peter Chen | 8721a75 | 2015-02-11 12:44:53 +0800 | [diff] [blame] | 381 | } |
| 382 | |
Stefan Agner | f40017e | 2014-09-22 08:14:15 +0800 | [diff] [blame] | 383 | static int usbmisc_vf610_init(struct imx_usbmisc_data *data) |
| 384 | { |
| 385 | struct imx_usbmisc *usbmisc = dev_get_drvdata(data->dev); |
| 386 | u32 reg; |
| 387 | |
| 388 | /* |
| 389 | * Vybrid only has one misc register set, but in two different |
| 390 | * areas. These is reflected in two instances of this driver. |
| 391 | */ |
| 392 | if (data->index >= 1) |
| 393 | return -EINVAL; |
| 394 | |
| 395 | if (data->disable_oc) { |
| 396 | reg = readl(usbmisc->base); |
| 397 | writel(reg | VF610_OVER_CUR_DIS, usbmisc->base); |
| 398 | } |
| 399 | |
| 400 | return 0; |
| 401 | } |
| 402 | |
Peter Chen | 5cb377c | 2015-09-09 16:33:02 +0800 | [diff] [blame] | 403 | static int usbmisc_imx7d_set_wakeup |
| 404 | (struct imx_usbmisc_data *data, bool enabled) |
| 405 | { |
| 406 | struct imx_usbmisc *usbmisc = dev_get_drvdata(data->dev); |
| 407 | unsigned long flags; |
| 408 | u32 val; |
| 409 | u32 wakeup_setting = (MX6_BM_WAKEUP_ENABLE | |
| 410 | MX6_BM_VBUS_WAKEUP | MX6_BM_ID_WAKEUP); |
| 411 | |
| 412 | spin_lock_irqsave(&usbmisc->lock, flags); |
| 413 | val = readl(usbmisc->base); |
| 414 | if (enabled) { |
| 415 | writel(val | wakeup_setting, usbmisc->base); |
| 416 | } else { |
| 417 | if (val & MX6_BM_WAKEUP_INTR) |
| 418 | dev_dbg(data->dev, "wakeup int\n"); |
| 419 | writel(val & ~wakeup_setting, usbmisc->base); |
| 420 | } |
| 421 | spin_unlock_irqrestore(&usbmisc->lock, flags); |
| 422 | |
| 423 | return 0; |
| 424 | } |
| 425 | |
| 426 | static int usbmisc_imx7d_init(struct imx_usbmisc_data *data) |
| 427 | { |
| 428 | struct imx_usbmisc *usbmisc = dev_get_drvdata(data->dev); |
| 429 | unsigned long flags; |
| 430 | u32 reg; |
| 431 | |
| 432 | if (data->index >= 1) |
| 433 | return -EINVAL; |
| 434 | |
| 435 | spin_lock_irqsave(&usbmisc->lock, flags); |
Li Jun | 9dba516 | 2016-07-20 16:02:42 +0800 | [diff] [blame] | 436 | reg = readl(usbmisc->base); |
Peter Chen | 5cb377c | 2015-09-09 16:33:02 +0800 | [diff] [blame] | 437 | if (data->disable_oc) { |
Li Jun | 9dba516 | 2016-07-20 16:02:42 +0800 | [diff] [blame] | 438 | reg |= MX6_BM_OVER_CUR_DIS; |
| 439 | } else if (data->oc_polarity == 1) { |
| 440 | /* High active */ |
| 441 | reg &= ~(MX6_BM_OVER_CUR_DIS | MX6_BM_OVER_CUR_POLARITY); |
Peter Chen | 5cb377c | 2015-09-09 16:33:02 +0800 | [diff] [blame] | 442 | } |
Li Jun | 9dba516 | 2016-07-20 16:02:42 +0800 | [diff] [blame] | 443 | writel(reg, usbmisc->base); |
Peter Chen | 5cb377c | 2015-09-09 16:33:02 +0800 | [diff] [blame] | 444 | |
| 445 | reg = readl(usbmisc->base + MX7D_USBNC_USB_CTRL2); |
| 446 | reg &= ~MX7D_USB_VBUS_WAKEUP_SOURCE_MASK; |
| 447 | writel(reg | MX7D_USB_VBUS_WAKEUP_SOURCE_BVALID, |
| 448 | usbmisc->base + MX7D_USBNC_USB_CTRL2); |
| 449 | spin_unlock_irqrestore(&usbmisc->lock, flags); |
| 450 | |
| 451 | usbmisc_imx7d_set_wakeup(data, false); |
| 452 | |
| 453 | return 0; |
| 454 | } |
| 455 | |
Michael Grzeschik | a068533 | 2013-03-30 12:54:01 +0200 | [diff] [blame] | 456 | static const struct usbmisc_ops imx25_usbmisc_ops = { |
Denis Carikli | 72ee92d | 2014-04-23 15:56:36 +0800 | [diff] [blame] | 457 | .init = usbmisc_imx25_init, |
Michael Grzeschik | a068533 | 2013-03-30 12:54:01 +0200 | [diff] [blame] | 458 | .post = usbmisc_imx25_post, |
| 459 | }; |
| 460 | |
Alexander Shiyan | 9f90e11 | 2013-12-06 16:35:14 +0800 | [diff] [blame] | 461 | static const struct usbmisc_ops imx27_usbmisc_ops = { |
| 462 | .init = usbmisc_imx27_init, |
| 463 | }; |
| 464 | |
Andrey Smirnov | 62b97d5 | 2017-05-15 06:48:58 -0700 | [diff] [blame] | 465 | static const struct usbmisc_ops imx51_usbmisc_ops = { |
| 466 | .init = usbmisc_imx53_init, |
| 467 | }; |
| 468 | |
Michael Grzeschik | f0c910b | 2013-03-30 12:54:00 +0200 | [diff] [blame] | 469 | static const struct usbmisc_ops imx53_usbmisc_ops = { |
| 470 | .init = usbmisc_imx53_init, |
| 471 | }; |
| 472 | |
Richard Zhao | d142d6b | 2012-09-12 14:58:05 +0300 | [diff] [blame] | 473 | static const struct usbmisc_ops imx6q_usbmisc_ops = { |
Peter Chen | f636cec | 2015-02-11 12:44:46 +0800 | [diff] [blame] | 474 | .set_wakeup = usbmisc_imx6q_set_wakeup, |
Richard Zhao | d142d6b | 2012-09-12 14:58:05 +0300 | [diff] [blame] | 475 | .init = usbmisc_imx6q_init, |
| 476 | }; |
| 477 | |
Stefan Agner | f40017e | 2014-09-22 08:14:15 +0800 | [diff] [blame] | 478 | static const struct usbmisc_ops vf610_usbmisc_ops = { |
| 479 | .init = usbmisc_vf610_init, |
| 480 | }; |
| 481 | |
Peter Chen | 8721a75 | 2015-02-11 12:44:53 +0800 | [diff] [blame] | 482 | static const struct usbmisc_ops imx6sx_usbmisc_ops = { |
| 483 | .set_wakeup = usbmisc_imx6q_set_wakeup, |
| 484 | .init = usbmisc_imx6sx_init, |
| 485 | }; |
| 486 | |
Peter Chen | 5cb377c | 2015-09-09 16:33:02 +0800 | [diff] [blame] | 487 | static const struct usbmisc_ops imx7d_usbmisc_ops = { |
| 488 | .init = usbmisc_imx7d_init, |
| 489 | .set_wakeup = usbmisc_imx7d_set_wakeup, |
| 490 | }; |
| 491 | |
Andrey Smirnov | 62b97d5 | 2017-05-15 06:48:58 -0700 | [diff] [blame] | 492 | static inline bool is_imx53_usbmisc(struct imx_usbmisc_data *data) |
| 493 | { |
| 494 | struct imx_usbmisc *usbmisc = dev_get_drvdata(data->dev); |
| 495 | |
| 496 | return usbmisc->ops == &imx53_usbmisc_ops; |
| 497 | } |
| 498 | |
Sascha Hauer | 05986ba | 2013-08-14 12:44:16 +0300 | [diff] [blame] | 499 | int imx_usbmisc_init(struct imx_usbmisc_data *data) |
| 500 | { |
Peter Chen | a4cf1b1 | 2015-02-11 12:44:44 +0800 | [diff] [blame] | 501 | struct imx_usbmisc *usbmisc; |
Stefan Agner | f40017e | 2014-09-22 08:14:15 +0800 | [diff] [blame] | 502 | |
Peter Chen | a4cf1b1 | 2015-02-11 12:44:44 +0800 | [diff] [blame] | 503 | if (!data) |
| 504 | return 0; |
| 505 | |
| 506 | usbmisc = dev_get_drvdata(data->dev); |
Sascha Hauer | 05986ba | 2013-08-14 12:44:16 +0300 | [diff] [blame] | 507 | if (!usbmisc->ops->init) |
| 508 | return 0; |
| 509 | return usbmisc->ops->init(data); |
| 510 | } |
| 511 | EXPORT_SYMBOL_GPL(imx_usbmisc_init); |
| 512 | |
| 513 | int imx_usbmisc_init_post(struct imx_usbmisc_data *data) |
| 514 | { |
Peter Chen | a4cf1b1 | 2015-02-11 12:44:44 +0800 | [diff] [blame] | 515 | struct imx_usbmisc *usbmisc; |
Stefan Agner | f40017e | 2014-09-22 08:14:15 +0800 | [diff] [blame] | 516 | |
Peter Chen | a4cf1b1 | 2015-02-11 12:44:44 +0800 | [diff] [blame] | 517 | if (!data) |
| 518 | return 0; |
| 519 | |
| 520 | usbmisc = dev_get_drvdata(data->dev); |
Sascha Hauer | 05986ba | 2013-08-14 12:44:16 +0300 | [diff] [blame] | 521 | if (!usbmisc->ops->post) |
| 522 | return 0; |
| 523 | return usbmisc->ops->post(data); |
| 524 | } |
| 525 | EXPORT_SYMBOL_GPL(imx_usbmisc_init_post); |
| 526 | |
Peter Chen | f636cec | 2015-02-11 12:44:46 +0800 | [diff] [blame] | 527 | int imx_usbmisc_set_wakeup(struct imx_usbmisc_data *data, bool enabled) |
| 528 | { |
| 529 | struct imx_usbmisc *usbmisc; |
| 530 | |
| 531 | if (!data) |
| 532 | return 0; |
| 533 | |
| 534 | usbmisc = dev_get_drvdata(data->dev); |
| 535 | if (!usbmisc->ops->set_wakeup) |
| 536 | return 0; |
| 537 | return usbmisc->ops->set_wakeup(data, enabled); |
| 538 | } |
| 539 | EXPORT_SYMBOL_GPL(imx_usbmisc_set_wakeup); |
| 540 | |
Michael Grzeschik | a7bc2fd | 2013-03-30 12:53:56 +0200 | [diff] [blame] | 541 | static const struct of_device_id usbmisc_imx_dt_ids[] = { |
Marc Kleine-Budde | e609108 | 2013-03-30 12:53:59 +0200 | [diff] [blame] | 542 | { |
Michael Grzeschik | a068533 | 2013-03-30 12:54:01 +0200 | [diff] [blame] | 543 | .compatible = "fsl,imx25-usbmisc", |
| 544 | .data = &imx25_usbmisc_ops, |
| 545 | }, |
| 546 | { |
Denis Carikli | 72ee92d | 2014-04-23 15:56:36 +0800 | [diff] [blame] | 547 | .compatible = "fsl,imx35-usbmisc", |
| 548 | .data = &imx25_usbmisc_ops, |
| 549 | }, |
| 550 | { |
Alexander Shiyan | 9f90e11 | 2013-12-06 16:35:14 +0800 | [diff] [blame] | 551 | .compatible = "fsl,imx27-usbmisc", |
| 552 | .data = &imx27_usbmisc_ops, |
| 553 | }, |
| 554 | { |
Alexander Shiyan | c4962e0 | 2013-12-06 16:35:15 +0800 | [diff] [blame] | 555 | .compatible = "fsl,imx51-usbmisc", |
Andrey Smirnov | 62b97d5 | 2017-05-15 06:48:58 -0700 | [diff] [blame] | 556 | .data = &imx51_usbmisc_ops, |
Alexander Shiyan | c4962e0 | 2013-12-06 16:35:15 +0800 | [diff] [blame] | 557 | }, |
| 558 | { |
Michael Grzeschik | f0c910b | 2013-03-30 12:54:00 +0200 | [diff] [blame] | 559 | .compatible = "fsl,imx53-usbmisc", |
| 560 | .data = &imx53_usbmisc_ops, |
| 561 | }, |
| 562 | { |
Marc Kleine-Budde | e609108 | 2013-03-30 12:53:59 +0200 | [diff] [blame] | 563 | .compatible = "fsl,imx6q-usbmisc", |
| 564 | .data = &imx6q_usbmisc_ops, |
| 565 | }, |
Stefan Agner | f40017e | 2014-09-22 08:14:15 +0800 | [diff] [blame] | 566 | { |
| 567 | .compatible = "fsl,vf610-usbmisc", |
| 568 | .data = &vf610_usbmisc_ops, |
| 569 | }, |
Peter Chen | 8721a75 | 2015-02-11 12:44:53 +0800 | [diff] [blame] | 570 | { |
| 571 | .compatible = "fsl,imx6sx-usbmisc", |
| 572 | .data = &imx6sx_usbmisc_ops, |
| 573 | }, |
Peter Chen | 52fe568 | 2015-09-16 15:52:32 +0800 | [diff] [blame] | 574 | { |
| 575 | .compatible = "fsl,imx6ul-usbmisc", |
| 576 | .data = &imx6sx_usbmisc_ops, |
| 577 | }, |
Li Jun | 9dba516 | 2016-07-20 16:02:42 +0800 | [diff] [blame] | 578 | { |
| 579 | .compatible = "fsl,imx7d-usbmisc", |
| 580 | .data = &imx7d_usbmisc_ops, |
| 581 | }, |
Richard Zhao | d142d6b | 2012-09-12 14:58:05 +0300 | [diff] [blame] | 582 | { /* sentinel */ } |
| 583 | }; |
Arnaud Patard (Rtp) | 269b83d | 2013-06-20 23:33:25 +0200 | [diff] [blame] | 584 | MODULE_DEVICE_TABLE(of, usbmisc_imx_dt_ids); |
Richard Zhao | d142d6b | 2012-09-12 14:58:05 +0300 | [diff] [blame] | 585 | |
Michael Grzeschik | a7bc2fd | 2013-03-30 12:53:56 +0200 | [diff] [blame] | 586 | static int usbmisc_imx_probe(struct platform_device *pdev) |
Richard Zhao | d142d6b | 2012-09-12 14:58:05 +0300 | [diff] [blame] | 587 | { |
| 588 | struct resource *res; |
Michael Grzeschik | a7bc2fd | 2013-03-30 12:53:56 +0200 | [diff] [blame] | 589 | struct imx_usbmisc *data; |
LABBE Corentin | 090bc26 | 2015-11-12 08:43:33 +0100 | [diff] [blame] | 590 | const struct of_device_id *of_id; |
| 591 | |
| 592 | of_id = of_match_device(usbmisc_imx_dt_ids, &pdev->dev); |
| 593 | if (!of_id) |
| 594 | return -ENODEV; |
Richard Zhao | d142d6b | 2012-09-12 14:58:05 +0300 | [diff] [blame] | 595 | |
Richard Zhao | d142d6b | 2012-09-12 14:58:05 +0300 | [diff] [blame] | 596 | data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); |
| 597 | if (!data) |
| 598 | return -ENOMEM; |
| 599 | |
| 600 | spin_lock_init(&data->lock); |
| 601 | |
| 602 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
Thierry Reding | 148e113 | 2013-01-21 11:09:22 +0100 | [diff] [blame] | 603 | data->base = devm_ioremap_resource(&pdev->dev, res); |
| 604 | if (IS_ERR(data->base)) |
| 605 | return PTR_ERR(data->base); |
Richard Zhao | d142d6b | 2012-09-12 14:58:05 +0300 | [diff] [blame] | 606 | |
LABBE Corentin | 090bc26 | 2015-11-12 08:43:33 +0100 | [diff] [blame] | 607 | data->ops = (const struct usbmisc_ops *)of_id->data; |
Stefan Agner | f40017e | 2014-09-22 08:14:15 +0800 | [diff] [blame] | 608 | platform_set_drvdata(pdev, data); |
Richard Zhao | d142d6b | 2012-09-12 14:58:05 +0300 | [diff] [blame] | 609 | |
Richard Zhao | d142d6b | 2012-09-12 14:58:05 +0300 | [diff] [blame] | 610 | return 0; |
| 611 | } |
| 612 | |
Michael Grzeschik | a7bc2fd | 2013-03-30 12:53:56 +0200 | [diff] [blame] | 613 | static int usbmisc_imx_remove(struct platform_device *pdev) |
Richard Zhao | d142d6b | 2012-09-12 14:58:05 +0300 | [diff] [blame] | 614 | { |
Richard Zhao | d142d6b | 2012-09-12 14:58:05 +0300 | [diff] [blame] | 615 | return 0; |
| 616 | } |
| 617 | |
Michael Grzeschik | a7bc2fd | 2013-03-30 12:53:56 +0200 | [diff] [blame] | 618 | static struct platform_driver usbmisc_imx_driver = { |
| 619 | .probe = usbmisc_imx_probe, |
| 620 | .remove = usbmisc_imx_remove, |
Richard Zhao | d142d6b | 2012-09-12 14:58:05 +0300 | [diff] [blame] | 621 | .driver = { |
Michael Grzeschik | a7bc2fd | 2013-03-30 12:53:56 +0200 | [diff] [blame] | 622 | .name = "usbmisc_imx", |
Michael Grzeschik | a7bc2fd | 2013-03-30 12:53:56 +0200 | [diff] [blame] | 623 | .of_match_table = usbmisc_imx_dt_ids, |
Richard Zhao | d142d6b | 2012-09-12 14:58:05 +0300 | [diff] [blame] | 624 | }, |
| 625 | }; |
| 626 | |
Philipp Zabel | 0404ae0 | 2013-06-13 17:59:59 +0300 | [diff] [blame] | 627 | module_platform_driver(usbmisc_imx_driver); |
Richard Zhao | d142d6b | 2012-09-12 14:58:05 +0300 | [diff] [blame] | 628 | |
Michael Grzeschik | a7bc2fd | 2013-03-30 12:53:56 +0200 | [diff] [blame] | 629 | MODULE_ALIAS("platform:usbmisc-imx"); |
Richard Zhao | d142d6b | 2012-09-12 14:58:05 +0300 | [diff] [blame] | 630 | MODULE_LICENSE("GPL v2"); |
Michael Grzeschik | a7bc2fd | 2013-03-30 12:53:56 +0200 | [diff] [blame] | 631 | MODULE_DESCRIPTION("driver for imx usb non-core registers"); |
Richard Zhao | d142d6b | 2012-09-12 14:58:05 +0300 | [diff] [blame] | 632 | MODULE_AUTHOR("Richard Zhao <richard.zhao@freescale.com>"); |