diff mbox

[4/4] power: supply: axp288_charger: Unregister duplicate ACPI ac supply

Message ID 20170316161601.32267-5-hdegoede@redhat.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Hans de Goede March 16, 2017, 4:16 p.m. UTC
On some systems with an axp288 PMIC the dsdt exports a non functional (*)
ACPI AC device (ACPI0003 device), which results in a Mains power_supply
which reports itself as being always online.

This commit calls acpi_ac_unregister() after successfully registering the
axp288_charger power_supply to remove the broken Mains power_supply.

*) It depends on a vendor specific BMOP ACPI opregion we do not implement

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/power/supply/Kconfig          | 2 ++
 drivers/power/supply/axp288_charger.c | 2 ++
 2 files changed, 4 insertions(+)

Comments

Andy Shevchenko March 16, 2017, 4:34 p.m. UTC | #1
On Thu, 2017-03-16 at 17:16 +0100, Hans de Goede wrote:
> On some systems with an axp288 PMIC the dsdt exports a non functional
> (*)
> ACPI AC device (ACPI0003 device), which results in a Mains
> power_supply
> which reports itself as being always online.
> 
> This commit calls acpi_ac_unregister() after successfully registering
> the
> axp288_charger power_supply to remove the broken Mains power_supply.
> 
> *) It depends on a vendor specific BMOP ACPI opregion we do not
> implement


> +	# if ACPI_AC=m, this can't be 'y'
> +	depends on ACPI_AC || !ACPI_AC

Same comment as per patch 3
diff mbox

Patch

diff --git a/drivers/power/supply/Kconfig b/drivers/power/supply/Kconfig
index e504644..8ee03d7 100644
--- a/drivers/power/supply/Kconfig
+++ b/drivers/power/supply/Kconfig
@@ -235,6 +235,8 @@  config CHARGER_AXP20X
 config AXP288_CHARGER
 	tristate "X-Powers AXP288 Charger"
 	depends on MFD_AXP20X && EXTCON_AXP288
+	# if ACPI_AC=m, this can't be 'y'
+	depends on ACPI_AC || !ACPI_AC
 	help
 	  Say yes here to have support X-Power AXP288 power management IC (PMIC)
 	  integrated charger.
diff --git a/drivers/power/supply/axp288_charger.c b/drivers/power/supply/axp288_charger.c
index 6be2fe2..d3bf4b2 100644
--- a/drivers/power/supply/axp288_charger.c
+++ b/drivers/power/supply/axp288_charger.c
@@ -23,6 +23,7 @@ 
 #include <linux/usb/otg.h>
 #include <linux/notifier.h>
 #include <linux/power_supply.h>
+#include <linux/power/acpi.h>
 #include <linux/property.h>
 #include <linux/mfd/axp20x.h>
 #include <linux/extcon.h>
@@ -876,6 +877,7 @@  static int axp288_charger_probe(struct platform_device *pdev)
 		}
 	}
 
+	acpi_ac_unregister();
 	return 0;
 }