Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: cdns3: Refactoring names in reusable code

Patch change the functions and objects names in reusable code.
The reusable code includes core.c, core.h, drd.c and drd.h files.
It also changes the names of all references to these functions and
objects in other cdns3 files. There are a lot of changes, but all
changes are very trivial.
The reason of this patch is to avoid of mixing prefix cdns3 and cdnsp in
in cdnsp driver what could introduce some confusion in understanding
of cdnsp driver.
This patch assumes to use three different prefixes in Cadence
USB drivers:
cdns: for common reusable code
cdnsp: for names related only with cdnsp driver
cdns3: for names related only with cdns3 driver

Signed-off-by: Pawel Laszczak <pawell@cadence.com>
Tested-by: Aswath Govindraju <a-govindraju@ti.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>

authored by

Pawel Laszczak and committed by
Peter Chen
0b490046 394c3a14

+199 -198
+1 -1
drivers/usb/cdns3/cdns3-imx.c
··· 250 250 static int cdns_imx_platform_suspend(struct device *dev, 251 251 bool suspend, bool wakeup) 252 252 { 253 - struct cdns3 *cdns = dev_get_drvdata(dev); 253 + struct cdns *cdns = dev_get_drvdata(dev); 254 254 struct device *parent = dev->parent; 255 255 struct cdns_imx *data = dev_get_drvdata(parent); 256 256 void __iomem *otg_regs = (void __iomem *)(cdns->otg_regs);
+13 -12
drivers/usb/cdns3/cdns3-plat.c
··· 20 20 #include "core.h" 21 21 #include "gadget-export.h" 22 22 23 - static int set_phy_power_on(struct cdns3 *cdns) 23 + static int set_phy_power_on(struct cdns *cdns) 24 24 { 25 25 int ret; 26 26 ··· 35 35 return ret; 36 36 } 37 37 38 - static void set_phy_power_off(struct cdns3 *cdns) 38 + static void set_phy_power_off(struct cdns *cdns) 39 39 { 40 40 phy_power_off(cdns->usb3_phy); 41 41 phy_power_off(cdns->usb2_phy); ··· 51 51 { 52 52 struct device *dev = &pdev->dev; 53 53 struct resource *res; 54 - struct cdns3 *cdns; 54 + struct cdns *cdns; 55 55 void __iomem *regs; 56 56 int ret; 57 57 ··· 136 136 goto err_phy_power_on; 137 137 138 138 cdns->gadget_init = cdns3_gadget_init; 139 - ret = cdns3_init(cdns); 139 + 140 + ret = cdns_init(cdns); 140 141 if (ret) 141 142 goto err_cdns_init; 142 143 ··· 176 175 */ 177 176 static int cdns3_plat_remove(struct platform_device *pdev) 178 177 { 179 - struct cdns3 *cdns = platform_get_drvdata(pdev); 178 + struct cdns *cdns = platform_get_drvdata(pdev); 180 179 struct device *dev = cdns->dev; 181 180 182 181 pm_runtime_get_sync(dev); 183 182 pm_runtime_disable(dev); 184 183 pm_runtime_put_noidle(dev); 185 - cdns3_remove(cdns); 184 + cdns_remove(cdns); 186 185 set_phy_power_off(cdns); 187 186 phy_exit(cdns->usb2_phy); 188 187 phy_exit(cdns->usb3_phy); ··· 194 193 static int cdns3_set_platform_suspend(struct device *dev, 195 194 bool suspend, bool wakeup) 196 195 { 197 - struct cdns3 *cdns = dev_get_drvdata(dev); 196 + struct cdns *cdns = dev_get_drvdata(dev); 198 197 int ret = 0; 199 198 200 199 if (cdns->pdata && cdns->pdata->platform_suspend) ··· 205 204 206 205 static int cdns3_controller_suspend(struct device *dev, pm_message_t msg) 207 206 { 208 - struct cdns3 *cdns = dev_get_drvdata(dev); 207 + struct cdns *cdns = dev_get_drvdata(dev); 209 208 bool wakeup; 210 209 unsigned long flags; 211 210 ··· 229 228 230 229 static int cdns3_controller_resume(struct device *dev, pm_message_t msg) 231 230 { 232 - struct cdns3 *cdns = dev_get_drvdata(dev); 231 + struct cdns *cdns = dev_get_drvdata(dev); 233 232 int ret; 234 233 unsigned long flags; 235 234 ··· 243 242 cdns3_set_platform_suspend(cdns->dev, false, false); 244 243 245 244 spin_lock_irqsave(&cdns->lock, flags); 246 - cdns3_resume(cdns, !PMSG_IS_AUTO(msg)); 245 + cdns_resume(cdns, !PMSG_IS_AUTO(msg)); 247 246 cdns->in_lpm = false; 248 247 spin_unlock_irqrestore(&cdns->lock, flags); 249 248 if (cdns->wakeup_pending) { ··· 269 268 270 269 static int cdns3_plat_suspend(struct device *dev) 271 270 { 272 - struct cdns3 *cdns = dev_get_drvdata(dev); 271 + struct cdns *cdns = dev_get_drvdata(dev); 273 272 274 - cdns3_suspend(cdns); 273 + cdns_suspend(cdns); 275 274 276 275 return cdns3_controller_suspend(dev, PMSG_SUSPEND); 277 276 }
+71 -71
drivers/usb/cdns3/core.c
··· 23 23 #include "host-export.h" 24 24 #include "drd.h" 25 25 26 - static int cdns3_idle_init(struct cdns3 *cdns); 26 + static int cdns_idle_init(struct cdns *cdns); 27 27 28 - static int cdns3_role_start(struct cdns3 *cdns, enum usb_role role) 28 + static int cdns_role_start(struct cdns *cdns, enum usb_role role) 29 29 { 30 30 int ret; 31 31 ··· 39 39 if (!cdns->roles[role]) 40 40 return -ENXIO; 41 41 42 - if (cdns->roles[role]->state == CDNS3_ROLE_STATE_ACTIVE) 42 + if (cdns->roles[role]->state == CDNS_ROLE_STATE_ACTIVE) 43 43 return 0; 44 44 45 45 mutex_lock(&cdns->mutex); 46 46 ret = cdns->roles[role]->start(cdns); 47 47 if (!ret) 48 - cdns->roles[role]->state = CDNS3_ROLE_STATE_ACTIVE; 48 + cdns->roles[role]->state = CDNS_ROLE_STATE_ACTIVE; 49 49 mutex_unlock(&cdns->mutex); 50 50 51 51 return ret; 52 52 } 53 53 54 - static void cdns3_role_stop(struct cdns3 *cdns) 54 + static void cdns_role_stop(struct cdns *cdns) 55 55 { 56 56 enum usb_role role = cdns->role; 57 57 58 58 if (WARN_ON(role > USB_ROLE_DEVICE)) 59 59 return; 60 60 61 - if (cdns->roles[role]->state == CDNS3_ROLE_STATE_INACTIVE) 61 + if (cdns->roles[role]->state == CDNS_ROLE_STATE_INACTIVE) 62 62 return; 63 63 64 64 mutex_lock(&cdns->mutex); 65 65 cdns->roles[role]->stop(cdns); 66 - cdns->roles[role]->state = CDNS3_ROLE_STATE_INACTIVE; 66 + cdns->roles[role]->state = CDNS_ROLE_STATE_INACTIVE; 67 67 mutex_unlock(&cdns->mutex); 68 68 } 69 69 70 - static void cdns3_exit_roles(struct cdns3 *cdns) 70 + static void cdns_exit_roles(struct cdns *cdns) 71 71 { 72 - cdns3_role_stop(cdns); 73 - cdns3_drd_exit(cdns); 72 + cdns_role_stop(cdns); 73 + cdns_drd_exit(cdns); 74 74 } 75 75 76 76 /** 77 - * cdns3_core_init_role - initialize role of operation 78 - * @cdns: Pointer to cdns3 structure 77 + * cdns_core_init_role - initialize role of operation 78 + * @cdns: Pointer to cdns structure 79 79 * 80 80 * Returns 0 on success otherwise negative errno 81 81 */ 82 - static int cdns3_core_init_role(struct cdns3 *cdns) 82 + static int cdns_core_init_role(struct cdns *cdns) 83 83 { 84 84 struct device *dev = cdns->dev; 85 85 enum usb_dr_mode best_dr_mode; ··· 120 120 */ 121 121 best_dr_mode = cdns->dr_mode; 122 122 123 - ret = cdns3_idle_init(cdns); 123 + ret = cdns_idle_init(cdns); 124 124 if (ret) 125 125 return ret; 126 126 ··· 136 136 dr_mode = best_dr_mode; 137 137 138 138 if (dr_mode == USB_DR_MODE_OTG || dr_mode == USB_DR_MODE_HOST) { 139 - ret = cdns3_host_init(cdns); 139 + ret = cdns_host_init(cdns); 140 140 if (ret) { 141 141 dev_err(dev, "Host initialization failed with %d\n", 142 142 ret); ··· 159 159 160 160 cdns->dr_mode = dr_mode; 161 161 162 - ret = cdns3_drd_update_mode(cdns); 162 + ret = cdns_drd_update_mode(cdns); 163 163 if (ret) 164 164 goto err; 165 165 166 166 /* Initialize idle role to start with */ 167 - ret = cdns3_role_start(cdns, USB_ROLE_NONE); 167 + ret = cdns_role_start(cdns, USB_ROLE_NONE); 168 168 if (ret) 169 169 goto err; 170 170 171 171 switch (cdns->dr_mode) { 172 172 case USB_DR_MODE_OTG: 173 - ret = cdns3_hw_role_switch(cdns); 173 + ret = cdns_hw_role_switch(cdns); 174 174 if (ret) 175 175 goto err; 176 176 break; 177 177 case USB_DR_MODE_PERIPHERAL: 178 - ret = cdns3_role_start(cdns, USB_ROLE_DEVICE); 178 + ret = cdns_role_start(cdns, USB_ROLE_DEVICE); 179 179 if (ret) 180 180 goto err; 181 181 break; 182 182 case USB_DR_MODE_HOST: 183 - ret = cdns3_role_start(cdns, USB_ROLE_HOST); 183 + ret = cdns_role_start(cdns, USB_ROLE_HOST); 184 184 if (ret) 185 185 goto err; 186 186 break; ··· 191 191 192 192 return 0; 193 193 err: 194 - cdns3_exit_roles(cdns); 194 + cdns_exit_roles(cdns); 195 195 return ret; 196 196 } 197 197 198 198 /** 199 - * cdns3_hw_role_state_machine - role switch state machine based on hw events. 199 + * cdns_hw_role_state_machine - role switch state machine based on hw events. 200 200 * @cdns: Pointer to controller structure. 201 201 * 202 202 * Returns next role to be entered based on hw events. 203 203 */ 204 - static enum usb_role cdns3_hw_role_state_machine(struct cdns3 *cdns) 204 + static enum usb_role cdns_hw_role_state_machine(struct cdns *cdns) 205 205 { 206 206 enum usb_role role = USB_ROLE_NONE; 207 207 int id, vbus; 208 208 209 209 if (cdns->dr_mode != USB_DR_MODE_OTG) { 210 - if (cdns3_is_host(cdns)) 210 + if (cdns_is_host(cdns)) 211 211 role = USB_ROLE_HOST; 212 - if (cdns3_is_device(cdns)) 212 + if (cdns_is_device(cdns)) 213 213 role = USB_ROLE_DEVICE; 214 214 215 215 return role; 216 216 } 217 217 218 - id = cdns3_get_id(cdns); 219 - vbus = cdns3_get_vbus(cdns); 218 + id = cdns_get_id(cdns); 219 + vbus = cdns_get_vbus(cdns); 220 220 221 221 /* 222 222 * Role change state machine ··· 252 252 return role; 253 253 } 254 254 255 - static int cdns3_idle_role_start(struct cdns3 *cdns) 255 + static int cdns_idle_role_start(struct cdns *cdns) 256 256 { 257 257 return 0; 258 258 } 259 259 260 - static void cdns3_idle_role_stop(struct cdns3 *cdns) 260 + static void cdns_idle_role_stop(struct cdns *cdns) 261 261 { 262 262 /* Program Lane swap and bring PHY out of RESET */ 263 263 phy_reset(cdns->usb3_phy); 264 264 } 265 265 266 - static int cdns3_idle_init(struct cdns3 *cdns) 266 + static int cdns_idle_init(struct cdns *cdns) 267 267 { 268 - struct cdns3_role_driver *rdrv; 268 + struct cdns_role_driver *rdrv; 269 269 270 270 rdrv = devm_kzalloc(cdns->dev, sizeof(*rdrv), GFP_KERNEL); 271 271 if (!rdrv) 272 272 return -ENOMEM; 273 273 274 - rdrv->start = cdns3_idle_role_start; 275 - rdrv->stop = cdns3_idle_role_stop; 276 - rdrv->state = CDNS3_ROLE_STATE_INACTIVE; 274 + rdrv->start = cdns_idle_role_start; 275 + rdrv->stop = cdns_idle_role_stop; 276 + rdrv->state = CDNS_ROLE_STATE_INACTIVE; 277 277 rdrv->suspend = NULL; 278 278 rdrv->resume = NULL; 279 279 rdrv->name = "idle"; ··· 284 284 } 285 285 286 286 /** 287 - * cdns3_hw_role_switch - switch roles based on HW state 287 + * cdns_hw_role_switch - switch roles based on HW state 288 288 * @cdns: controller 289 289 */ 290 - int cdns3_hw_role_switch(struct cdns3 *cdns) 290 + int cdns_hw_role_switch(struct cdns *cdns) 291 291 { 292 292 enum usb_role real_role, current_role; 293 293 int ret = 0; ··· 299 299 pm_runtime_get_sync(cdns->dev); 300 300 301 301 current_role = cdns->role; 302 - real_role = cdns3_hw_role_state_machine(cdns); 302 + real_role = cdns_hw_role_state_machine(cdns); 303 303 304 304 /* Do nothing if nothing changed */ 305 305 if (current_role == real_role) 306 306 goto exit; 307 307 308 - cdns3_role_stop(cdns); 308 + cdns_role_stop(cdns); 309 309 310 310 dev_dbg(cdns->dev, "Switching role %d -> %d", current_role, real_role); 311 311 312 - ret = cdns3_role_start(cdns, real_role); 312 + ret = cdns_role_start(cdns, real_role); 313 313 if (ret) { 314 314 /* Back to current role */ 315 315 dev_err(cdns->dev, "set %d has failed, back to %d\n", 316 316 real_role, current_role); 317 - ret = cdns3_role_start(cdns, current_role); 317 + ret = cdns_role_start(cdns, current_role); 318 318 if (ret) 319 319 dev_err(cdns->dev, "back to %d failed too\n", 320 320 current_role); ··· 331 331 * 332 332 * Returns role 333 333 */ 334 - static enum usb_role cdns3_role_get(struct usb_role_switch *sw) 334 + static enum usb_role cdns_role_get(struct usb_role_switch *sw) 335 335 { 336 - struct cdns3 *cdns = usb_role_switch_get_drvdata(sw); 336 + struct cdns *cdns = usb_role_switch_get_drvdata(sw); 337 337 338 338 return cdns->role; 339 339 } 340 340 341 341 /** 342 - * cdns3_role_set - set current role of controller. 342 + * cdns_role_set - set current role of controller. 343 343 * 344 344 * @sw: pointer to USB role switch structure 345 345 * @role: the previous role ··· 347 347 * - Role switch for dual-role devices 348 348 * - USB_ROLE_GADGET <--> USB_ROLE_NONE for peripheral-only devices 349 349 */ 350 - static int cdns3_role_set(struct usb_role_switch *sw, enum usb_role role) 350 + static int cdns_role_set(struct usb_role_switch *sw, enum usb_role role) 351 351 { 352 - struct cdns3 *cdns = usb_role_switch_get_drvdata(sw); 352 + struct cdns *cdns = usb_role_switch_get_drvdata(sw); 353 353 int ret = 0; 354 354 355 355 pm_runtime_get_sync(cdns->dev); ··· 377 377 } 378 378 } 379 379 380 - cdns3_role_stop(cdns); 381 - ret = cdns3_role_start(cdns, role); 380 + cdns_role_stop(cdns); 381 + ret = cdns_role_start(cdns, role); 382 382 if (ret) 383 383 dev_err(cdns->dev, "set role %d has failed\n", role); 384 384 ··· 389 389 390 390 391 391 /** 392 - * cdns3_wakeup_irq - interrupt handler for wakeup events 393 - * @irq: irq number for cdns3 core device 394 - * @data: structure of cdns3 392 + * cdns_wakeup_irq - interrupt handler for wakeup events 393 + * @irq: irq number for cdns3/cdnsp core device 394 + * @data: structure of cdns 395 395 * 396 396 * Returns IRQ_HANDLED or IRQ_NONE 397 397 */ 398 - static irqreturn_t cdns3_wakeup_irq(int irq, void *data) 398 + static irqreturn_t cdns_wakeup_irq(int irq, void *data) 399 399 { 400 - struct cdns3 *cdns = data; 400 + struct cdns *cdns = data; 401 401 402 402 if (cdns->in_lpm) { 403 403 disable_irq_nosync(irq); ··· 412 412 } 413 413 414 414 /** 415 - * cdns3_probe - probe for cdns3 core device 416 - * @cdns: Pointer to cdnsp structure. 415 + * cdns_probe - probe for cdns3/cdnsp core device 416 + * @cdns: Pointer to cdns structure. 417 417 * 418 418 * Returns 0 on success otherwise negative errno 419 419 */ 420 - int cdns3_init(struct cdns3 *cdns) 420 + int cdns_init(struct cdns *cdns) 421 421 { 422 422 struct device *dev = cdns->dev; 423 423 int ret; ··· 433 433 if (device_property_read_bool(dev, "usb-role-switch")) { 434 434 struct usb_role_switch_desc sw_desc = { }; 435 435 436 - sw_desc.set = cdns3_role_set; 437 - sw_desc.get = cdns3_role_get; 436 + sw_desc.set = cdns_role_set; 437 + sw_desc.get = cdns_role_get; 438 438 sw_desc.allow_userspace_control = true; 439 439 sw_desc.driver_data = cdns; 440 440 sw_desc.fwnode = dev->fwnode; ··· 448 448 449 449 if (cdns->wakeup_irq) { 450 450 ret = devm_request_irq(cdns->dev, cdns->wakeup_irq, 451 - cdns3_wakeup_irq, 451 + cdns_wakeup_irq, 452 452 IRQF_SHARED, 453 453 dev_name(cdns->dev), cdns); 454 454 ··· 458 458 } 459 459 } 460 460 461 - ret = cdns3_drd_init(cdns); 461 + ret = cdns_drd_init(cdns); 462 462 if (ret) 463 463 goto init_failed; 464 464 465 - ret = cdns3_core_init_role(cdns); 465 + ret = cdns_core_init_role(cdns); 466 466 if (ret) 467 467 goto init_failed; 468 468 ··· 472 472 473 473 return 0; 474 474 init_failed: 475 - cdns3_drd_exit(cdns); 475 + cdns_drd_exit(cdns); 476 476 role_switch_unregister: 477 477 if (cdns->role_sw) 478 478 usb_role_switch_unregister(cdns->role_sw); 479 479 480 480 return ret; 481 481 } 482 - EXPORT_SYMBOL_GPL(cdns3_init); 482 + EXPORT_SYMBOL_GPL(cdns_init); 483 483 484 484 /** 485 - * cdns3_remove - unbind drd driver and clean up 486 - * @cdns: Pointer to cdnsp structure. 485 + * cdns_remove - unbind drd driver and clean up 486 + * @cdns: Pointer to cdns structure. 487 487 * 488 488 * Returns 0 on success otherwise negative errno 489 489 */ 490 - int cdns3_remove(struct cdns3 *cdns) 490 + int cdns_remove(struct cdns *cdns) 491 491 { 492 - cdns3_exit_roles(cdns); 492 + cdns_exit_roles(cdns); 493 493 usb_role_switch_unregister(cdns->role_sw); 494 494 495 495 return 0; 496 496 } 497 - EXPORT_SYMBOL_GPL(cdns3_remove); 497 + EXPORT_SYMBOL_GPL(cdns_remove); 498 498 499 499 #ifdef CONFIG_PM_SLEEP 500 - int cdns3_suspend(struct cdns3 *cdns) 500 + int cdns_suspend(struct cdns *cdns) 501 501 { 502 502 struct device *dev = cdns->dev; 503 503 unsigned long flags; ··· 513 513 514 514 return 0; 515 515 } 516 - EXPORT_SYMBOL_GPL(cdns3_suspend); 516 + EXPORT_SYMBOL_GPL(cdns_suspend); 517 517 518 - int cdns3_resume(struct cdns3 *cdns, u8 set_active) 518 + int cdns_resume(struct cdns *cdns, u8 set_active) 519 519 { 520 520 struct device *dev = cdns->dev; 521 521 ··· 530 530 531 531 return 0; 532 532 } 533 - EXPORT_SYMBOL_GPL(cdns3_resume); 533 + EXPORT_SYMBOL_GPL(cdns_resume); 534 534 #endif /* CONFIG_PM_SLEEP */ 535 535 536 536 MODULE_AUTHOR("Peter Chen <peter.chen@nxp.com>");
+23 -23
drivers/usb/cdns3/core.h
··· 14 14 #ifndef __LINUX_CDNS3_CORE_H 15 15 #define __LINUX_CDNS3_CORE_H 16 16 17 - struct cdns3; 17 + struct cdns; 18 18 19 19 /** 20 - * struct cdns3_role_driver - host/gadget role driver 20 + * struct cdns_role_driver - host/gadget role driver 21 21 * @start: start this role 22 22 * @stop: stop this role 23 23 * @suspend: suspend callback for this role ··· 26 26 * @name: role name string (host/gadget) 27 27 * @state: current state 28 28 */ 29 - struct cdns3_role_driver { 30 - int (*start)(struct cdns3 *cdns); 31 - void (*stop)(struct cdns3 *cdns); 32 - int (*suspend)(struct cdns3 *cdns, bool do_wakeup); 33 - int (*resume)(struct cdns3 *cdns, bool hibernated); 29 + struct cdns_role_driver { 30 + int (*start)(struct cdns *cdns); 31 + void (*stop)(struct cdns *cdns); 32 + int (*suspend)(struct cdns *cdns, bool do_wakeup); 33 + int (*resume)(struct cdns *cdns, bool hibernated); 34 34 const char *name; 35 - #define CDNS3_ROLE_STATE_INACTIVE 0 36 - #define CDNS3_ROLE_STATE_ACTIVE 1 35 + #define CDNS_ROLE_STATE_INACTIVE 0 36 + #define CDNS_ROLE_STATE_ACTIVE 1 37 37 int state; 38 38 }; 39 39 40 - #define CDNS3_XHCI_RESOURCES_NUM 2 40 + #define CDNS_XHCI_RESOURCES_NUM 2 41 41 42 42 struct cdns3_platform_data { 43 43 int (*platform_suspend)(struct device *dev, ··· 47 47 }; 48 48 49 49 /** 50 - * struct cdns3 - Representation of Cadence USB3 DRD controller. 50 + * struct cdns - Representation of Cadence USB3 DRD controller. 51 51 * @dev: pointer to Cadence device struct 52 52 * @xhci_regs: pointer to base of xhci registers 53 53 * @xhci_res: the resource for xhci ··· 63 63 * @wakeup_irq: irq number for wakeup event, it is optional 64 64 * @roles: array of supported roles for this controller 65 65 * @role: current role 66 - * @host_dev: the child host device pointer for cdns3 core 66 + * @host_dev: the child host device pointer for cdns core 67 67 * @gadget_dev: the child gadget device pointer for cdns3 core 68 68 * @usb2_phy: pointer to USB2 PHY 69 69 * @usb3_phy: pointer to USB3 PHY ··· 80 80 * @xhci_plat_data: xhci private data structure pointer 81 81 * @gadget_init: pointer to gadget initialization function 82 82 */ 83 - struct cdns3 { 83 + struct cdns { 84 84 struct device *dev; 85 85 void __iomem *xhci_regs; 86 - struct resource xhci_res[CDNS3_XHCI_RESOURCES_NUM]; 86 + struct resource xhci_res[CDNS_XHCI_RESOURCES_NUM]; 87 87 struct cdns3_usb_regs __iomem *dev_regs; 88 88 89 89 struct resource otg_res; 90 90 struct cdns3_otg_legacy_regs *otg_v0_regs; 91 91 struct cdns3_otg_regs *otg_v1_regs; 92 92 struct cdnsp_otg_regs *otg_cdnsp_regs; 93 - struct cdns3_otg_common_regs *otg_regs; 94 - struct cdns3_otg_irq_regs *otg_irq_regs; 93 + struct cdns_otg_common_regs *otg_regs; 94 + struct cdns_otg_irq_regs *otg_irq_regs; 95 95 #define CDNS3_CONTROLLER_V0 0 96 96 #define CDNS3_CONTROLLER_V1 1 97 97 #define CDNSP_CONTROLLER_V2 2 ··· 101 101 int otg_irq; 102 102 int dev_irq; 103 103 int wakeup_irq; 104 - struct cdns3_role_driver *roles[USB_ROLE_DEVICE + 1]; 104 + struct cdns_role_driver *roles[USB_ROLE_DEVICE + 1]; 105 105 enum usb_role role; 106 106 struct platform_device *host_dev; 107 107 struct cdns3_device *gadget_dev; ··· 117 117 spinlock_t lock; 118 118 struct xhci_plat_priv *xhci_plat_data; 119 119 120 - int (*gadget_init)(struct cdns3 *cdns); 120 + int (*gadget_init)(struct cdns *cdns); 121 121 }; 122 122 123 - int cdns3_hw_role_switch(struct cdns3 *cdns); 124 - int cdns3_init(struct cdns3 *cdns); 125 - int cdns3_remove(struct cdns3 *cdns); 123 + int cdns_hw_role_switch(struct cdns *cdns); 124 + int cdns_init(struct cdns *cdns); 125 + int cdns_remove(struct cdns *cdns); 126 126 127 127 #ifdef CONFIG_PM_SLEEP 128 - int cdns3_resume(struct cdns3 *cdns, u8 set_active); 129 - int cdns3_suspend(struct cdns3 *cdns); 128 + int cdns_resume(struct cdns *cdns, u8 set_active); 129 + int cdns_suspend(struct cdns *cdns); 130 130 #endif /* CONFIG_PM_SLEEP */ 131 131 #endif /* __LINUX_CDNS3_CORE_H */
+50 -50
drivers/usb/cdns3/drd.c
··· 19 19 #include "core.h" 20 20 21 21 /** 22 - * cdns3_set_mode - change mode of OTG Core 22 + * cdns_set_mode - change mode of OTG Core 23 23 * @cdns: pointer to context structure 24 24 * @mode: selected mode from cdns_role 25 25 * 26 26 * Returns 0 on success otherwise negative errno 27 27 */ 28 - static int cdns3_set_mode(struct cdns3 *cdns, enum usb_dr_mode mode) 28 + static int cdns_set_mode(struct cdns *cdns, enum usb_dr_mode mode) 29 29 { 30 30 u32 __iomem *override_reg; 31 31 u32 reg; ··· 83 83 return 0; 84 84 } 85 85 86 - int cdns3_get_id(struct cdns3 *cdns) 86 + int cdns_get_id(struct cdns *cdns) 87 87 { 88 88 int id; 89 89 ··· 93 93 return id; 94 94 } 95 95 96 - int cdns3_get_vbus(struct cdns3 *cdns) 96 + int cdns_get_vbus(struct cdns *cdns) 97 97 { 98 98 int vbus; 99 99 ··· 103 103 return vbus; 104 104 } 105 105 106 - bool cdns3_is_host(struct cdns3 *cdns) 106 + bool cdns_is_host(struct cdns *cdns) 107 107 { 108 108 if (cdns->dr_mode == USB_DR_MODE_HOST) 109 109 return true; 110 - else if (cdns3_get_id(cdns) == CDNS3_ID_HOST) 110 + else if (cdns_get_id(cdns) == CDNS3_ID_HOST) 111 111 return true; 112 112 113 113 return false; 114 114 } 115 115 116 - bool cdns3_is_device(struct cdns3 *cdns) 116 + bool cdns_is_device(struct cdns *cdns) 117 117 { 118 118 if (cdns->dr_mode == USB_DR_MODE_PERIPHERAL) 119 119 return true; 120 120 else if (cdns->dr_mode == USB_DR_MODE_OTG) 121 - if (cdns3_get_id(cdns) == CDNS3_ID_PERIPHERAL) 121 + if (cdns_get_id(cdns) == CDNS3_ID_PERIPHERAL) 122 122 return true; 123 123 124 124 return false; 125 125 } 126 126 127 127 /** 128 - * cdns3_otg_disable_irq - Disable all OTG interrupts 128 + * cdns_otg_disable_irq - Disable all OTG interrupts 129 129 * @cdns: Pointer to controller context structure 130 130 */ 131 - static void cdns3_otg_disable_irq(struct cdns3 *cdns) 131 + static void cdns_otg_disable_irq(struct cdns *cdns) 132 132 { 133 133 writel(0, &cdns->otg_irq_regs->ien); 134 134 } 135 135 136 136 /** 137 - * cdns3_otg_enable_irq - enable id and sess_valid interrupts 137 + * cdns_otg_enable_irq - enable id and sess_valid interrupts 138 138 * @cdns: Pointer to controller context structure 139 139 */ 140 - static void cdns3_otg_enable_irq(struct cdns3 *cdns) 140 + static void cdns_otg_enable_irq(struct cdns *cdns) 141 141 { 142 142 writel(OTGIEN_ID_CHANGE_INT | OTGIEN_VBUSVALID_RISE_INT | 143 143 OTGIEN_VBUSVALID_FALL_INT, &cdns->otg_irq_regs->ien); 144 144 } 145 145 146 146 /** 147 - * cdns3_drd_host_on - start host. 147 + * cdns_drd_host_on - start host. 148 148 * @cdns: Pointer to controller context structure. 149 149 * 150 150 * Returns 0 on success otherwise negative errno. 151 151 */ 152 - int cdns3_drd_host_on(struct cdns3 *cdns) 152 + int cdns_drd_host_on(struct cdns *cdns) 153 153 { 154 154 u32 val, ready_bit; 155 155 int ret; ··· 175 175 } 176 176 177 177 /** 178 - * cdns3_drd_host_off - stop host. 178 + * cdns_drd_host_off - stop host. 179 179 * @cdns: Pointer to controller context structure. 180 180 */ 181 - void cdns3_drd_host_off(struct cdns3 *cdns) 181 + void cdns_drd_host_off(struct cdns *cdns) 182 182 { 183 183 u32 val; 184 184 ··· 194 194 } 195 195 196 196 /** 197 - * cdns3_drd_gadget_on - start gadget. 197 + * cdns_drd_gadget_on - start gadget. 198 198 * @cdns: Pointer to controller context structure. 199 199 * 200 200 * Returns 0 on success otherwise negative errno 201 201 */ 202 - int cdns3_drd_gadget_on(struct cdns3 *cdns) 202 + int cdns_drd_gadget_on(struct cdns *cdns) 203 203 { 204 204 u32 reg = OTGCMD_OTG_DIS; 205 205 u32 ready_bit; ··· 225 225 phy_set_mode(cdns->usb3_phy, PHY_MODE_USB_DEVICE); 226 226 return 0; 227 227 } 228 - EXPORT_SYMBOL_GPL(cdns3_drd_gadget_on); 228 + EXPORT_SYMBOL_GPL(cdns_drd_gadget_on); 229 229 230 230 /** 231 - * cdns3_drd_gadget_off - stop gadget. 231 + * cdns_drd_gadget_off - stop gadget. 232 232 * @cdns: Pointer to controller context structure. 233 233 */ 234 - void cdns3_drd_gadget_off(struct cdns3 *cdns) 234 + void cdns_drd_gadget_off(struct cdns *cdns) 235 235 { 236 236 u32 val; 237 237 ··· 249 249 1, 2000000); 250 250 phy_set_mode(cdns->usb3_phy, PHY_MODE_INVALID); 251 251 } 252 - EXPORT_SYMBOL_GPL(cdns3_drd_gadget_off); 252 + EXPORT_SYMBOL_GPL(cdns_drd_gadget_off); 253 253 254 254 /** 255 - * cdns3_init_otg_mode - initialize drd controller 255 + * cdns_init_otg_mode - initialize drd controller 256 256 * @cdns: Pointer to controller context structure 257 257 * 258 258 * Returns 0 on success otherwise negative errno 259 259 */ 260 - static int cdns3_init_otg_mode(struct cdns3 *cdns) 260 + static int cdns_init_otg_mode(struct cdns *cdns) 261 261 { 262 262 int ret; 263 263 264 - cdns3_otg_disable_irq(cdns); 264 + cdns_otg_disable_irq(cdns); 265 265 /* clear all interrupts */ 266 266 writel(~0, &cdns->otg_irq_regs->ivect); 267 267 268 - ret = cdns3_set_mode(cdns, USB_DR_MODE_OTG); 268 + ret = cdns_set_mode(cdns, USB_DR_MODE_OTG); 269 269 if (ret) 270 270 return ret; 271 271 272 - cdns3_otg_enable_irq(cdns); 272 + cdns_otg_enable_irq(cdns); 273 273 274 274 return 0; 275 275 } 276 276 277 277 /** 278 - * cdns3_drd_update_mode - initialize mode of operation 278 + * cdns_drd_update_mode - initialize mode of operation 279 279 * @cdns: Pointer to controller context structure 280 280 * 281 281 * Returns 0 on success otherwise negative errno 282 282 */ 283 - int cdns3_drd_update_mode(struct cdns3 *cdns) 283 + int cdns_drd_update_mode(struct cdns *cdns) 284 284 { 285 285 int ret; 286 286 287 287 switch (cdns->dr_mode) { 288 288 case USB_DR_MODE_PERIPHERAL: 289 - ret = cdns3_set_mode(cdns, USB_DR_MODE_PERIPHERAL); 289 + ret = cdns_set_mode(cdns, USB_DR_MODE_PERIPHERAL); 290 290 break; 291 291 case USB_DR_MODE_HOST: 292 - ret = cdns3_set_mode(cdns, USB_DR_MODE_HOST); 292 + ret = cdns_set_mode(cdns, USB_DR_MODE_HOST); 293 293 break; 294 294 case USB_DR_MODE_OTG: 295 - ret = cdns3_init_otg_mode(cdns); 295 + ret = cdns_init_otg_mode(cdns); 296 296 break; 297 297 default: 298 298 dev_err(cdns->dev, "Unsupported mode of operation %d\n", ··· 303 303 return ret; 304 304 } 305 305 306 - static irqreturn_t cdns3_drd_thread_irq(int irq, void *data) 306 + static irqreturn_t cdns_drd_thread_irq(int irq, void *data) 307 307 { 308 - struct cdns3 *cdns = data; 308 + struct cdns *cdns = data; 309 309 310 - cdns3_hw_role_switch(cdns); 310 + cdns_hw_role_switch(cdns); 311 311 312 312 return IRQ_HANDLED; 313 313 } 314 314 315 315 /** 316 - * cdns3_drd_irq - interrupt handler for OTG events 316 + * cdns_drd_irq - interrupt handler for OTG events 317 317 * 318 - * @irq: irq number for cdns3 core device 319 - * @data: structure of cdns3 318 + * @irq: irq number for cdns core device 319 + * @data: structure of cdns 320 320 * 321 321 * Returns IRQ_HANDLED or IRQ_NONE 322 322 */ 323 - static irqreturn_t cdns3_drd_irq(int irq, void *data) 323 + static irqreturn_t cdns_drd_irq(int irq, void *data) 324 324 { 325 325 irqreturn_t ret = IRQ_NONE; 326 - struct cdns3 *cdns = data; 326 + struct cdns *cdns = data; 327 327 u32 reg; 328 328 329 329 if (cdns->dr_mode != USB_DR_MODE_OTG) ··· 339 339 340 340 if (reg & OTGIEN_ID_CHANGE_INT) { 341 341 dev_dbg(cdns->dev, "OTG IRQ: new ID: %d\n", 342 - cdns3_get_id(cdns)); 342 + cdns_get_id(cdns)); 343 343 344 344 ret = IRQ_WAKE_THREAD; 345 345 } 346 346 347 347 if (reg & (OTGIEN_VBUSVALID_RISE_INT | OTGIEN_VBUSVALID_FALL_INT)) { 348 348 dev_dbg(cdns->dev, "OTG IRQ: new VBUS: %d\n", 349 - cdns3_get_vbus(cdns)); 349 + cdns_get_vbus(cdns)); 350 350 351 351 ret = IRQ_WAKE_THREAD; 352 352 } ··· 355 355 return ret; 356 356 } 357 357 358 - int cdns3_drd_init(struct cdns3 *cdns) 358 + int cdns_drd_init(struct cdns *cdns) 359 359 { 360 360 void __iomem *regs; 361 361 u32 state; ··· 380 380 cdns->otg_v1_regs = NULL; 381 381 cdns->otg_cdnsp_regs = NULL; 382 382 cdns->otg_regs = regs; 383 - cdns->otg_irq_regs = (struct cdns3_otg_irq_regs *) 383 + cdns->otg_irq_regs = (struct cdns_otg_irq_regs *) 384 384 &cdns->otg_v0_regs->ien; 385 385 writel(1, &cdns->otg_v0_regs->simulate); 386 386 dev_dbg(cdns->dev, "DRD version v0 (%08x)\n", ··· 393 393 cdns->otg_regs = (void *)&cdns->otg_v1_regs->cmd; 394 394 395 395 if (cdns->otg_cdnsp_regs->did == OTG_CDNSP_DID) { 396 - cdns->otg_irq_regs = (struct cdns3_otg_irq_regs *) 396 + cdns->otg_irq_regs = (struct cdns_otg_irq_regs *) 397 397 &cdns->otg_cdnsp_regs->ien; 398 398 cdns->version = CDNSP_CONTROLLER_V2; 399 399 } else { 400 - cdns->otg_irq_regs = (struct cdns3_otg_irq_regs *) 400 + cdns->otg_irq_regs = (struct cdns_otg_irq_regs *) 401 401 &cdns->otg_v1_regs->ien; 402 402 writel(1, &cdns->otg_v1_regs->simulate); 403 403 cdns->version = CDNS3_CONTROLLER_V1; ··· 428 428 } 429 429 430 430 ret = devm_request_threaded_irq(cdns->dev, cdns->otg_irq, 431 - cdns3_drd_irq, 432 - cdns3_drd_thread_irq, 431 + cdns_drd_irq, 432 + cdns_drd_thread_irq, 433 433 IRQF_SHARED, 434 434 dev_name(cdns->dev), cdns); 435 435 if (ret) { ··· 446 446 return 0; 447 447 } 448 448 449 - int cdns3_drd_exit(struct cdns3 *cdns) 449 + int cdns_drd_exit(struct cdns *cdns) 450 450 { 451 - cdns3_otg_disable_irq(cdns); 451 + cdns_otg_disable_irq(cdns); 452 452 return 0; 453 453 }
+13 -13
drivers/usb/cdns3/drd.h
··· 84 84 /* 85 85 * Common registers interface for both CDNS3 and CDNSP version of DRD. 86 86 */ 87 - struct cdns3_otg_common_regs { 87 + struct cdns_otg_common_regs { 88 88 __le32 cmd; 89 89 __le32 sts; 90 90 __le32 state; ··· 94 94 * Interrupt related registers. This registers are mapped in different 95 95 * location for CDNSP controller. 96 96 */ 97 - struct cdns3_otg_irq_regs { 97 + struct cdns_otg_irq_regs { 98 98 __le32 ien; 99 99 __le32 ivect; 100 100 }; ··· 202 202 #define CDNS3_ID_PERIPHERAL 1 203 203 #define CDNS3_ID_HOST 0 204 204 205 - bool cdns3_is_host(struct cdns3 *cdns); 206 - bool cdns3_is_device(struct cdns3 *cdns); 207 - int cdns3_get_id(struct cdns3 *cdns); 208 - int cdns3_get_vbus(struct cdns3 *cdns); 209 - int cdns3_drd_init(struct cdns3 *cdns); 210 - int cdns3_drd_exit(struct cdns3 *cdns); 211 - int cdns3_drd_update_mode(struct cdns3 *cdns); 212 - int cdns3_drd_gadget_on(struct cdns3 *cdns); 213 - void cdns3_drd_gadget_off(struct cdns3 *cdns); 214 - int cdns3_drd_host_on(struct cdns3 *cdns); 215 - void cdns3_drd_host_off(struct cdns3 *cdns); 205 + bool cdns_is_host(struct cdns *cdns); 206 + bool cdns_is_device(struct cdns *cdns); 207 + int cdns_get_id(struct cdns *cdns); 208 + int cdns_get_vbus(struct cdns *cdns); 209 + int cdns_drd_init(struct cdns *cdns); 210 + int cdns_drd_exit(struct cdns *cdns); 211 + int cdns_drd_update_mode(struct cdns *cdns); 212 + int cdns_drd_gadget_on(struct cdns *cdns); 213 + void cdns_drd_gadget_off(struct cdns *cdns); 214 + int cdns_drd_host_on(struct cdns *cdns); 215 + void cdns_drd_host_off(struct cdns *cdns); 216 216 217 217 #endif /* __LINUX_CDNS3_DRD */
+2 -2
drivers/usb/cdns3/gadget-export.h
··· 12 12 13 13 #ifdef CONFIG_USB_CDNS3_GADGET 14 14 15 - int cdns3_gadget_init(struct cdns3 *cdns); 15 + int cdns3_gadget_init(struct cdns *cdns); 16 16 #else 17 17 18 - static inline int cdns3_gadget_init(struct cdns3 *cdns) 18 + static inline int cdns3_gadget_init(struct cdns *cdns) 19 19 { 20 20 return -ENXIO; 21 21 }
+12 -12
drivers/usb/cdns3/gadget.c
··· 1844 1844 static irqreturn_t cdns3_device_irq_handler(int irq, void *data) 1845 1845 { 1846 1846 struct cdns3_device *priv_dev = data; 1847 - struct cdns3 *cdns = dev_get_drvdata(priv_dev->dev); 1847 + struct cdns *cdns = dev_get_drvdata(priv_dev->dev); 1848 1848 irqreturn_t ret = IRQ_NONE; 1849 1849 u32 reg; 1850 1850 ··· 3084 3084 kfree(priv_dev); 3085 3085 } 3086 3086 3087 - static void cdns3_gadget_exit(struct cdns3 *cdns) 3087 + static void cdns3_gadget_exit(struct cdns *cdns) 3088 3088 { 3089 3089 struct cdns3_device *priv_dev; 3090 3090 ··· 3117 3117 kfree(priv_dev->zlp_buf); 3118 3118 usb_put_gadget(&priv_dev->gadget); 3119 3119 cdns->gadget_dev = NULL; 3120 - cdns3_drd_gadget_off(cdns); 3120 + cdns_drd_gadget_off(cdns); 3121 3121 } 3122 3122 3123 - static int cdns3_gadget_start(struct cdns3 *cdns) 3123 + static int cdns3_gadget_start(struct cdns *cdns) 3124 3124 { 3125 3125 struct cdns3_device *priv_dev; 3126 3126 u32 max_speed; ··· 3240 3240 return ret; 3241 3241 } 3242 3242 3243 - static int __cdns3_gadget_init(struct cdns3 *cdns) 3243 + static int __cdns3_gadget_init(struct cdns *cdns) 3244 3244 { 3245 3245 int ret = 0; 3246 3246 ··· 3251 3251 return ret; 3252 3252 } 3253 3253 3254 - cdns3_drd_gadget_on(cdns); 3254 + cdns_drd_gadget_on(cdns); 3255 3255 pm_runtime_get_sync(cdns->dev); 3256 3256 3257 3257 ret = cdns3_gadget_start(cdns); ··· 3277 3277 return ret; 3278 3278 } 3279 3279 3280 - static int cdns3_gadget_suspend(struct cdns3 *cdns, bool do_wakeup) 3280 + static int cdns3_gadget_suspend(struct cdns *cdns, bool do_wakeup) 3281 3281 __must_hold(&cdns->lock) 3282 3282 { 3283 3283 struct cdns3_device *priv_dev = cdns->gadget_dev; ··· 3296 3296 return 0; 3297 3297 } 3298 3298 3299 - static int cdns3_gadget_resume(struct cdns3 *cdns, bool hibernated) 3299 + static int cdns3_gadget_resume(struct cdns *cdns, bool hibernated) 3300 3300 { 3301 3301 struct cdns3_device *priv_dev = cdns->gadget_dev; 3302 3302 ··· 3311 3311 /** 3312 3312 * cdns3_gadget_init - initialize device structure 3313 3313 * 3314 - * @cdns: cdns3 instance 3314 + * @cdns: cdns instance 3315 3315 * 3316 3316 * This function initializes the gadget. 3317 3317 */ 3318 - int cdns3_gadget_init(struct cdns3 *cdns) 3318 + int cdns3_gadget_init(struct cdns *cdns) 3319 3319 { 3320 - struct cdns3_role_driver *rdrv; 3320 + struct cdns_role_driver *rdrv; 3321 3321 3322 3322 rdrv = devm_kzalloc(cdns->dev, sizeof(*rdrv), GFP_KERNEL); 3323 3323 if (!rdrv) ··· 3327 3327 rdrv->stop = cdns3_gadget_exit; 3328 3328 rdrv->suspend = cdns3_gadget_suspend; 3329 3329 rdrv->resume = cdns3_gadget_resume; 3330 - rdrv->state = CDNS3_ROLE_STATE_INACTIVE; 3330 + rdrv->state = CDNS_ROLE_STATE_INACTIVE; 3331 3331 rdrv->name = "gadget"; 3332 3332 cdns->roles[USB_ROLE_DEVICE] = rdrv; 3333 3333
+3 -3
drivers/usb/cdns3/host-export.h
··· 12 12 struct usb_hcd; 13 13 #ifdef CONFIG_USB_CDNS3_HOST 14 14 15 - int cdns3_host_init(struct cdns3 *cdns); 15 + int cdns_host_init(struct cdns *cdns); 16 16 int xhci_cdns3_suspend_quirk(struct usb_hcd *hcd); 17 17 18 18 #else 19 19 20 - static inline int cdns3_host_init(struct cdns3 *cdns) 20 + static inline int cdns_host_init(struct cdns *cdns) 21 21 { 22 22 return -ENXIO; 23 23 } 24 24 25 - static inline void cdns3_host_exit(struct cdns3 *cdns) { } 25 + static inline void cdns_host_exit(struct cdns *cdns) { } 26 26 static inline int xhci_cdns3_suspend_quirk(struct usb_hcd *hcd) 27 27 { 28 28 return 0;
+11 -11
drivers/usb/cdns3/host.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 /* 3 - * Cadence USBSS DRD Driver - host side 3 + * Cadence USBSS and USBSSP DRD Driver - host side 4 4 * 5 5 * Copyright (C) 2018-2019 Cadence Design Systems. 6 6 * Copyright (C) 2017-2018 NXP ··· 28 28 .suspend_quirk = xhci_cdns3_suspend_quirk, 29 29 }; 30 30 31 - static int __cdns3_host_init(struct cdns3 *cdns) 31 + static int __cdns_host_init(struct cdns *cdns) 32 32 { 33 33 struct platform_device *xhci; 34 34 int ret; 35 35 struct usb_hcd *hcd; 36 36 37 - cdns3_drd_host_on(cdns); 37 + cdns_drd_host_on(cdns); 38 38 39 39 xhci = platform_device_alloc("xhci-hcd", PLATFORM_DEVID_AUTO); 40 40 if (!xhci) { ··· 46 46 cdns->host_dev = xhci; 47 47 48 48 ret = platform_device_add_resources(xhci, cdns->xhci_res, 49 - CDNS3_XHCI_RESOURCES_NUM); 49 + CDNS_XHCI_RESOURCES_NUM); 50 50 if (ret) { 51 51 dev_err(cdns->dev, "couldn't add resources to xHCI device\n"); 52 52 goto err1; ··· 113 113 return 0; 114 114 } 115 115 116 - static void cdns3_host_exit(struct cdns3 *cdns) 116 + static void cdns_host_exit(struct cdns *cdns) 117 117 { 118 118 kfree(cdns->xhci_plat_data); 119 119 platform_device_unregister(cdns->host_dev); 120 120 cdns->host_dev = NULL; 121 - cdns3_drd_host_off(cdns); 121 + cdns_drd_host_off(cdns); 122 122 } 123 123 124 - int cdns3_host_init(struct cdns3 *cdns) 124 + int cdns_host_init(struct cdns *cdns) 125 125 { 126 - struct cdns3_role_driver *rdrv; 126 + struct cdns_role_driver *rdrv; 127 127 128 128 rdrv = devm_kzalloc(cdns->dev, sizeof(*rdrv), GFP_KERNEL); 129 129 if (!rdrv) 130 130 return -ENOMEM; 131 131 132 - rdrv->start = __cdns3_host_init; 133 - rdrv->stop = cdns3_host_exit; 134 - rdrv->state = CDNS3_ROLE_STATE_INACTIVE; 132 + rdrv->start = __cdns_host_init; 133 + rdrv->stop = cdns_host_exit; 134 + rdrv->state = CDNS_ROLE_STATE_INACTIVE; 135 135 rdrv->name = "host"; 136 136 137 137 cdns->roles[USB_ROLE_HOST] = rdrv;