mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
libata-acpi: register/unregister device to/from power resource
Signed-off-by: Lin Ming <[email protected]> Signed-off-by: Jeff Garzik <[email protected]>
This commit is contained in:
parent
3bd46600a7
commit
a606dac368
2 changed files with 34 additions and 0 deletions
|
|
@ -1025,14 +1025,46 @@ static void ata_acpi_remove_pm_notifier(struct ata_device *dev)
|
|||
}
|
||||
}
|
||||
|
||||
static void ata_acpi_register_power_resource(struct ata_device *dev)
|
||||
{
|
||||
struct scsi_device *sdev = dev->sdev;
|
||||
acpi_handle handle;
|
||||
struct device *device;
|
||||
|
||||
handle = ata_dev_acpi_handle(dev);
|
||||
if (!handle)
|
||||
return;
|
||||
|
||||
device = &sdev->sdev_gendev;
|
||||
|
||||
acpi_power_resource_register_device(device, handle);
|
||||
}
|
||||
|
||||
static void ata_acpi_unregister_power_resource(struct ata_device *dev)
|
||||
{
|
||||
struct scsi_device *sdev = dev->sdev;
|
||||
acpi_handle handle;
|
||||
struct device *device;
|
||||
|
||||
handle = ata_dev_acpi_handle(dev);
|
||||
if (!handle)
|
||||
return;
|
||||
|
||||
device = &sdev->sdev_gendev;
|
||||
|
||||
acpi_power_resource_unregister_device(device, handle);
|
||||
}
|
||||
|
||||
void ata_acpi_bind(struct ata_device *dev)
|
||||
{
|
||||
ata_acpi_add_pm_notifier(dev);
|
||||
ata_acpi_register_power_resource(dev);
|
||||
}
|
||||
|
||||
void ata_acpi_unbind(struct ata_device *dev)
|
||||
{
|
||||
ata_acpi_remove_pm_notifier(dev);
|
||||
ata_acpi_unregister_power_resource(dev);
|
||||
}
|
||||
|
||||
static int compat_pci_ata(struct ata_port *ap)
|
||||
|
|
|
|||
Loading…
Reference in a new issue