Re: [RFC PATCH v2 1/6] usb: Register usb port's acpi power resources

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

On 13-11-2012 12:00, Lan Tianyu wrote:

This patch is to register usb port's acpi power resources. Create
link between usb port device and its acpi power resource.

Signed-off-by: Lan Tianyu <tianyu.lan@xxxxxxxxx>
[...]

diff --git a/drivers/usb/core/usb-acpi.c b/drivers/usb/core/usb-acpi.c
index cef4252..c58ebc0 100644
--- a/drivers/usb/core/usb-acpi.c
+++ b/drivers/usb/core/usb-acpi.c
@@ -216,6 +216,28 @@ static struct acpi_bus_type usb_acpi_bus = {
  	.find_device = usb_acpi_find_device,
  };

+int usb_acpi_register_power_resources(struct device *dev)
+{
+	acpi_handle port_handle = DEVICE_ACPI_HANDLE(dev);
+
+	if (!port_handle)
+		return -ENODEV;
+
+	if (acpi_power_resource_register_device(dev, port_handle) < 0)
+		return -ENODEV;
+	return 0;
+}
+
+void usb_acpi_unregister_power_resources(struct device *dev)
+{
+	acpi_handle port_handle = DEVICE_ACPI_HANDLE(dev);
+
+	if (!port_handle)
+		return;
+
+	acpi_power_resource_register_device(dev, port_handle);

I thinbk you have been askied already, but shouldn't it be acpi_power_resource_unregister_device()?

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux