Pawel Laszczak | 7733f6c | 2019-08-26 12:19:30 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | /* |
| 3 | * Cadence USBSS DRD Driver. |
| 4 | * |
| 5 | * Copyright (C) 2018-2019 Cadence. |
| 6 | * Copyright (C) 2019 Texas Instruments |
| 7 | * |
| 8 | * Author: Pawel Laszczak <pawell@cadence.com> |
| 9 | * Roger Quadros <rogerq@ti.com> |
| 10 | * |
| 11 | * |
| 12 | */ |
| 13 | #include <linux/kernel.h> |
| 14 | #include <linux/interrupt.h> |
| 15 | #include <linux/delay.h> |
| 16 | #include <linux/iopoll.h> |
| 17 | #include <linux/usb/otg.h> |
| 18 | |
| 19 | #include "gadget.h" |
| 20 | #include "drd.h" |
| 21 | #include "core.h" |
| 22 | |
| 23 | /** |
| 24 | * cdns3_set_mode - change mode of OTG Core |
| 25 | * @cdns: pointer to context structure |
| 26 | * @mode: selected mode from cdns_role |
| 27 | * |
| 28 | * Returns 0 on success otherwise negative errno |
| 29 | */ |
| 30 | int cdns3_set_mode(struct cdns3 *cdns, enum usb_dr_mode mode) |
| 31 | { |
Pawel Laszczak | 7733f6c | 2019-08-26 12:19:30 +0100 | [diff] [blame] | 32 | u32 reg; |
| 33 | |
| 34 | switch (mode) { |
| 35 | case USB_DR_MODE_PERIPHERAL: |
| 36 | break; |
| 37 | case USB_DR_MODE_HOST: |
| 38 | break; |
| 39 | case USB_DR_MODE_OTG: |
| 40 | dev_dbg(cdns->dev, "Set controller to OTG mode\n"); |
| 41 | if (cdns->version == CDNS3_CONTROLLER_V1) { |
| 42 | reg = readl(&cdns->otg_v1_regs->override); |
| 43 | reg |= OVERRIDE_IDPULLUP; |
| 44 | writel(reg, &cdns->otg_v1_regs->override); |
Pawel Laszczak | 2eae2df | 2020-09-15 14:45:43 +0300 | [diff] [blame] | 45 | |
| 46 | /* |
| 47 | * Enable work around feature built into the |
| 48 | * controller to address issue with RX Sensitivity |
| 49 | * est (EL_17) for USB2 PHY. The issue only occures |
| 50 | * for 0x0002450D controller version. |
| 51 | */ |
| 52 | if (cdns->phyrst_a_enable) { |
| 53 | reg = readl(&cdns->otg_v1_regs->phyrst_cfg); |
| 54 | reg |= PHYRST_CFG_PHYRST_A_ENABLE; |
| 55 | writel(reg, &cdns->otg_v1_regs->phyrst_cfg); |
| 56 | } |
Pawel Laszczak | 7733f6c | 2019-08-26 12:19:30 +0100 | [diff] [blame] | 57 | } else { |
| 58 | reg = readl(&cdns->otg_v0_regs->ctrl1); |
| 59 | reg |= OVERRIDE_IDPULLUP_V0; |
| 60 | writel(reg, &cdns->otg_v0_regs->ctrl1); |
| 61 | } |
| 62 | |
| 63 | /* |
| 64 | * Hardware specification says: "ID_VALUE must be valid within |
| 65 | * 50ms after idpullup is set to '1" so driver must wait |
| 66 | * 50ms before reading this pin. |
| 67 | */ |
| 68 | usleep_range(50000, 60000); |
| 69 | break; |
| 70 | default: |
| 71 | dev_err(cdns->dev, "Unsupported mode of operation %d\n", mode); |
| 72 | return -EINVAL; |
| 73 | } |
| 74 | |
Pawel Laszczak | 27afe16 | 2020-07-13 12:05:47 +0200 | [diff] [blame] | 75 | return 0; |
Pawel Laszczak | 7733f6c | 2019-08-26 12:19:30 +0100 | [diff] [blame] | 76 | } |
| 77 | |
| 78 | int cdns3_get_id(struct cdns3 *cdns) |
| 79 | { |
| 80 | int id; |
| 81 | |
| 82 | id = readl(&cdns->otg_regs->sts) & OTGSTS_ID_VALUE; |
| 83 | dev_dbg(cdns->dev, "OTG ID: %d", id); |
| 84 | |
| 85 | return id; |
| 86 | } |
| 87 | |
| 88 | int cdns3_get_vbus(struct cdns3 *cdns) |
| 89 | { |
| 90 | int vbus; |
| 91 | |
| 92 | vbus = !!(readl(&cdns->otg_regs->sts) & OTGSTS_VBUS_VALID); |
| 93 | dev_dbg(cdns->dev, "OTG VBUS: %d", vbus); |
| 94 | |
| 95 | return vbus; |
| 96 | } |
| 97 | |
Pawel Laszczak | 2452584 | 2020-07-13 12:05:50 +0200 | [diff] [blame] | 98 | bool cdns3_is_host(struct cdns3 *cdns) |
Pawel Laszczak | 7733f6c | 2019-08-26 12:19:30 +0100 | [diff] [blame] | 99 | { |
| 100 | if (cdns->dr_mode == USB_DR_MODE_HOST) |
Pawel Laszczak | 2452584 | 2020-07-13 12:05:50 +0200 | [diff] [blame] | 101 | return true; |
Pawel Laszczak | 08c35dd | 2020-07-13 12:05:51 +0200 | [diff] [blame] | 102 | else if (cdns3_get_id(cdns) == CDNS3_ID_HOST) |
Pawel Laszczak | 2452584 | 2020-07-13 12:05:50 +0200 | [diff] [blame] | 103 | return true; |
Pawel Laszczak | 7733f6c | 2019-08-26 12:19:30 +0100 | [diff] [blame] | 104 | |
Pawel Laszczak | 2452584 | 2020-07-13 12:05:50 +0200 | [diff] [blame] | 105 | return false; |
Pawel Laszczak | 7733f6c | 2019-08-26 12:19:30 +0100 | [diff] [blame] | 106 | } |
| 107 | |
Pawel Laszczak | 2452584 | 2020-07-13 12:05:50 +0200 | [diff] [blame] | 108 | bool cdns3_is_device(struct cdns3 *cdns) |
Pawel Laszczak | 7733f6c | 2019-08-26 12:19:30 +0100 | [diff] [blame] | 109 | { |
| 110 | if (cdns->dr_mode == USB_DR_MODE_PERIPHERAL) |
Pawel Laszczak | 2452584 | 2020-07-13 12:05:50 +0200 | [diff] [blame] | 111 | return true; |
Pawel Laszczak | 7733f6c | 2019-08-26 12:19:30 +0100 | [diff] [blame] | 112 | else if (cdns->dr_mode == USB_DR_MODE_OTG) |
Pawel Laszczak | 08c35dd | 2020-07-13 12:05:51 +0200 | [diff] [blame] | 113 | if (cdns3_get_id(cdns) == CDNS3_ID_PERIPHERAL) |
Pawel Laszczak | 2452584 | 2020-07-13 12:05:50 +0200 | [diff] [blame] | 114 | return true; |
Pawel Laszczak | 7733f6c | 2019-08-26 12:19:30 +0100 | [diff] [blame] | 115 | |
Pawel Laszczak | 2452584 | 2020-07-13 12:05:50 +0200 | [diff] [blame] | 116 | return false; |
Pawel Laszczak | 7733f6c | 2019-08-26 12:19:30 +0100 | [diff] [blame] | 117 | } |
| 118 | |
| 119 | /** |
| 120 | * cdns3_otg_disable_irq - Disable all OTG interrupts |
| 121 | * @cdns: Pointer to controller context structure |
| 122 | */ |
| 123 | static void cdns3_otg_disable_irq(struct cdns3 *cdns) |
| 124 | { |
| 125 | writel(0, &cdns->otg_regs->ien); |
| 126 | } |
| 127 | |
| 128 | /** |
| 129 | * cdns3_otg_enable_irq - enable id and sess_valid interrupts |
| 130 | * @cdns: Pointer to controller context structure |
| 131 | */ |
| 132 | static void cdns3_otg_enable_irq(struct cdns3 *cdns) |
| 133 | { |
| 134 | writel(OTGIEN_ID_CHANGE_INT | OTGIEN_VBUSVALID_RISE_INT | |
| 135 | OTGIEN_VBUSVALID_FALL_INT, &cdns->otg_regs->ien); |
| 136 | } |
| 137 | |
| 138 | /** |
Pawel Laszczak | b2aeb6d | 2020-07-13 12:05:54 +0200 | [diff] [blame] | 139 | * cdns3_drd_host_on - start host. |
| 140 | * @cdns: Pointer to controller context structure. |
| 141 | * |
| 142 | * Returns 0 on success otherwise negative errno. |
| 143 | */ |
| 144 | int cdns3_drd_host_on(struct cdns3 *cdns) |
| 145 | { |
| 146 | u32 val; |
| 147 | int ret; |
| 148 | |
| 149 | /* Enable host mode. */ |
| 150 | writel(OTGCMD_HOST_BUS_REQ | OTGCMD_OTG_DIS, |
| 151 | &cdns->otg_regs->cmd); |
| 152 | |
| 153 | dev_dbg(cdns->dev, "Waiting till Host mode is turned on\n"); |
| 154 | ret = readl_poll_timeout_atomic(&cdns->otg_regs->sts, val, |
| 155 | val & OTGSTS_XHCI_READY, 1, 100000); |
| 156 | |
| 157 | if (ret) |
| 158 | dev_err(cdns->dev, "timeout waiting for xhci_ready\n"); |
| 159 | |
| 160 | return ret; |
| 161 | } |
| 162 | |
| 163 | /** |
| 164 | * cdns3_drd_host_off - stop host. |
| 165 | * @cdns: Pointer to controller context structure. |
| 166 | */ |
| 167 | void cdns3_drd_host_off(struct cdns3 *cdns) |
| 168 | { |
| 169 | u32 val; |
| 170 | |
| 171 | writel(OTGCMD_HOST_BUS_DROP | OTGCMD_DEV_BUS_DROP | |
| 172 | OTGCMD_DEV_POWER_OFF | OTGCMD_HOST_POWER_OFF, |
| 173 | &cdns->otg_regs->cmd); |
| 174 | |
| 175 | /* Waiting till H_IDLE state.*/ |
| 176 | readl_poll_timeout_atomic(&cdns->otg_regs->state, val, |
| 177 | !(val & OTGSTATE_HOST_STATE_MASK), |
| 178 | 1, 2000000); |
| 179 | } |
| 180 | |
| 181 | /** |
| 182 | * cdns3_drd_gadget_on - start gadget. |
| 183 | * @cdns: Pointer to controller context structure. |
Pawel Laszczak | 7733f6c | 2019-08-26 12:19:30 +0100 | [diff] [blame] | 184 | * |
| 185 | * Returns 0 on success otherwise negative errno |
| 186 | */ |
Pawel Laszczak | b2aeb6d | 2020-07-13 12:05:54 +0200 | [diff] [blame] | 187 | int cdns3_drd_gadget_on(struct cdns3 *cdns) |
Pawel Laszczak | 7733f6c | 2019-08-26 12:19:30 +0100 | [diff] [blame] | 188 | { |
| 189 | int ret, val; |
Pawel Laszczak | b2aeb6d | 2020-07-13 12:05:54 +0200 | [diff] [blame] | 190 | u32 reg = OTGCMD_OTG_DIS; |
Pawel Laszczak | 7733f6c | 2019-08-26 12:19:30 +0100 | [diff] [blame] | 191 | |
| 192 | /* switch OTG core */ |
Pawel Laszczak | b2aeb6d | 2020-07-13 12:05:54 +0200 | [diff] [blame] | 193 | writel(OTGCMD_DEV_BUS_REQ | reg, &cdns->otg_regs->cmd); |
Pawel Laszczak | 7733f6c | 2019-08-26 12:19:30 +0100 | [diff] [blame] | 194 | |
Pawel Laszczak | b2aeb6d | 2020-07-13 12:05:54 +0200 | [diff] [blame] | 195 | dev_dbg(cdns->dev, "Waiting till Device mode is turned on\n"); |
| 196 | |
| 197 | ret = readl_poll_timeout_atomic(&cdns->otg_regs->sts, val, |
| 198 | val & OTGSTS_DEV_READY, |
| 199 | 1, 100000); |
| 200 | if (ret) { |
| 201 | dev_err(cdns->dev, "timeout waiting for dev_ready\n"); |
| 202 | return ret; |
Pawel Laszczak | 7733f6c | 2019-08-26 12:19:30 +0100 | [diff] [blame] | 203 | } |
| 204 | |
| 205 | return 0; |
| 206 | } |
| 207 | |
| 208 | /** |
Pawel Laszczak | b2aeb6d | 2020-07-13 12:05:54 +0200 | [diff] [blame] | 209 | * cdns3_drd_gadget_off - stop gadget. |
| 210 | * @cdns: Pointer to controller context structure. |
Pawel Laszczak | 7733f6c | 2019-08-26 12:19:30 +0100 | [diff] [blame] | 211 | */ |
Pawel Laszczak | b2aeb6d | 2020-07-13 12:05:54 +0200 | [diff] [blame] | 212 | void cdns3_drd_gadget_off(struct cdns3 *cdns) |
Pawel Laszczak | 7733f6c | 2019-08-26 12:19:30 +0100 | [diff] [blame] | 213 | { |
Pawel Laszczak | b2aeb6d | 2020-07-13 12:05:54 +0200 | [diff] [blame] | 214 | u32 val; |
Pawel Laszczak | 7733f6c | 2019-08-26 12:19:30 +0100 | [diff] [blame] | 215 | |
Pawel Laszczak | b2aeb6d | 2020-07-13 12:05:54 +0200 | [diff] [blame] | 216 | /* |
| 217 | * Driver should wait at least 10us after disabling Device |
| 218 | * before turning-off Device (DEV_BUS_DROP). |
| 219 | */ |
| 220 | usleep_range(20, 30); |
| 221 | writel(OTGCMD_HOST_BUS_DROP | OTGCMD_DEV_BUS_DROP | |
| 222 | OTGCMD_DEV_POWER_OFF | OTGCMD_HOST_POWER_OFF, |
| 223 | &cdns->otg_regs->cmd); |
| 224 | /* Waiting till DEV_IDLE state.*/ |
| 225 | readl_poll_timeout_atomic(&cdns->otg_regs->state, val, |
| 226 | !(val & OTGSTATE_DEV_STATE_MASK), |
| 227 | 1, 2000000); |
Pawel Laszczak | 7733f6c | 2019-08-26 12:19:30 +0100 | [diff] [blame] | 228 | } |
| 229 | |
| 230 | /** |
| 231 | * cdns3_init_otg_mode - initialize drd controller |
| 232 | * @cdns: Pointer to controller context structure |
| 233 | * |
| 234 | * Returns 0 on success otherwise negative errno |
| 235 | */ |
| 236 | static int cdns3_init_otg_mode(struct cdns3 *cdns) |
| 237 | { |
Pawel Laszczak | 27afe16 | 2020-07-13 12:05:47 +0200 | [diff] [blame] | 238 | int ret; |
Pawel Laszczak | 7733f6c | 2019-08-26 12:19:30 +0100 | [diff] [blame] | 239 | |
| 240 | cdns3_otg_disable_irq(cdns); |
| 241 | /* clear all interrupts */ |
| 242 | writel(~0, &cdns->otg_regs->ivect); |
| 243 | |
| 244 | ret = cdns3_set_mode(cdns, USB_DR_MODE_OTG); |
| 245 | if (ret) |
| 246 | return ret; |
| 247 | |
| 248 | cdns3_otg_enable_irq(cdns); |
Pawel Laszczak | 27afe16 | 2020-07-13 12:05:47 +0200 | [diff] [blame] | 249 | |
| 250 | return 0; |
Pawel Laszczak | 7733f6c | 2019-08-26 12:19:30 +0100 | [diff] [blame] | 251 | } |
| 252 | |
| 253 | /** |
| 254 | * cdns3_drd_update_mode - initialize mode of operation |
| 255 | * @cdns: Pointer to controller context structure |
| 256 | * |
| 257 | * Returns 0 on success otherwise negative errno |
| 258 | */ |
| 259 | int cdns3_drd_update_mode(struct cdns3 *cdns) |
| 260 | { |
Pawel Laszczak | 27afe16 | 2020-07-13 12:05:47 +0200 | [diff] [blame] | 261 | int ret; |
Pawel Laszczak | 7733f6c | 2019-08-26 12:19:30 +0100 | [diff] [blame] | 262 | |
| 263 | switch (cdns->dr_mode) { |
| 264 | case USB_DR_MODE_PERIPHERAL: |
| 265 | ret = cdns3_set_mode(cdns, USB_DR_MODE_PERIPHERAL); |
| 266 | break; |
| 267 | case USB_DR_MODE_HOST: |
| 268 | ret = cdns3_set_mode(cdns, USB_DR_MODE_HOST); |
| 269 | break; |
| 270 | case USB_DR_MODE_OTG: |
| 271 | ret = cdns3_init_otg_mode(cdns); |
| 272 | break; |
| 273 | default: |
| 274 | dev_err(cdns->dev, "Unsupported mode of operation %d\n", |
| 275 | cdns->dr_mode); |
| 276 | return -EINVAL; |
| 277 | } |
| 278 | |
| 279 | return ret; |
| 280 | } |
| 281 | |
| 282 | static irqreturn_t cdns3_drd_thread_irq(int irq, void *data) |
| 283 | { |
| 284 | struct cdns3 *cdns = data; |
| 285 | |
| 286 | cdns3_hw_role_switch(cdns); |
| 287 | |
| 288 | return IRQ_HANDLED; |
| 289 | } |
| 290 | |
| 291 | /** |
| 292 | * cdns3_drd_irq - interrupt handler for OTG events |
| 293 | * |
| 294 | * @irq: irq number for cdns3 core device |
| 295 | * @data: structure of cdns3 |
| 296 | * |
| 297 | * Returns IRQ_HANDLED or IRQ_NONE |
| 298 | */ |
| 299 | static irqreturn_t cdns3_drd_irq(int irq, void *data) |
| 300 | { |
| 301 | irqreturn_t ret = IRQ_NONE; |
| 302 | struct cdns3 *cdns = data; |
| 303 | u32 reg; |
| 304 | |
| 305 | if (cdns->dr_mode != USB_DR_MODE_OTG) |
Pawel Laszczak | 03cce68 | 2020-07-13 12:05:49 +0200 | [diff] [blame] | 306 | return IRQ_NONE; |
Pawel Laszczak | 7733f6c | 2019-08-26 12:19:30 +0100 | [diff] [blame] | 307 | |
Peter Chen | b1234e3 | 2020-09-02 17:57:32 +0800 | [diff] [blame] | 308 | if (cdns->in_lpm) |
| 309 | return ret; |
| 310 | |
Pawel Laszczak | 7733f6c | 2019-08-26 12:19:30 +0100 | [diff] [blame] | 311 | reg = readl(&cdns->otg_regs->ivect); |
| 312 | |
| 313 | if (!reg) |
Pawel Laszczak | 03cce68 | 2020-07-13 12:05:49 +0200 | [diff] [blame] | 314 | return IRQ_NONE; |
Pawel Laszczak | 7733f6c | 2019-08-26 12:19:30 +0100 | [diff] [blame] | 315 | |
| 316 | if (reg & OTGIEN_ID_CHANGE_INT) { |
| 317 | dev_dbg(cdns->dev, "OTG IRQ: new ID: %d\n", |
| 318 | cdns3_get_id(cdns)); |
| 319 | |
| 320 | ret = IRQ_WAKE_THREAD; |
| 321 | } |
| 322 | |
| 323 | if (reg & (OTGIEN_VBUSVALID_RISE_INT | OTGIEN_VBUSVALID_FALL_INT)) { |
| 324 | dev_dbg(cdns->dev, "OTG IRQ: new VBUS: %d\n", |
| 325 | cdns3_get_vbus(cdns)); |
| 326 | |
| 327 | ret = IRQ_WAKE_THREAD; |
| 328 | } |
| 329 | |
| 330 | writel(~0, &cdns->otg_regs->ivect); |
| 331 | return ret; |
| 332 | } |
| 333 | |
| 334 | int cdns3_drd_init(struct cdns3 *cdns) |
| 335 | { |
| 336 | void __iomem *regs; |
Pawel Laszczak | 7733f6c | 2019-08-26 12:19:30 +0100 | [diff] [blame] | 337 | u32 state; |
Pawel Laszczak | 27afe16 | 2020-07-13 12:05:47 +0200 | [diff] [blame] | 338 | int ret; |
Pawel Laszczak | 7733f6c | 2019-08-26 12:19:30 +0100 | [diff] [blame] | 339 | |
| 340 | regs = devm_ioremap_resource(cdns->dev, &cdns->otg_res); |
| 341 | if (IS_ERR(regs)) |
| 342 | return PTR_ERR(regs); |
| 343 | |
| 344 | /* Detection of DRD version. Controller has been released |
| 345 | * in two versions. Both are similar, but they have same changes |
| 346 | * in register maps. |
| 347 | * The first register in old version is command register and it's read |
| 348 | * only, so driver should read 0 from it. On the other hand, in v1 |
| 349 | * the first register contains device ID number which is not set to 0. |
| 350 | * Driver uses this fact to detect the proper version of |
| 351 | * controller. |
| 352 | */ |
| 353 | cdns->otg_v0_regs = regs; |
| 354 | if (!readl(&cdns->otg_v0_regs->cmd)) { |
| 355 | cdns->version = CDNS3_CONTROLLER_V0; |
| 356 | cdns->otg_v1_regs = NULL; |
| 357 | cdns->otg_regs = regs; |
| 358 | writel(1, &cdns->otg_v0_regs->simulate); |
Peter Chen | eed6ed6 | 2020-03-31 16:10:05 +0800 | [diff] [blame] | 359 | dev_dbg(cdns->dev, "DRD version v0 (%08x)\n", |
Pawel Laszczak | 7733f6c | 2019-08-26 12:19:30 +0100 | [diff] [blame] | 360 | readl(&cdns->otg_v0_regs->version)); |
| 361 | } else { |
| 362 | cdns->otg_v0_regs = NULL; |
| 363 | cdns->otg_v1_regs = regs; |
| 364 | cdns->otg_regs = (void *)&cdns->otg_v1_regs->cmd; |
| 365 | cdns->version = CDNS3_CONTROLLER_V1; |
| 366 | writel(1, &cdns->otg_v1_regs->simulate); |
Peter Chen | eed6ed6 | 2020-03-31 16:10:05 +0800 | [diff] [blame] | 367 | dev_dbg(cdns->dev, "DRD version v1 (ID: %08x, rev: %08x)\n", |
Pawel Laszczak | 7733f6c | 2019-08-26 12:19:30 +0100 | [diff] [blame] | 368 | readl(&cdns->otg_v1_regs->did), |
| 369 | readl(&cdns->otg_v1_regs->rid)); |
| 370 | } |
| 371 | |
| 372 | state = OTGSTS_STRAP(readl(&cdns->otg_regs->sts)); |
| 373 | |
| 374 | /* Update dr_mode according to STRAP configuration. */ |
| 375 | cdns->dr_mode = USB_DR_MODE_OTG; |
| 376 | if (state == OTGSTS_STRAP_HOST) { |
| 377 | dev_dbg(cdns->dev, "Controller strapped to HOST\n"); |
| 378 | cdns->dr_mode = USB_DR_MODE_HOST; |
| 379 | } else if (state == OTGSTS_STRAP_GADGET) { |
| 380 | dev_dbg(cdns->dev, "Controller strapped to PERIPHERAL\n"); |
| 381 | cdns->dr_mode = USB_DR_MODE_PERIPHERAL; |
| 382 | } |
| 383 | |
| 384 | ret = devm_request_threaded_irq(cdns->dev, cdns->otg_irq, |
| 385 | cdns3_drd_irq, |
| 386 | cdns3_drd_thread_irq, |
| 387 | IRQF_SHARED, |
| 388 | dev_name(cdns->dev), cdns); |
Pawel Laszczak | 7733f6c | 2019-08-26 12:19:30 +0100 | [diff] [blame] | 389 | if (ret) { |
| 390 | dev_err(cdns->dev, "couldn't get otg_irq\n"); |
| 391 | return ret; |
| 392 | } |
| 393 | |
| 394 | state = readl(&cdns->otg_regs->sts); |
Pawel Laszczak | ecf4f82 | 2020-07-13 12:05:48 +0200 | [diff] [blame] | 395 | if (OTGSTS_OTG_NRDY(state)) { |
Pawel Laszczak | 7733f6c | 2019-08-26 12:19:30 +0100 | [diff] [blame] | 396 | dev_err(cdns->dev, "Cadence USB3 OTG device not ready\n"); |
| 397 | return -ENODEV; |
| 398 | } |
| 399 | |
Pawel Laszczak | 27afe16 | 2020-07-13 12:05:47 +0200 | [diff] [blame] | 400 | return 0; |
Pawel Laszczak | 7733f6c | 2019-08-26 12:19:30 +0100 | [diff] [blame] | 401 | } |
| 402 | |
| 403 | int cdns3_drd_exit(struct cdns3 *cdns) |
| 404 | { |
| 405 | cdns3_otg_disable_irq(cdns); |
| 406 | return 0; |
| 407 | } |