From patchwork Thu Mar 16 16:16:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 9628873 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5AF3860244 for ; Thu, 16 Mar 2017 16:17:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C215281C3 for ; Thu, 16 Mar 2017 16:17:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 40A3528334; Thu, 16 Mar 2017 16:17:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E8F5E281C3 for ; Thu, 16 Mar 2017 16:17:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753327AbdCPQRM (ORCPT ); Thu, 16 Mar 2017 12:17:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:11776 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752849AbdCPQRK (ORCPT ); Thu, 16 Mar 2017 12:17:10 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0B9C4804F7; Thu, 16 Mar 2017 16:16:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0B9C4804F7 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=hdegoede@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 0B9C4804F7 Received: from shalem.localdomain.com (ovpn-117-127.ams2.redhat.com [10.36.117.127]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7B94862926; Thu, 16 Mar 2017 16:16:11 +0000 (UTC) From: Hans de Goede To: "Rafael J . Wysocki" , Len Brown , Sebastian Reichel , Chen-Yu Tsai Cc: Hans de Goede , Andy Shevchenko , linux-acpi@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH 4/4] power: supply: axp288_charger: Unregister duplicate ACPI ac supply Date: Thu, 16 Mar 2017 17:16:01 +0100 Message-Id: <20170316161601.32267-5-hdegoede@redhat.com> In-Reply-To: <20170316161601.32267-1-hdegoede@redhat.com> References: <20170316161601.32267-1-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 16 Mar 2017 16:16:13 +0000 (UTC) Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/power/supply/Kconfig | 2 ++ drivers/power/supply/axp288_charger.c | 2 ++ 2 files changed, 4 insertions(+) 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 #include #include +#include #include #include #include @@ -876,6 +877,7 @@ static int axp288_charger_probe(struct platform_device *pdev) } } + acpi_ac_unregister(); return 0; }