.. | .. |
---|
6 | 6 | */ |
---|
7 | 7 | |
---|
8 | 8 | #include <linux/platform_device.h> |
---|
| 9 | +#include <linux/property.h> |
---|
| 10 | +#include <linux/pci.h> |
---|
9 | 11 | #include "xhci.h" |
---|
10 | 12 | |
---|
11 | 13 | #define USB_SW_DRV_NAME "intel_xhci_usb_sw" |
---|
12 | 14 | #define USB_SW_RESOURCE_SIZE 0x400 |
---|
| 15 | + |
---|
| 16 | +#define PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI 0x22b5 |
---|
| 17 | + |
---|
| 18 | +static const struct property_entry role_switch_props[] = { |
---|
| 19 | + PROPERTY_ENTRY_BOOL("sw_switch_disable"), |
---|
| 20 | + {}, |
---|
| 21 | +}; |
---|
13 | 22 | |
---|
14 | 23 | static void xhci_intel_unregister_pdev(void *arg) |
---|
15 | 24 | { |
---|
.. | .. |
---|
21 | 30 | struct usb_hcd *hcd = xhci_to_hcd(xhci); |
---|
22 | 31 | struct device *dev = hcd->self.controller; |
---|
23 | 32 | struct platform_device *pdev; |
---|
| 33 | + struct pci_dev *pci = to_pci_dev(dev); |
---|
24 | 34 | struct resource res = { 0, }; |
---|
25 | 35 | int ret; |
---|
26 | 36 | |
---|
.. | .. |
---|
43 | 53 | return ret; |
---|
44 | 54 | } |
---|
45 | 55 | |
---|
| 56 | + if (pci->device == PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI) { |
---|
| 57 | + ret = platform_device_add_properties(pdev, role_switch_props); |
---|
| 58 | + if (ret) { |
---|
| 59 | + dev_err(dev, "failed to register device properties\n"); |
---|
| 60 | + platform_device_put(pdev); |
---|
| 61 | + return ret; |
---|
| 62 | + } |
---|
| 63 | + } |
---|
| 64 | + |
---|
46 | 65 | pdev->dev.parent = dev; |
---|
47 | 66 | |
---|
48 | 67 | ret = platform_device_add(pdev); |
---|