ACPI: Change acpi_device_always_present() into acpi_device_override_status()

Currently, acpi_bus_get_status() calls acpi_device_always_present() to
allow platform quirks to override the _STA return to report that a
device is present (status = ACPI_STA_DEFAULT) independent of the _STA
return.

In some cases it might also be useful to have the opposite functionality
and have a platform quirk which marks a device as not present (status = 0)
to work around ACPI table bugs.

Change acpi_device_always_present() into a more generic
acpi_device_override_status() function to allow this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
Hans de Goede
2021-11-22 18:05:31 +01:00
committed by Rafael J. Wysocki
parent d431dfb764
commit 1a68b346a2
3 changed files with 42 additions and 31 deletions

View File

@@ -613,9 +613,10 @@ int acpi_enable_wakeup_device_power(struct acpi_device *dev, int state);
int acpi_disable_wakeup_device_power(struct acpi_device *dev);
#ifdef CONFIG_X86
bool acpi_device_always_present(struct acpi_device *adev);
bool acpi_device_override_status(struct acpi_device *adev, unsigned long long *status);
#else
static inline bool acpi_device_always_present(struct acpi_device *adev)
static inline bool acpi_device_override_status(struct acpi_device *adev,
unsigned long long *status)
{
return false;
}