mbox series

[0/2] power: supply: axp288_*: Use acpi_quirk_skip_acpi_ac_and_battery()

Message ID 20220224222805.1689234-1-hdegoede@redhat.com
Headers show
Series power: supply: axp288_*: Use acpi_quirk_skip_acpi_ac_and_battery() | expand

Message

Hans de Goede Feb. 24, 2022, 10:28 p.m. UTC
Hi All,

Normally the native AXP288 fg/charger drivers are preferred but one some
devices the ACPI drivers should be used instead.

The ACPI AC and battery drivers used to both have their own detection if
a PMIC on which native drivers should be preffered was present as well as
their own list of exceptions for devices like the ECS EF20EA, which has
an AXP288 PMIC but uses a separate fuel-gauge.

And the axp288_fuel_guage driver also has a dmi_system_id table entry
for the ECS EF20EA to avoid loading on this board. Where as for
the axp288_charger code it was decided that it was ok to have both
a /sys/class/power_supply/ADP1 from ACPI as well as a /axp288_charger .

So that is 3 separate "ECS EF20EA" dmi_system_id table entries in
3 different drivers (which should really be 4). In 5.17-rc1 a patch
adding a new acpi_quirk_skip_acpi_ac_and_battery() helper was merged
to remove the code duplication for this from the ACPI AC and battery
drivers:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=57a18322227134e37b693ef8ef216ed7ce7ba7d6

This series makes the AXP288 charger and fuelgauge drivers also use
this helper. This allows removing the "ECS EF20EA" dmi_system_id table
entry from the fuel-gauge code and fixes the duplicate
/sys/class/power_supply/axp288_charger power_supply device on these
boards.

This also gives us a single place to add further exceptions if
necessary, rather then needing to do this in 4 different places.

Regards,

Hans


Hans de Goede (2):
  power: supply: axp288_charger: Use
    acpi_quirk_skip_acpi_ac_and_battery()
  power: supply: axp288_fuel_gauge: Use
    acpi_quirk_skip_acpi_ac_and_battery()

 drivers/power/supply/Kconfig             |  4 ++--
 drivers/power/supply/axp288_charger.c    |  7 +++++++
 drivers/power/supply/axp288_fuel_gauge.c | 14 ++++++++------
 3 files changed, 17 insertions(+), 8 deletions(-)