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

xhci-ext-caps.c: Add property to disable Intel SW switch

In platforms like Cherrytrail, 'SW switch enable' bit
should not be enabled for role switch. This patch
adds a property to Intel USB Role Switch platform driver
to denote that SW switch should be disabled in
Cherrytrail devices.

Signed-off-by: Saranya Gopal <saranya.gopal@intel.com>
Signed-off-by: Balaji Manoharan <m.balaji@intel.com>
Suggested-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/1567079760-24822-1-git-send-email-saranya.gopal@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Saranya Gopal and committed by
Greg Kroah-Hartman
6ed151f2 a0a46556

+18
+18
drivers/usb/host/xhci-ext-caps.c
··· 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 { ··· 30 21 struct usb_hcd *hcd = xhci_to_hcd(xhci); 31 22 struct device *dev = hcd->self.controller; 32 23 struct platform_device *pdev; 24 + struct pci_dev *pci = to_pci_dev(dev); 33 25 struct resource res = { 0, }; 34 26 int ret; 35 27 ··· 51 41 dev_err(dev, "couldn't add resources to intel_xhci_usb_sw pdev\n"); 52 42 platform_device_put(pdev); 53 43 return ret; 44 + } 45 + 46 + if (pci->device == PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI) { 47 + ret = platform_device_add_properties(pdev, role_switch_props); 48 + if (ret) { 49 + dev_err(dev, "failed to register device properties\n"); 50 + return ret; 51 + } 54 52 } 55 53 56 54 pdev->dev.parent = dev;