Commit bafcaf6d authored by Lan Tianyu's avatar Lan Tianyu Committed by Sarah Sharp

usb/acpi: binding xhci root hub usb port with ACPI

This patch is to bind xhci root hub usb port with its acpi node.
The port num in the acpi table matches with the sequence in the xhci
extended capabilities table. So call usb_hcd_find_raw_port_number() to
transfer hub port num into raw port number which associates with
the sequence in the xhci extended capabilities table before binding.
Signed-off-by: default avatarLan Tianyu <tianyu.lan@intel.com>
Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
parent 3f5eb141
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/acpi.h> #include <linux/acpi.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/usb/hcd.h>
#include <acpi/acpi_bus.h> #include <acpi/acpi_bus.h>
#include "usb.h" #include "usb.h"
...@@ -188,8 +189,13 @@ static int usb_acpi_find_device(struct device *dev, acpi_handle *handle) ...@@ -188,8 +189,13 @@ static int usb_acpi_find_device(struct device *dev, acpi_handle *handle)
* connected to. * connected to.
*/ */
if (!udev->parent) { if (!udev->parent) {
*handle = acpi_get_child(DEVICE_ACPI_HANDLE(&udev->dev), struct usb_hcd *hcd = bus_to_hcd(udev->bus);
int raw_port_num;
raw_port_num = usb_hcd_find_raw_port_number(hcd,
port_num); port_num);
*handle = acpi_get_child(DEVICE_ACPI_HANDLE(&udev->dev),
raw_port_num);
if (!*handle) if (!*handle)
return -ENODEV; return -ENODEV;
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment