media: atomisp: Prepare sensor support for ACPI PM
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sun, 14 Jun 2020 07:02:01 +0000 (09:02 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sat, 18 Jul 2020 05:08:52 +0000 (07:08 +0200)
commitd6697288d8c4b4174b77f29d302bd5f69354659b
tree0797e35f4934adc7234bb4bc5271962d60f83e27
parent6391c63e61a76dfe4020432368cc2a7aa1273b41
media: atomisp: Prepare sensor support for ACPI PM

Add support code for this driver to use ACPI power management.

Yet, at least with known devices, this won't work without
further changes.

The rationale is that the ACPI handling code checks for the _PR? tables
in order to know what is required to switch the device from power state
D0 (_PR0) up to D3COLD (_PR3).

The adev->flags.power_manageable is set to true if the device has a _PR0
table, which can be checked by calling acpi_device_power_manageable(adev).

However, this only says that the device can be set to power off mode.

At least on the DSDT tables we've seen so far, there's no _PR3 nor _PS3
(which would have a somewhat similar effect).

So, using ACPI for power management won't work, except if adding
an ACPI override logic somewhere.

Tested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c