linux/include/acpi
Hans de Goede 57a1832222 ACPI / x86: Introduce an acpi_quirk_skip_acpi_ac_and_battery() helper
Some x86 ACPI boards have broken AC and battery ACPI devices in their ACPI
tables. This is often tied to these devices using certain PMICs where the
factory OS image seems to be using native charger and fuel-gauge drivers
instead.

So far both the AC and battery drivers have almost identical checks for
these PMICs including both of them having a DMI based mechanism to force
usage of the ACPI AC and battery drivers on some boards even though one
of these PMICs is present, with the same 2 boards listed in both driver's
DMI tables for this.

The only difference is that the AC driver checks for 2 PMICs and the
battery driver only for one. This has grown this way because the other
(Whiskey Cove) PMIC is only used on a few boards (3 known boards) and
although some of these do have non working ACPI battery devices, their
_STA method always returns 0, but that really should not be relied on.

This patch factors out the shared checks into a new
acpi_quirk_skip_acpi_ac_and_battery() helper and moves the AC and
battery drivers over to this new helper.

Note the DMI table is shared with acpi_quirk_skip_i2c_client_enumeration()
and acpi_quirk_skip_serdev_enumeration(), because boards needing DMI quirks
for either of these typically also have broken AC and battery ACPI devices.

The ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY quirk is not set yet on boards
already in this DMI table, to avoid introducing any functional changes
in this refactoring patch.

Besided sharing the code between the AC and battery drivers this
refactoring also moves this quirk handling to under #ifdef CONFIG_X86,
removing this x86 specific code from non x86 ACPI builds.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2022-01-04 15:40:48 +01:00
..
platform ACPI: Drop ACPI_USE_BUILTIN_STDARG ifdef from acgcc.h 2021-11-05 15:51:13 +01:00
acbuffer.h ACPICA: Add _PLD panel positions 2021-06-07 14:04:43 +02:00
acconfig.h ACPICA: Add support for PlatformRtMechanism OperationRegion handler 2021-06-07 14:04:43 +02:00
acexcep.h ACPICA: Updated all copyrights to 2021 2021-01-22 15:51:53 +01:00
acnames.h ACPICA: Add method name "_DIS" For use with aslmethod.c 2021-08-16 16:47:02 +02:00
acoutput.h ACPICA: Macros should not use a trailing semicolon 2021-08-16 16:47:02 +02:00
acpi.h ACPICA: Updated all copyrights to 2021 2021-01-22 15:51:53 +01:00
acpi_bus.h ACPI / x86: Introduce an acpi_quirk_skip_acpi_ac_and_battery() helper 2022-01-04 15:40:48 +01:00
acpi_drivers.h Merge branches 'acpi-pci' and 'acpi-processor' 2021-04-26 17:03:05 +02:00
acpi_io.h Revert "ACPI: Add memory semantics to acpi_os_map_memory()" 2021-09-23 20:39:36 +02:00
acpi_lpat.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
acpi_numa.h ACPI: NUMA: fix typo in a comment 2021-06-07 16:41:10 +02:00
acpiosxf.h ACPICA: Updated all copyrights to 2021 2021-01-22 15:51:53 +01:00
acpixf.h ACPICA: Update version to 20210930 2021-10-05 15:53:37 +02:00
acrestyp.h ACPICA: ACPI 6.4: add CSI2Bus resource template 2021-04-07 19:09:01 +02:00
actbl.h ACPICA: Updated all copyrights to 2021 2021-01-22 15:51:53 +01:00
actbl1.h ACPICA: Headers: Add new DBG2 Serial Port Subtypes 2021-08-16 16:47:02 +02:00
actbl2.h Merge branches 'acpi-x86', 'acpi-resources', 'acpi-scan' and 'acpi-misc' 2021-11-02 18:04:33 +01:00
actbl3.h ACPICA: ACPI 6.4 SRAT: add Generic Port Affinity type 2021-10-05 15:53:37 +02:00
actypes.h ACPICA: Add support for Windows 2020 _OSI string 2021-10-05 15:53:37 +02:00
acuuid.h ACPICA: ACPI 6.4: add USB4 capabilities UUID 2021-04-07 19:09:00 +02:00
apei.h ACPI: APEI: mark apei_hest_parse() static 2021-10-27 20:34:47 +02:00
battery.h ACPI: battery: include linux/power_supply.h 2020-09-25 18:31:19 +02:00
button.h ACPI: button: move HIDs to acpi/button.h 2020-02-13 23:36:23 +01:00
cppc_acpi.h ACPI: CPPC: Introduce cppc_get_nominal_perf() 2021-09-07 21:15:16 +02:00
ghes.h ACPI / APEI: Add a notifier chain for unknown (vendor) CPER records 2020-09-16 10:30:42 +01:00
hed.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 428 2019-06-05 17:37:16 +02:00
nfit.h acpi, nfit: Add function to look up nvdimm device and provide SMBIOS handle 2018-03-14 12:43:50 +01:00
pcc.h mailbox: pcc: Use PCC mailbox channel pointer instead of standard 2021-10-29 22:46:38 -05:00
pdc_intel.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
processor.h x86: ACPI: fix CPU hotplug deadlock 2020-04-04 16:28:24 +02:00
reboot.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
video.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00