diff options
author | Lan Tianyu <tianyu.lan@intel.com> | 2012-08-17 02:44:09 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2012-09-21 13:30:29 -0400 |
commit | 1033f9041d526dd694e2b2e12744e47c41040c4d (patch) | |
tree | a953100e337dd4f464253f88a476f990c4209f26 /drivers/acpi/proc.c | |
parent | c46de2263f42fb4bbde411b9126f471e9343cb22 (diff) |
ACPI: Allow ACPI binding with USB-3.0 hub
A USB port's position and connectability can't be identified on some boards
via USB hub registers. ACPI _UPC and _PLD can help to resolve this issue
and so it is necessary to bind USB with ACPI. This patch is to allow ACPI
binding with USB-3.0 hub.
Current ACPI only can bind one struct-device to one ACPI device node.
This can not work with USB-3.0 hub, because the USB-3.0 hub has two logical
devices. Each works for USB-2.0 and USB-3.0 devices. In the Linux USB subsystem,
those two logical hubs are treated as two seperate devices that have two struct
devices. But in the ACPI DSDT, these two logical hubs share one ACPI device
node. So there is a requirement to bind multi struct-devices to one ACPI
device node. This patch is to resolve such problem.
Following is the ACPI device nodes' description under xhci hcd.
Device (XHC)
Device (RHUB)
Device (HSP1)
Device (HSP2)
Device (HSP3)
Device (HSP4)
Device (SSP1)
Device (SSP2)
Device (SSP3)
Device (SSP4)
Topology in the Linux
device XHC
USB-2.0 logical hub USB-3.0 logical hub
HSP1 SSP1
HSP2 SSP2
HSP3 SSP3
HSP4 SSP4
This patch also modifies the output of /proc/acpi/wakeup. One ACPI node
can be associated with multiple devices:
XHC S4 *enabled pci:0000:00:14.0
RHUB S0 disabled usb:usb1
disabled usb:usb2
Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
Acked-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/proc.c')
-rw-r--r-- | drivers/acpi/proc.c | 57 |
1 files changed, 37 insertions, 20 deletions
diff --git a/drivers/acpi/proc.c b/drivers/acpi/proc.c index 251c7b6273a9..27adb090bb30 100644 --- a/drivers/acpi/proc.c +++ b/drivers/acpi/proc.c | |||
@@ -302,26 +302,41 @@ acpi_system_wakeup_device_seq_show(struct seq_file *seq, void *offset) | |||
302 | list_for_each_safe(node, next, &acpi_wakeup_device_list) { | 302 | list_for_each_safe(node, next, &acpi_wakeup_device_list) { |
303 | struct acpi_device *dev = | 303 | struct acpi_device *dev = |
304 | container_of(node, struct acpi_device, wakeup_list); | 304 | container_of(node, struct acpi_device, wakeup_list); |
305 | struct device *ldev; | 305 | struct acpi_device_physical_node *entry; |
306 | 306 | ||
307 | if (!dev->wakeup.flags.valid) | 307 | if (!dev->wakeup.flags.valid) |
308 | continue; | 308 | continue; |
309 | 309 | ||
310 | ldev = acpi_get_physical_device(dev->handle); | 310 | seq_printf(seq, "%s\t S%d\t", |
311 | seq_printf(seq, "%s\t S%d\t%c%-8s ", | ||
312 | dev->pnp.bus_id, | 311 | dev->pnp.bus_id, |
313 | (u32) dev->wakeup.sleep_state, | 312 | (u32) dev->wakeup.sleep_state); |
314 | dev->wakeup.flags.run_wake ? '*' : ' ', | 313 | |
315 | (device_may_wakeup(&dev->dev) | 314 | if (!dev->physical_node_count) |
316 | || (ldev && device_may_wakeup(ldev))) ? | 315 | seq_printf(seq, "%c%-8s\n", |
317 | "enabled" : "disabled"); | 316 | dev->wakeup.flags.run_wake ? |
318 | if (ldev) | 317 | '*' : ' ', "disabled"); |
319 | seq_printf(seq, "%s:%s", | 318 | else { |
320 | ldev->bus ? ldev->bus->name : "no-bus", | 319 | struct device *ldev; |
321 | dev_name(ldev)); | 320 | list_for_each_entry(entry, &dev->physical_node_list, |
322 | seq_printf(seq, "\n"); | 321 | node) { |
323 | put_device(ldev); | 322 | ldev = get_device(entry->dev); |
324 | 323 | if (!ldev) | |
324 | continue; | ||
325 | |||
326 | if (&entry->node != | ||
327 | dev->physical_node_list.next) | ||
328 | seq_printf(seq, "\t\t"); | ||
329 | |||
330 | seq_printf(seq, "%c%-8s %s:%s\n", | ||
331 | dev->wakeup.flags.run_wake ? '*' : ' ', | ||
332 | (device_may_wakeup(&dev->dev) || | ||
333 | (ldev && device_may_wakeup(ldev))) ? | ||
334 | "enabled" : "disabled", | ||
335 | ldev->bus ? ldev->bus->name : | ||
336 | "no-bus", dev_name(ldev)); | ||
337 | put_device(ldev); | ||
338 | } | ||
339 | } | ||
325 | } | 340 | } |
326 | mutex_unlock(&acpi_device_lock); | 341 | mutex_unlock(&acpi_device_lock); |
327 | return 0; | 342 | return 0; |
@@ -329,12 +344,14 @@ acpi_system_wakeup_device_seq_show(struct seq_file *seq, void *offset) | |||
329 | 344 | ||
330 | static void physical_device_enable_wakeup(struct acpi_device *adev) | 345 | static void physical_device_enable_wakeup(struct acpi_device *adev) |
331 | { | 346 | { |
332 | struct device *dev = acpi_get_physical_device(adev->handle); | 347 | struct acpi_device_physical_node *entry; |
333 | 348 | ||
334 | if (dev && device_can_wakeup(dev)) { | 349 | list_for_each_entry(entry, |
335 | bool enable = !device_may_wakeup(dev); | 350 | &adev->physical_node_list, node) |
336 | device_set_wakeup_enable(dev, enable); | 351 | if (entry->dev && device_can_wakeup(entry->dev)) { |
337 | } | 352 | bool enable = !device_may_wakeup(entry->dev); |
353 | device_set_wakeup_enable(entry->dev, enable); | ||
354 | } | ||
338 | } | 355 | } |
339 | 356 | ||
340 | static ssize_t | 357 | static ssize_t |