ACPI: TAD: Use DC wakeup only if AC wakeup is supported
Rafael J. Wysocki
maintainerPATCH 1/1 ACPI: TAD: Use DC wakeup only if AC wakeup is supported
From: Rafael J. Wysocki <[email protected]>
According to Section 9.17.2 of ACPI 6.6 [1], setting ACPI_TAD_DC_WAKE in the capabilities without setting ACPI_TAD_AC_WAKE is invalid, so don't support wakeup if that's the case.
Moreover, it is sufficient to check ACPI_TAD_AC_WAKE alone to determine if wakeup is supported at all, so use this observation to simplify one check.
Signed-off-by Rafael J. Wysocki <[email protected]>
---
This change is on top of linux-next.
--- drivers/acpi/acpi_tad.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/acpi/acpi_tad.c +4 -1
@@ -706,6 +706,9 @@ static int acpi_tad_probe(struct platfor caps &= ~(ACPI_TAD_AC_WAKE |ACPI_TAD_DC_WAKE ); } +if (!(caps &ACPI_TAD_AC_WAKE )) + caps &= ~ACPI_TAD_DC_WAKE ; + dd =devm_kzalloc (dev,sizeof (*dd),GFP_KERNEL );if (!dd)return -ENOMEM ;
@@ -719,7 +722,7 @@ static int acpi_tad_probe(struct platfor* runtime suspend. Everything else should be taken care of by the ACPI * PM domain callbacks. */ -if (ACPI_TAD_AC_WAKE |ACPI_TAD_DC_WAKE ) { +if (ACPI_TAD_AC_WAKE ) {device_init_wakeup (dev, true);dev_pm_set_driver_flags (dev,DPM_FLAG_SMART_SUSPEND |DPM_FLAG_MAY_SKIP_RESUME );