Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 1 | /** |
| 2 | * core.c - DesignWare USB3 DRD Controller Core file |
| 3 | * |
| 4 | * Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 5 | * |
| 6 | * Authors: Felipe Balbi <balbi@ti.com>, |
| 7 | * Sebastian Andrzej Siewior <bigeasy@linutronix.de> |
| 8 | * |
| 9 | * Redistribution and use in source and binary forms, with or without |
| 10 | * modification, are permitted provided that the following conditions |
| 11 | * are met: |
| 12 | * 1. Redistributions of source code must retain the above copyright |
| 13 | * notice, this list of conditions, and the following disclaimer, |
| 14 | * without modification. |
| 15 | * 2. Redistributions in binary form must reproduce the above copyright |
| 16 | * notice, this list of conditions and the following disclaimer in the |
| 17 | * documentation and/or other materials provided with the distribution. |
| 18 | * 3. The names of the above-listed copyright holders may not be used |
| 19 | * to endorse or promote products derived from this software without |
| 20 | * specific prior written permission. |
| 21 | * |
| 22 | * ALTERNATIVELY, this software may be distributed under the terms of the |
| 23 | * GNU General Public License ("GPL") version 2, as published by the Free |
| 24 | * Software Foundation. |
| 25 | * |
| 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS |
| 27 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, |
| 28 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 29 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR |
| 30 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 31 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 32 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 33 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
| 34 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
| 35 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 36 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 37 | */ |
| 38 | |
Felipe Balbi | a72e658 | 2011-09-05 13:37:28 +0300 | [diff] [blame] | 39 | #include <linux/module.h> |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 40 | #include <linux/kernel.h> |
| 41 | #include <linux/slab.h> |
| 42 | #include <linux/spinlock.h> |
| 43 | #include <linux/platform_device.h> |
| 44 | #include <linux/pm_runtime.h> |
| 45 | #include <linux/interrupt.h> |
| 46 | #include <linux/ioport.h> |
| 47 | #include <linux/io.h> |
| 48 | #include <linux/list.h> |
| 49 | #include <linux/delay.h> |
| 50 | #include <linux/dma-mapping.h> |
Felipe Balbi | 457e84b | 2012-01-18 18:04:09 +0200 | [diff] [blame] | 51 | #include <linux/of.h> |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 52 | |
Felipe Balbi | 51e1e7b | 2012-07-19 14:09:48 +0300 | [diff] [blame] | 53 | #include <linux/usb/otg.h> |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 54 | #include <linux/usb/ch9.h> |
| 55 | #include <linux/usb/gadget.h> |
| 56 | |
| 57 | #include "core.h" |
| 58 | #include "gadget.h" |
| 59 | #include "io.h" |
| 60 | |
| 61 | #include "debug.h" |
| 62 | |
Felipe Balbi | 6c167fc | 2011-10-07 22:55:04 +0300 | [diff] [blame] | 63 | static char *maximum_speed = "super"; |
| 64 | module_param(maximum_speed, charp, 0); |
| 65 | MODULE_PARM_DESC(maximum_speed, "Maximum supported speed."); |
| 66 | |
Felipe Balbi | 8300dd2 | 2011-10-18 13:54:01 +0300 | [diff] [blame] | 67 | /* -------------------------------------------------------------------------- */ |
| 68 | |
Sebastian Andrzej Siewior | 3140e8c | 2011-10-31 22:25:40 +0100 | [diff] [blame] | 69 | void dwc3_set_mode(struct dwc3 *dwc, u32 mode) |
| 70 | { |
| 71 | u32 reg; |
| 72 | |
| 73 | reg = dwc3_readl(dwc->regs, DWC3_GCTL); |
| 74 | reg &= ~(DWC3_GCTL_PRTCAPDIR(DWC3_GCTL_PRTCAP_OTG)); |
| 75 | reg |= DWC3_GCTL_PRTCAPDIR(mode); |
| 76 | dwc3_writel(dwc->regs, DWC3_GCTL, reg); |
| 77 | } |
Felipe Balbi | 8300dd2 | 2011-10-18 13:54:01 +0300 | [diff] [blame] | 78 | |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 79 | /** |
| 80 | * dwc3_core_soft_reset - Issues core soft reset and PHY reset |
| 81 | * @dwc: pointer to our context structure |
| 82 | */ |
| 83 | static void dwc3_core_soft_reset(struct dwc3 *dwc) |
| 84 | { |
| 85 | u32 reg; |
| 86 | |
| 87 | /* Before Resetting PHY, put Core in Reset */ |
| 88 | reg = dwc3_readl(dwc->regs, DWC3_GCTL); |
| 89 | reg |= DWC3_GCTL_CORESOFTRESET; |
| 90 | dwc3_writel(dwc->regs, DWC3_GCTL, reg); |
| 91 | |
| 92 | /* Assert USB3 PHY reset */ |
| 93 | reg = dwc3_readl(dwc->regs, DWC3_GUSB3PIPECTL(0)); |
| 94 | reg |= DWC3_GUSB3PIPECTL_PHYSOFTRST; |
| 95 | dwc3_writel(dwc->regs, DWC3_GUSB3PIPECTL(0), reg); |
| 96 | |
| 97 | /* Assert USB2 PHY reset */ |
| 98 | reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0)); |
| 99 | reg |= DWC3_GUSB2PHYCFG_PHYSOFTRST; |
| 100 | dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg); |
| 101 | |
Felipe Balbi | 51e1e7b | 2012-07-19 14:09:48 +0300 | [diff] [blame] | 102 | usb_phy_init(dwc->usb2_phy); |
| 103 | usb_phy_init(dwc->usb3_phy); |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 104 | mdelay(100); |
| 105 | |
| 106 | /* Clear USB3 PHY reset */ |
| 107 | reg = dwc3_readl(dwc->regs, DWC3_GUSB3PIPECTL(0)); |
| 108 | reg &= ~DWC3_GUSB3PIPECTL_PHYSOFTRST; |
| 109 | dwc3_writel(dwc->regs, DWC3_GUSB3PIPECTL(0), reg); |
| 110 | |
| 111 | /* Clear USB2 PHY reset */ |
| 112 | reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0)); |
| 113 | reg &= ~DWC3_GUSB2PHYCFG_PHYSOFTRST; |
| 114 | dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg); |
| 115 | |
Pratyush Anand | 45627ac | 2012-06-21 17:44:28 +0530 | [diff] [blame] | 116 | mdelay(100); |
| 117 | |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 118 | /* After PHYs are stable we can take Core out of reset state */ |
| 119 | reg = dwc3_readl(dwc->regs, DWC3_GCTL); |
| 120 | reg &= ~DWC3_GCTL_CORESOFTRESET; |
| 121 | dwc3_writel(dwc->regs, DWC3_GCTL, reg); |
| 122 | } |
| 123 | |
| 124 | /** |
| 125 | * dwc3_free_one_event_buffer - Frees one event buffer |
| 126 | * @dwc: Pointer to our controller context structure |
| 127 | * @evt: Pointer to event buffer to be freed |
| 128 | */ |
| 129 | static void dwc3_free_one_event_buffer(struct dwc3 *dwc, |
| 130 | struct dwc3_event_buffer *evt) |
| 131 | { |
| 132 | dma_free_coherent(dwc->dev, evt->length, evt->buf, evt->dma); |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 133 | } |
| 134 | |
| 135 | /** |
Paul Zimmerman | 1d04679 | 2012-02-15 18:56:56 -0800 | [diff] [blame] | 136 | * dwc3_alloc_one_event_buffer - Allocates one event buffer structure |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 137 | * @dwc: Pointer to our controller context structure |
| 138 | * @length: size of the event buffer |
| 139 | * |
Paul Zimmerman | 1d04679 | 2012-02-15 18:56:56 -0800 | [diff] [blame] | 140 | * Returns a pointer to the allocated event buffer structure on success |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 141 | * otherwise ERR_PTR(errno). |
| 142 | */ |
Bill Pemberton | 41ac7b3 | 2012-11-19 13:21:48 -0500 | [diff] [blame] | 143 | static struct dwc3_event_buffer *dwc3_alloc_one_event_buffer(struct dwc3 *dwc, unsigned length) |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 144 | { |
| 145 | struct dwc3_event_buffer *evt; |
| 146 | |
Felipe Balbi | 380f0d2 | 2012-10-11 13:48:36 +0300 | [diff] [blame] | 147 | evt = devm_kzalloc(dwc->dev, sizeof(*evt), GFP_KERNEL); |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 148 | if (!evt) |
| 149 | return ERR_PTR(-ENOMEM); |
| 150 | |
| 151 | evt->dwc = dwc; |
| 152 | evt->length = length; |
| 153 | evt->buf = dma_alloc_coherent(dwc->dev, length, |
| 154 | &evt->dma, GFP_KERNEL); |
Felipe Balbi | e32672f | 2012-11-08 15:26:41 +0200 | [diff] [blame] | 155 | if (!evt->buf) |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 156 | return ERR_PTR(-ENOMEM); |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 157 | |
| 158 | return evt; |
| 159 | } |
| 160 | |
| 161 | /** |
| 162 | * dwc3_free_event_buffers - frees all allocated event buffers |
| 163 | * @dwc: Pointer to our controller context structure |
| 164 | */ |
| 165 | static void dwc3_free_event_buffers(struct dwc3 *dwc) |
| 166 | { |
| 167 | struct dwc3_event_buffer *evt; |
| 168 | int i; |
| 169 | |
Felipe Balbi | 9f622b2 | 2011-10-12 10:31:04 +0300 | [diff] [blame] | 170 | for (i = 0; i < dwc->num_event_buffers; i++) { |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 171 | evt = dwc->ev_buffs[i]; |
Anton Tikhomirov | 64b6c8a | 2012-03-06 17:05:15 +0900 | [diff] [blame] | 172 | if (evt) |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 173 | dwc3_free_one_event_buffer(dwc, evt); |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 174 | } |
| 175 | } |
| 176 | |
| 177 | /** |
| 178 | * dwc3_alloc_event_buffers - Allocates @num event buffers of size @length |
Paul Zimmerman | 1d04679 | 2012-02-15 18:56:56 -0800 | [diff] [blame] | 179 | * @dwc: pointer to our controller context structure |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 180 | * @length: size of event buffer |
| 181 | * |
Paul Zimmerman | 1d04679 | 2012-02-15 18:56:56 -0800 | [diff] [blame] | 182 | * Returns 0 on success otherwise negative errno. In the error case, dwc |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 183 | * may contain some buffers allocated but not all which were requested. |
| 184 | */ |
Bill Pemberton | 41ac7b3 | 2012-11-19 13:21:48 -0500 | [diff] [blame] | 185 | static int dwc3_alloc_event_buffers(struct dwc3 *dwc, unsigned length) |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 186 | { |
Felipe Balbi | 9f622b2 | 2011-10-12 10:31:04 +0300 | [diff] [blame] | 187 | int num; |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 188 | int i; |
| 189 | |
Felipe Balbi | 9f622b2 | 2011-10-12 10:31:04 +0300 | [diff] [blame] | 190 | num = DWC3_NUM_INT(dwc->hwparams.hwparams1); |
| 191 | dwc->num_event_buffers = num; |
| 192 | |
Felipe Balbi | 380f0d2 | 2012-10-11 13:48:36 +0300 | [diff] [blame] | 193 | dwc->ev_buffs = devm_kzalloc(dwc->dev, sizeof(*dwc->ev_buffs) * num, |
| 194 | GFP_KERNEL); |
Felipe Balbi | 457d3f2 | 2011-10-24 12:03:13 +0300 | [diff] [blame] | 195 | if (!dwc->ev_buffs) { |
| 196 | dev_err(dwc->dev, "can't allocate event buffers array\n"); |
| 197 | return -ENOMEM; |
| 198 | } |
| 199 | |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 200 | for (i = 0; i < num; i++) { |
| 201 | struct dwc3_event_buffer *evt; |
| 202 | |
| 203 | evt = dwc3_alloc_one_event_buffer(dwc, length); |
| 204 | if (IS_ERR(evt)) { |
| 205 | dev_err(dwc->dev, "can't allocate event buffer\n"); |
| 206 | return PTR_ERR(evt); |
| 207 | } |
| 208 | dwc->ev_buffs[i] = evt; |
| 209 | } |
| 210 | |
| 211 | return 0; |
| 212 | } |
| 213 | |
| 214 | /** |
| 215 | * dwc3_event_buffers_setup - setup our allocated event buffers |
Paul Zimmerman | 1d04679 | 2012-02-15 18:56:56 -0800 | [diff] [blame] | 216 | * @dwc: pointer to our controller context structure |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 217 | * |
| 218 | * Returns 0 on success otherwise negative errno. |
| 219 | */ |
Paul Zimmerman | 7acd85e | 2012-04-27 14:28:02 +0300 | [diff] [blame] | 220 | static int dwc3_event_buffers_setup(struct dwc3 *dwc) |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 221 | { |
| 222 | struct dwc3_event_buffer *evt; |
| 223 | int n; |
| 224 | |
Felipe Balbi | 9f622b2 | 2011-10-12 10:31:04 +0300 | [diff] [blame] | 225 | for (n = 0; n < dwc->num_event_buffers; n++) { |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 226 | evt = dwc->ev_buffs[n]; |
| 227 | dev_dbg(dwc->dev, "Event buf %p dma %08llx length %d\n", |
| 228 | evt->buf, (unsigned long long) evt->dma, |
| 229 | evt->length); |
| 230 | |
Paul Zimmerman | 7acd85e | 2012-04-27 14:28:02 +0300 | [diff] [blame] | 231 | evt->lpos = 0; |
| 232 | |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 233 | dwc3_writel(dwc->regs, DWC3_GEVNTADRLO(n), |
| 234 | lower_32_bits(evt->dma)); |
| 235 | dwc3_writel(dwc->regs, DWC3_GEVNTADRHI(n), |
| 236 | upper_32_bits(evt->dma)); |
| 237 | dwc3_writel(dwc->regs, DWC3_GEVNTSIZ(n), |
| 238 | evt->length & 0xffff); |
| 239 | dwc3_writel(dwc->regs, DWC3_GEVNTCOUNT(n), 0); |
| 240 | } |
| 241 | |
| 242 | return 0; |
| 243 | } |
| 244 | |
| 245 | static void dwc3_event_buffers_cleanup(struct dwc3 *dwc) |
| 246 | { |
| 247 | struct dwc3_event_buffer *evt; |
| 248 | int n; |
| 249 | |
Felipe Balbi | 9f622b2 | 2011-10-12 10:31:04 +0300 | [diff] [blame] | 250 | for (n = 0; n < dwc->num_event_buffers; n++) { |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 251 | evt = dwc->ev_buffs[n]; |
Paul Zimmerman | 7acd85e | 2012-04-27 14:28:02 +0300 | [diff] [blame] | 252 | |
| 253 | evt->lpos = 0; |
| 254 | |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 255 | dwc3_writel(dwc->regs, DWC3_GEVNTADRLO(n), 0); |
| 256 | dwc3_writel(dwc->regs, DWC3_GEVNTADRHI(n), 0); |
| 257 | dwc3_writel(dwc->regs, DWC3_GEVNTSIZ(n), 0); |
| 258 | dwc3_writel(dwc->regs, DWC3_GEVNTCOUNT(n), 0); |
| 259 | } |
| 260 | } |
| 261 | |
Bill Pemberton | 41ac7b3 | 2012-11-19 13:21:48 -0500 | [diff] [blame] | 262 | static void dwc3_cache_hwparams(struct dwc3 *dwc) |
Felipe Balbi | 26ceca9 | 2011-09-30 10:58:49 +0300 | [diff] [blame] | 263 | { |
| 264 | struct dwc3_hwparams *parms = &dwc->hwparams; |
| 265 | |
| 266 | parms->hwparams0 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS0); |
| 267 | parms->hwparams1 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS1); |
| 268 | parms->hwparams2 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS2); |
| 269 | parms->hwparams3 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS3); |
| 270 | parms->hwparams4 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS4); |
| 271 | parms->hwparams5 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS5); |
| 272 | parms->hwparams6 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS6); |
| 273 | parms->hwparams7 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS7); |
| 274 | parms->hwparams8 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS8); |
| 275 | } |
| 276 | |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 277 | /** |
| 278 | * dwc3_core_init - Low-level initialization of DWC3 Core |
| 279 | * @dwc: Pointer to our controller context structure |
| 280 | * |
| 281 | * Returns 0 on success otherwise negative errno. |
| 282 | */ |
Bill Pemberton | 41ac7b3 | 2012-11-19 13:21:48 -0500 | [diff] [blame] | 283 | static int dwc3_core_init(struct dwc3 *dwc) |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 284 | { |
| 285 | unsigned long timeout; |
| 286 | u32 reg; |
| 287 | int ret; |
| 288 | |
Sebastian Andrzej Siewior | 7650bd7 | 2011-08-29 13:56:36 +0200 | [diff] [blame] | 289 | reg = dwc3_readl(dwc->regs, DWC3_GSNPSID); |
| 290 | /* This should read as U3 followed by revision number */ |
| 291 | if ((reg & DWC3_GSNPSID_MASK) != 0x55330000) { |
| 292 | dev_err(dwc->dev, "this is not a DesignWare USB3 DRD Core\n"); |
| 293 | ret = -ENODEV; |
| 294 | goto err0; |
| 295 | } |
Felipe Balbi | 248b122 | 2011-12-14 21:59:30 +0200 | [diff] [blame] | 296 | dwc->revision = reg; |
Sebastian Andrzej Siewior | 7650bd7 | 2011-08-29 13:56:36 +0200 | [diff] [blame] | 297 | |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 298 | /* issue device SoftReset too */ |
| 299 | timeout = jiffies + msecs_to_jiffies(500); |
| 300 | dwc3_writel(dwc->regs, DWC3_DCTL, DWC3_DCTL_CSFTRST); |
| 301 | do { |
| 302 | reg = dwc3_readl(dwc->regs, DWC3_DCTL); |
| 303 | if (!(reg & DWC3_DCTL_CSFTRST)) |
| 304 | break; |
| 305 | |
| 306 | if (time_after(jiffies, timeout)) { |
| 307 | dev_err(dwc->dev, "Reset Timed Out\n"); |
| 308 | ret = -ETIMEDOUT; |
| 309 | goto err0; |
| 310 | } |
| 311 | |
| 312 | cpu_relax(); |
| 313 | } while (true); |
| 314 | |
Pratyush Anand | 58a0f23 | 2012-06-21 17:44:29 +0530 | [diff] [blame] | 315 | dwc3_core_soft_reset(dwc); |
| 316 | |
Sebastian Andrzej Siewior | 4878a02 | 2011-10-31 22:25:41 +0100 | [diff] [blame] | 317 | reg = dwc3_readl(dwc->regs, DWC3_GCTL); |
Paul Zimmerman | 3e87c42 | 2012-02-24 17:32:13 -0800 | [diff] [blame] | 318 | reg &= ~DWC3_GCTL_SCALEDOWN_MASK; |
Sebastian Andrzej Siewior | 4878a02 | 2011-10-31 22:25:41 +0100 | [diff] [blame] | 319 | reg &= ~DWC3_GCTL_DISSCRAMBLE; |
| 320 | |
Sebastian Andrzej Siewior | 164d773 | 2011-11-24 11:22:05 +0100 | [diff] [blame] | 321 | switch (DWC3_GHWPARAMS1_EN_PWROPT(dwc->hwparams.hwparams1)) { |
Sebastian Andrzej Siewior | 4878a02 | 2011-10-31 22:25:41 +0100 | [diff] [blame] | 322 | case DWC3_GHWPARAMS1_EN_PWROPT_CLK: |
| 323 | reg &= ~DWC3_GCTL_DSBLCLKGTNG; |
| 324 | break; |
| 325 | default: |
| 326 | dev_dbg(dwc->dev, "No power optimization available\n"); |
| 327 | } |
| 328 | |
| 329 | /* |
| 330 | * WORKAROUND: DWC3 revisions <1.90a have a bug |
Paul Zimmerman | 1d04679 | 2012-02-15 18:56:56 -0800 | [diff] [blame] | 331 | * where the device can fail to connect at SuperSpeed |
Sebastian Andrzej Siewior | 4878a02 | 2011-10-31 22:25:41 +0100 | [diff] [blame] | 332 | * and falls back to high-speed mode which causes |
Paul Zimmerman | 1d04679 | 2012-02-15 18:56:56 -0800 | [diff] [blame] | 333 | * the device to enter a Connect/Disconnect loop |
Sebastian Andrzej Siewior | 4878a02 | 2011-10-31 22:25:41 +0100 | [diff] [blame] | 334 | */ |
| 335 | if (dwc->revision < DWC3_REVISION_190A) |
| 336 | reg |= DWC3_GCTL_U2RSTECN; |
| 337 | |
| 338 | dwc3_writel(dwc->regs, DWC3_GCTL, reg); |
| 339 | |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 340 | ret = dwc3_event_buffers_setup(dwc); |
| 341 | if (ret) { |
| 342 | dev_err(dwc->dev, "failed to setup event buffers\n"); |
Felipe Balbi | 3921426 | 2012-10-11 13:54:36 +0300 | [diff] [blame] | 343 | goto err0; |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 344 | } |
| 345 | |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 346 | return 0; |
| 347 | |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 348 | err0: |
| 349 | return ret; |
| 350 | } |
| 351 | |
| 352 | static void dwc3_core_exit(struct dwc3 *dwc) |
| 353 | { |
| 354 | dwc3_event_buffers_cleanup(dwc); |
Vivek Gautam | 01b8daf | 2012-10-13 19:20:18 +0530 | [diff] [blame] | 355 | |
| 356 | usb_phy_shutdown(dwc->usb2_phy); |
| 357 | usb_phy_shutdown(dwc->usb3_phy); |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 358 | } |
| 359 | |
| 360 | #define DWC3_ALIGN_MASK (16 - 1) |
| 361 | |
Bill Pemberton | 41ac7b3 | 2012-11-19 13:21:48 -0500 | [diff] [blame] | 362 | static int dwc3_probe(struct platform_device *pdev) |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 363 | { |
Felipe Balbi | 457e84b | 2012-01-18 18:04:09 +0200 | [diff] [blame] | 364 | struct device_node *node = pdev->dev.of_node; |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 365 | struct resource *res; |
| 366 | struct dwc3 *dwc; |
Chanho Park | 802ca85 | 2012-02-15 18:27:55 +0900 | [diff] [blame] | 367 | struct device *dev = &pdev->dev; |
Felipe Balbi | 0949e99 | 2011-10-12 10:44:56 +0300 | [diff] [blame] | 368 | |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 369 | int ret = -ENOMEM; |
Felipe Balbi | 0949e99 | 2011-10-12 10:44:56 +0300 | [diff] [blame] | 370 | |
| 371 | void __iomem *regs; |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 372 | void *mem; |
| 373 | |
Felipe Balbi | 0949e99 | 2011-10-12 10:44:56 +0300 | [diff] [blame] | 374 | u8 mode; |
| 375 | |
Chanho Park | 802ca85 | 2012-02-15 18:27:55 +0900 | [diff] [blame] | 376 | mem = devm_kzalloc(dev, sizeof(*dwc) + DWC3_ALIGN_MASK, GFP_KERNEL); |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 377 | if (!mem) { |
Chanho Park | 802ca85 | 2012-02-15 18:27:55 +0900 | [diff] [blame] | 378 | dev_err(dev, "not enough memory\n"); |
| 379 | return -ENOMEM; |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 380 | } |
| 381 | dwc = PTR_ALIGN(mem, DWC3_ALIGN_MASK + 1); |
| 382 | dwc->mem = mem; |
| 383 | |
Ido Shayevitz | 51249dc | 2012-04-24 14:18:39 +0300 | [diff] [blame] | 384 | res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 385 | if (!res) { |
Ido Shayevitz | 51249dc | 2012-04-24 14:18:39 +0300 | [diff] [blame] | 386 | dev_err(dev, "missing IRQ\n"); |
Chanho Park | 802ca85 | 2012-02-15 18:27:55 +0900 | [diff] [blame] | 387 | return -ENODEV; |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 388 | } |
Kishon Vijay Abraham I | 066618b | 2012-08-21 14:56:16 +0530 | [diff] [blame] | 389 | dwc->xhci_resources[1].start = res->start; |
| 390 | dwc->xhci_resources[1].end = res->end; |
| 391 | dwc->xhci_resources[1].flags = res->flags; |
| 392 | dwc->xhci_resources[1].name = res->name; |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 393 | |
Ido Shayevitz | 51249dc | 2012-04-24 14:18:39 +0300 | [diff] [blame] | 394 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 395 | if (!res) { |
| 396 | dev_err(dev, "missing memory resource\n"); |
| 397 | return -ENODEV; |
| 398 | } |
Kishon Vijay Abraham I | 066618b | 2012-08-21 14:56:16 +0530 | [diff] [blame] | 399 | dwc->xhci_resources[0].start = res->start; |
Ido Shayevitz | 51249dc | 2012-04-24 14:18:39 +0300 | [diff] [blame] | 400 | dwc->xhci_resources[0].end = dwc->xhci_resources[0].start + |
| 401 | DWC3_XHCI_REGS_END; |
Kishon Vijay Abraham I | 066618b | 2012-08-21 14:56:16 +0530 | [diff] [blame] | 402 | dwc->xhci_resources[0].flags = res->flags; |
| 403 | dwc->xhci_resources[0].name = res->name; |
Felipe Balbi | d07e881 | 2011-10-12 14:08:26 +0300 | [diff] [blame] | 404 | |
Ido Shayevitz | 51249dc | 2012-04-24 14:18:39 +0300 | [diff] [blame] | 405 | /* |
| 406 | * Request memory region but exclude xHCI regs, |
| 407 | * since it will be requested by the xhci-plat driver. |
| 408 | */ |
| 409 | res = devm_request_mem_region(dev, res->start + DWC3_GLOBALS_REGS_START, |
| 410 | resource_size(res) - DWC3_GLOBALS_REGS_START, |
Chanho Park | 802ca85 | 2012-02-15 18:27:55 +0900 | [diff] [blame] | 411 | dev_name(dev)); |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 412 | if (!res) { |
Chanho Park | 802ca85 | 2012-02-15 18:27:55 +0900 | [diff] [blame] | 413 | dev_err(dev, "can't request mem region\n"); |
| 414 | return -ENOMEM; |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 415 | } |
| 416 | |
Felipe Balbi | b7e38aa | 2012-08-10 09:16:43 +0300 | [diff] [blame] | 417 | regs = devm_ioremap_nocache(dev, res->start, resource_size(res)); |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 418 | if (!regs) { |
Chanho Park | 802ca85 | 2012-02-15 18:27:55 +0900 | [diff] [blame] | 419 | dev_err(dev, "ioremap failed\n"); |
| 420 | return -ENOMEM; |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 421 | } |
| 422 | |
Felipe Balbi | 51e1e7b | 2012-07-19 14:09:48 +0300 | [diff] [blame] | 423 | dwc->usb2_phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2); |
| 424 | if (IS_ERR_OR_NULL(dwc->usb2_phy)) { |
| 425 | dev_err(dev, "no usb2 phy configured\n"); |
| 426 | return -EPROBE_DEFER; |
| 427 | } |
| 428 | |
| 429 | dwc->usb3_phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB3); |
| 430 | if (IS_ERR_OR_NULL(dwc->usb3_phy)) { |
| 431 | dev_err(dev, "no usb3 phy configured\n"); |
| 432 | return -EPROBE_DEFER; |
| 433 | } |
| 434 | |
Kishon Vijay Abraham I | 8ba007a | 2013-01-25 08:30:54 +0530 | [diff] [blame^] | 435 | usb_phy_set_suspend(dwc->usb2_phy, 0); |
| 436 | usb_phy_set_suspend(dwc->usb3_phy, 0); |
| 437 | |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 438 | spin_lock_init(&dwc->lock); |
| 439 | platform_set_drvdata(pdev, dwc); |
| 440 | |
| 441 | dwc->regs = regs; |
| 442 | dwc->regs_size = resource_size(res); |
Chanho Park | 802ca85 | 2012-02-15 18:27:55 +0900 | [diff] [blame] | 443 | dwc->dev = dev; |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 444 | |
Felipe Balbi | 6c167fc | 2011-10-07 22:55:04 +0300 | [diff] [blame] | 445 | if (!strncmp("super", maximum_speed, 5)) |
| 446 | dwc->maximum_speed = DWC3_DCFG_SUPERSPEED; |
| 447 | else if (!strncmp("high", maximum_speed, 4)) |
| 448 | dwc->maximum_speed = DWC3_DCFG_HIGHSPEED; |
| 449 | else if (!strncmp("full", maximum_speed, 4)) |
| 450 | dwc->maximum_speed = DWC3_DCFG_FULLSPEED1; |
| 451 | else if (!strncmp("low", maximum_speed, 3)) |
| 452 | dwc->maximum_speed = DWC3_DCFG_LOWSPEED; |
| 453 | else |
| 454 | dwc->maximum_speed = DWC3_DCFG_SUPERSPEED; |
| 455 | |
Felipe Balbi | 457e84b | 2012-01-18 18:04:09 +0200 | [diff] [blame] | 456 | if (of_get_property(node, "tx-fifo-resize", NULL)) |
| 457 | dwc->needs_fifo_resize = true; |
| 458 | |
Chanho Park | 802ca85 | 2012-02-15 18:27:55 +0900 | [diff] [blame] | 459 | pm_runtime_enable(dev); |
| 460 | pm_runtime_get_sync(dev); |
| 461 | pm_runtime_forbid(dev); |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 462 | |
Kishon Vijay Abraham I | 4fd2448 | 2012-11-16 12:07:54 +0530 | [diff] [blame] | 463 | dwc3_cache_hwparams(dwc); |
| 464 | |
Felipe Balbi | 3921426 | 2012-10-11 13:54:36 +0300 | [diff] [blame] | 465 | ret = dwc3_alloc_event_buffers(dwc, DWC3_EVENT_BUFFERS_SIZE); |
| 466 | if (ret) { |
| 467 | dev_err(dwc->dev, "failed to allocate event buffers\n"); |
| 468 | ret = -ENOMEM; |
| 469 | goto err0; |
| 470 | } |
| 471 | |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 472 | ret = dwc3_core_init(dwc); |
| 473 | if (ret) { |
Chanho Park | 802ca85 | 2012-02-15 18:27:55 +0900 | [diff] [blame] | 474 | dev_err(dev, "failed to initialize core\n"); |
Felipe Balbi | 3921426 | 2012-10-11 13:54:36 +0300 | [diff] [blame] | 475 | goto err0; |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 476 | } |
| 477 | |
Felipe Balbi | 0949e99 | 2011-10-12 10:44:56 +0300 | [diff] [blame] | 478 | mode = DWC3_MODE(dwc->hwparams.hwparams0); |
| 479 | |
| 480 | switch (mode) { |
Felipe Balbi | 0949e99 | 2011-10-12 10:44:56 +0300 | [diff] [blame] | 481 | case DWC3_MODE_DEVICE: |
Sebastian Andrzej Siewior | 3140e8c | 2011-10-31 22:25:40 +0100 | [diff] [blame] | 482 | dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_DEVICE); |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 483 | ret = dwc3_gadget_init(dwc); |
| 484 | if (ret) { |
Chanho Park | 802ca85 | 2012-02-15 18:27:55 +0900 | [diff] [blame] | 485 | dev_err(dev, "failed to initialize gadget\n"); |
| 486 | goto err1; |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 487 | } |
Felipe Balbi | 0949e99 | 2011-10-12 10:44:56 +0300 | [diff] [blame] | 488 | break; |
Felipe Balbi | d07e881 | 2011-10-12 14:08:26 +0300 | [diff] [blame] | 489 | case DWC3_MODE_HOST: |
Sebastian Andrzej Siewior | 3140e8c | 2011-10-31 22:25:40 +0100 | [diff] [blame] | 490 | dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_HOST); |
Felipe Balbi | d07e881 | 2011-10-12 14:08:26 +0300 | [diff] [blame] | 491 | ret = dwc3_host_init(dwc); |
| 492 | if (ret) { |
Chanho Park | 802ca85 | 2012-02-15 18:27:55 +0900 | [diff] [blame] | 493 | dev_err(dev, "failed to initialize host\n"); |
| 494 | goto err1; |
Felipe Balbi | d07e881 | 2011-10-12 14:08:26 +0300 | [diff] [blame] | 495 | } |
| 496 | break; |
| 497 | case DWC3_MODE_DRD: |
Sebastian Andrzej Siewior | 3140e8c | 2011-10-31 22:25:40 +0100 | [diff] [blame] | 498 | dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_OTG); |
Felipe Balbi | d07e881 | 2011-10-12 14:08:26 +0300 | [diff] [blame] | 499 | ret = dwc3_host_init(dwc); |
| 500 | if (ret) { |
Chanho Park | 802ca85 | 2012-02-15 18:27:55 +0900 | [diff] [blame] | 501 | dev_err(dev, "failed to initialize host\n"); |
| 502 | goto err1; |
Felipe Balbi | d07e881 | 2011-10-12 14:08:26 +0300 | [diff] [blame] | 503 | } |
| 504 | |
| 505 | ret = dwc3_gadget_init(dwc); |
| 506 | if (ret) { |
Chanho Park | 802ca85 | 2012-02-15 18:27:55 +0900 | [diff] [blame] | 507 | dev_err(dev, "failed to initialize gadget\n"); |
| 508 | goto err1; |
Felipe Balbi | d07e881 | 2011-10-12 14:08:26 +0300 | [diff] [blame] | 509 | } |
| 510 | break; |
Felipe Balbi | 0949e99 | 2011-10-12 10:44:56 +0300 | [diff] [blame] | 511 | default: |
Chanho Park | 802ca85 | 2012-02-15 18:27:55 +0900 | [diff] [blame] | 512 | dev_err(dev, "Unsupported mode of operation %d\n", mode); |
| 513 | goto err1; |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 514 | } |
Felipe Balbi | 0949e99 | 2011-10-12 10:44:56 +0300 | [diff] [blame] | 515 | dwc->mode = mode; |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 516 | |
| 517 | ret = dwc3_debugfs_init(dwc); |
| 518 | if (ret) { |
Chanho Park | 802ca85 | 2012-02-15 18:27:55 +0900 | [diff] [blame] | 519 | dev_err(dev, "failed to initialize debugfs\n"); |
| 520 | goto err2; |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 521 | } |
| 522 | |
Chanho Park | 802ca85 | 2012-02-15 18:27:55 +0900 | [diff] [blame] | 523 | pm_runtime_allow(dev); |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 524 | |
| 525 | return 0; |
| 526 | |
Chanho Park | 802ca85 | 2012-02-15 18:27:55 +0900 | [diff] [blame] | 527 | err2: |
Felipe Balbi | 0949e99 | 2011-10-12 10:44:56 +0300 | [diff] [blame] | 528 | switch (mode) { |
Felipe Balbi | 0949e99 | 2011-10-12 10:44:56 +0300 | [diff] [blame] | 529 | case DWC3_MODE_DEVICE: |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 530 | dwc3_gadget_exit(dwc); |
Felipe Balbi | 0949e99 | 2011-10-12 10:44:56 +0300 | [diff] [blame] | 531 | break; |
Felipe Balbi | d07e881 | 2011-10-12 14:08:26 +0300 | [diff] [blame] | 532 | case DWC3_MODE_HOST: |
| 533 | dwc3_host_exit(dwc); |
| 534 | break; |
| 535 | case DWC3_MODE_DRD: |
| 536 | dwc3_host_exit(dwc); |
| 537 | dwc3_gadget_exit(dwc); |
| 538 | break; |
Felipe Balbi | 0949e99 | 2011-10-12 10:44:56 +0300 | [diff] [blame] | 539 | default: |
| 540 | /* do nothing */ |
| 541 | break; |
| 542 | } |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 543 | |
Chanho Park | 802ca85 | 2012-02-15 18:27:55 +0900 | [diff] [blame] | 544 | err1: |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 545 | dwc3_core_exit(dwc); |
| 546 | |
Felipe Balbi | 3921426 | 2012-10-11 13:54:36 +0300 | [diff] [blame] | 547 | err0: |
| 548 | dwc3_free_event_buffers(dwc); |
| 549 | |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 550 | return ret; |
| 551 | } |
| 552 | |
Bill Pemberton | fb4e98a | 2012-11-19 13:26:20 -0500 | [diff] [blame] | 553 | static int dwc3_remove(struct platform_device *pdev) |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 554 | { |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 555 | struct dwc3 *dwc = platform_get_drvdata(pdev); |
| 556 | struct resource *res; |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 557 | |
| 558 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 559 | |
Kishon Vijay Abraham I | 8ba007a | 2013-01-25 08:30:54 +0530 | [diff] [blame^] | 560 | usb_phy_set_suspend(dwc->usb2_phy, 1); |
| 561 | usb_phy_set_suspend(dwc->usb3_phy, 1); |
| 562 | |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 563 | pm_runtime_put(&pdev->dev); |
| 564 | pm_runtime_disable(&pdev->dev); |
| 565 | |
| 566 | dwc3_debugfs_exit(dwc); |
| 567 | |
Felipe Balbi | 0949e99 | 2011-10-12 10:44:56 +0300 | [diff] [blame] | 568 | switch (dwc->mode) { |
Felipe Balbi | 0949e99 | 2011-10-12 10:44:56 +0300 | [diff] [blame] | 569 | case DWC3_MODE_DEVICE: |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 570 | dwc3_gadget_exit(dwc); |
Felipe Balbi | 0949e99 | 2011-10-12 10:44:56 +0300 | [diff] [blame] | 571 | break; |
Felipe Balbi | d07e881 | 2011-10-12 14:08:26 +0300 | [diff] [blame] | 572 | case DWC3_MODE_HOST: |
| 573 | dwc3_host_exit(dwc); |
| 574 | break; |
| 575 | case DWC3_MODE_DRD: |
| 576 | dwc3_host_exit(dwc); |
| 577 | dwc3_gadget_exit(dwc); |
| 578 | break; |
Felipe Balbi | 0949e99 | 2011-10-12 10:44:56 +0300 | [diff] [blame] | 579 | default: |
| 580 | /* do nothing */ |
| 581 | break; |
| 582 | } |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 583 | |
| 584 | dwc3_core_exit(dwc); |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 585 | |
| 586 | return 0; |
| 587 | } |
| 588 | |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 589 | static struct platform_driver dwc3_driver = { |
| 590 | .probe = dwc3_probe, |
Bill Pemberton | 7690417 | 2012-11-19 13:21:08 -0500 | [diff] [blame] | 591 | .remove = dwc3_remove, |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 592 | .driver = { |
| 593 | .name = "dwc3", |
| 594 | }, |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 595 | }; |
| 596 | |
Tobias Klauser | b1116dc | 2012-02-28 12:57:20 +0100 | [diff] [blame] | 597 | module_platform_driver(dwc3_driver); |
| 598 | |
Sebastian Andrzej Siewior | 7ae4fc4 | 2011-10-19 19:39:50 +0200 | [diff] [blame] | 599 | MODULE_ALIAS("platform:dwc3"); |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 600 | MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>"); |
| 601 | MODULE_LICENSE("Dual BSD/GPL"); |
| 602 | MODULE_DESCRIPTION("DesignWare USB3 DRD Controller Driver"); |