|
15 | 15 |
|
16 | 16 | #include "xhci.h"
|
17 | 17 | #include "xhci-trace.h"
|
| 18 | +#include "xhci-pci.h" |
18 | 19 |
|
19 | 20 | #define SSIC_PORT_NUM 2
|
20 | 21 | #define SSIC_PORT_CFG2 0x880c
|
@@ -87,7 +88,16 @@ static int xhci_pci_reinit(struct xhci_hcd *xhci, struct pci_dev *pdev)
|
87 | 88 |
|
88 | 89 | static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
|
89 | 90 | {
|
90 |
| - struct pci_dev *pdev = to_pci_dev(dev); |
| 91 | + struct pci_dev *pdev = to_pci_dev(dev); |
| 92 | + struct xhci_driver_data *driver_data; |
| 93 | + const struct pci_device_id *id; |
| 94 | + |
| 95 | + id = pci_match_id(pdev->driver->id_table, pdev); |
| 96 | + |
| 97 | + if (id && id->driver_data) { |
| 98 | + driver_data = (struct xhci_driver_data *)id->driver_data; |
| 99 | + xhci->quirks |= driver_data->quirks; |
| 100 | + } |
91 | 101 |
|
92 | 102 | /* Look for vendor-specific quirks */
|
93 | 103 | if (pdev->vendor == PCI_VENDOR_ID_FRESCO_LOGIC &&
|
@@ -328,6 +338,14 @@ static int xhci_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
|
328 | 338 | int retval;
|
329 | 339 | struct xhci_hcd *xhci;
|
330 | 340 | struct usb_hcd *hcd;
|
| 341 | + struct xhci_driver_data *driver_data; |
| 342 | + |
| 343 | + driver_data = (struct xhci_driver_data *)id->driver_data; |
| 344 | + if (driver_data && driver_data->quirks & XHCI_RENESAS_FW_QUIRK) { |
| 345 | + retval = renesas_xhci_check_request_fw(dev, id); |
| 346 | + if (retval) |
| 347 | + return retval; |
| 348 | + } |
331 | 349 |
|
332 | 350 | /* Prevent runtime suspending between USB-2 and USB-3 initialization */
|
333 | 351 | pm_runtime_get_noresume(&dev->dev);
|
@@ -389,6 +407,9 @@ static void xhci_pci_remove(struct pci_dev *dev)
|
389 | 407 | struct xhci_hcd *xhci;
|
390 | 408 |
|
391 | 409 | xhci = hcd_to_xhci(pci_get_drvdata(dev));
|
| 410 | + if (xhci->quirks & XHCI_RENESAS_FW_QUIRK) |
| 411 | + renesas_xhci_pci_exit(dev); |
| 412 | + |
392 | 413 | xhci->xhc_state |= XHCI_STATE_REMOVING;
|
393 | 414 |
|
394 | 415 | if (xhci->quirks & XHCI_DEFAULT_PM_RUNTIME_ALLOW)
|
@@ -540,14 +561,26 @@ static void xhci_pci_shutdown(struct usb_hcd *hcd)
|
540 | 561 |
|
541 | 562 | /*-------------------------------------------------------------------------*/
|
542 | 563 |
|
| 564 | +static const struct xhci_driver_data reneses_data = { |
| 565 | + .quirks = XHCI_RENESAS_FW_QUIRK, |
| 566 | + .firmware = "renesas_usb_fw.mem", |
| 567 | +}; |
| 568 | + |
543 | 569 | /* PCI driver selection metadata; PCI hotplugging uses this */
|
544 | 570 | static const struct pci_device_id pci_ids[] = {
|
| 571 | + { PCI_DEVICE(0x1912, 0x0014), |
| 572 | + .driver_data = (unsigned long)&reneses_data, |
| 573 | + }, |
| 574 | + { PCI_DEVICE(0x1912, 0x0015), |
| 575 | + .driver_data = (unsigned long)&reneses_data, |
| 576 | + }, |
545 | 577 | /* handle any USB 3.0 xHCI controller */
|
546 | 578 | { PCI_DEVICE_CLASS(PCI_CLASS_SERIAL_USB_XHCI, ~0),
|
547 | 579 | },
|
548 | 580 | { /* end: all zeroes */ }
|
549 | 581 | };
|
550 | 582 | MODULE_DEVICE_TABLE(pci, pci_ids);
|
| 583 | +MODULE_FIRMWARE("renesas_usb_fw.mem"); |
551 | 584 |
|
552 | 585 | /* pci driver glue; this is a "new style" PCI driver module */
|
553 | 586 | static struct pci_driver xhci_pci_driver = {
|
|
0 commit comments