forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/usb/host/xhci-ext-caps.c
....@@ -6,10 +6,19 @@
66 */
77
88 #include <linux/platform_device.h>
9
+#include <linux/property.h>
10
+#include <linux/pci.h>
911 #include "xhci.h"
1012
1113 #define USB_SW_DRV_NAME "intel_xhci_usb_sw"
1214 #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
+};
1322
1423 static void xhci_intel_unregister_pdev(void *arg)
1524 {
....@@ -21,6 +30,7 @@
2130 struct usb_hcd *hcd = xhci_to_hcd(xhci);
2231 struct device *dev = hcd->self.controller;
2332 struct platform_device *pdev;
33
+ struct pci_dev *pci = to_pci_dev(dev);
2434 struct resource res = { 0, };
2535 int ret;
2636
....@@ -43,6 +53,15 @@
4353 return ret;
4454 }
4555
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
+
4665 pdev->dev.parent = dev;
4766
4867 ret = platform_device_add(pdev);