Received: by 10.223.185.116 with SMTP id b49csp1015210wrg; Fri, 16 Feb 2018 10:51:12 -0800 (PST) X-Google-Smtp-Source: AH8x227KAxbpERlemZJ8xPgbyyC0qHeSllN0msIbwK9LnN0G4HlMpplIyVY7VaRbo86NnIj4zWOt X-Received: by 2002:a17:902:28c3:: with SMTP id f61-v6mr6806125plb.264.1518807072199; Fri, 16 Feb 2018 10:51:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518807072; cv=none; d=google.com; s=arc-20160816; b=x+K3kvecxWYWeZOiLx4Aft1I0fGoycdtyEgGpZmwOh6lbKDAQeO34FRuFDGUbTSHLx +WGL214vzH44iPzeg/jkzIVXQigao4ut9Bv1t1Tx80/pex0lswZKx2Gvbd7yM8y/slnI 75UyZUPTcD80lqWd/GgI8Rcc0/NHJkSz0cngeCr2T09G6rpD7HDQMINVKhTseFsMN04q FC3OP5XTRXtUr9JSsHuW1QrpJuD0I1t9NxcqDL3IUGvWSxE/icvqDSehdLDa1Ehe29Bc NGH3HxqLAp6SjOIB3ZEZoRnx8A0DFZUzZIn/klwFId10blF0JYChFnv1ym1vhnFvH2jS Uc+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=fJ7o/4U/zEqUmcJmTNrgYvBwjpJY5xCI3qrTlgNc1l8=; b=aRlVkMA8+88ckWYWMza4TpoRbvUC2/YJfSpSNQJu2SjDfqVmlgj9y/L+H3ggunWa0P gVNfddyiwtfz1iXF18JUVYZi2ymBUUrAogUVgOASv1GanuvK00svf9Xnm5YIRUMAjDtT PzDN1glhnFD/ySEEBhrhipe5k6DV+h9inQG3V4m6O6VObUhPyfMkVRRV5rcXdl/s1pxa ZKgrUMgGe6spaeRLSOI5PId97AAzDEsnfaskey00I7uBhQtJitIRaHBCfxZLp83L2TII 0cvbrwG3V4MZ7X6UrYLTLUTwnIFod9xRmmo3ncPVdvPmMW9C61g2kkrtt5w9zOOFK5ZI 8RBA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f184si2817368pgc.696.2018.02.16.10.50.57; Fri, 16 Feb 2018 10:51:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754814AbeBPIlL (ORCPT + 99 others); Fri, 16 Feb 2018 03:41:11 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:38402 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754775AbeBPIlI (ORCPT ); Fri, 16 Feb 2018 03:41:08 -0500 Received: by mail-wm0-f67.google.com with SMTP id 141so1679135wme.3 for ; Fri, 16 Feb 2018 00:41:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=fJ7o/4U/zEqUmcJmTNrgYvBwjpJY5xCI3qrTlgNc1l8=; b=jsgbozheRRROeyi8N5sjaJW3ukyNwtrvsJr4P4QgaOLdW7JTUgvEYAx7mSWoExJaVt 0Vv7EatgLgHAYuMYOhTfrKMMhNDZvjO1dmuY6qdCna20A90AzA/ig1NKe9xhaa4h0587 OPaEUwkj6xvaMcMOO/7+vJlW983nMnuhxaOW+Vak6YgsBXrlbox+q0VaSbjS04LdOqcO 7l4m0wJTUXESMw7krxRPxrHaAP+PUO32USkgwpRpUEoFRU8WvWliCSqqn7stsh8/XwVu KciDlPpCR7DLTCFo0JZQLEoVSmPwrFgt2NWglLNREbXybHbweqb17Yo1r6vafsUpfrC+ BAlw== X-Gm-Message-State: APf1xPCZMHmgy0NgEmKIE83NHF6/OS7f0xIcXMoxx1o2VkfSRmiXq+kb Mplu29AF5LfJKR96G6Z8E2fTqQ== X-Received: by 10.80.138.66 with SMTP id i60mr7140251edi.40.1518770467544; Fri, 16 Feb 2018 00:41:07 -0800 (PST) Received: from shalem.localdomain (546A5441.cm-12-3b.dynamic.ziggo.nl. [84.106.84.65]) by smtp.gmail.com with ESMTPSA id k11sm12395122eda.22.2018.02.16.00.41.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Feb 2018 00:41:06 -0800 (PST) Subject: Re: [PATCH v2 0/3] power: supply: Fix AXP288 fallback when not needed To: Carlo Caione , linux@endlessm.com, rjw@rjwysocki.net, lenb@kernel.org, sre@kernel.org, wens@csie.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: Carlo Caione References: <20180216082616.25084-1-carlo@caione.org> From: Hans de Goede Message-ID: Date: Fri, 16 Feb 2018 09:41:05 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180216082616.25084-1-carlo@caione.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 16-02-18 09:26, Carlo Caione wrote: > From: Carlo Caione > > With commits af3ec837 and dccfae6d a blacklist was introduced to avoid > using the ACPI drivers for AC and battery when a native PMIC driver was > already present. While this is in general a good idea (because of broken > DSDT or proprietary and undocumented ACPI opregions for the ACPI > AC/battery devices) we have come across at least one CherryTrail laptop > (ECS EF20EA) shipping the AXP288 together with a separate FG controller > (a MAX17047) instead of the one embedded in the AXP288. Thank you for the new version. This looks good and surprisingly clean / small given amounts of warts surrounding this all. The entire series is: Reviewed-by: Hans de Goede Regards, Hans > > This is the interesting analisys done by Hans de Goede (thank you): > > Looking at the _BIX method of the BATC/PNP0C0A device, we see it referencing > FG10: > > Method (_BIX, 0, NotSerialized) // _BIX: Battery Information Extend > { > If (AVBL == One) > { > BUF2 = FG10 /* \_SB_.PCI0.I2C1.FG10 */ > > And FG10 is defined as: > > Field (DVFG, BufferAcc, NoLock, Preserve) > { > Connection (SMFG), > Offset (0x10), > AccessAs (BufferAcc, AttribBytes (0x02)), > FG10, 8 > } > > With SMFG being defined as: > > Name (SMFG, ResourceTemplate () > { > I2cSerialBusV2 (0x0036, ControllerInitiated, 0x000186A0, > AddressingMode7Bit, "\\_SB.PCI0.I2C1", > 0x00, ResourceConsumer, , Exclusive, > ) > }) > > Looking for I2C1 address 0x0036 we find: > > Device (ANFG) > { > Name (_HID, "MAX17047" /* Fuel Gauge Controller */) // _HID: Hardwa > Name (_CID, "MAX17047" /* Fuel Gauge Controller */) // _CID: Compat > Name (_DDN, "Fuel Gauge Controller") // _DDN: DOS Device Name > Name (RBUF, ResourceTemplate () > { > I2cSerialBusV2 (0x0036, ControllerInitiated, 0x00061A80, > AddressingMode7Bit, "\\_SB.PCI0.I2C1", > 0x00, ResourceConsumer, , Exclusive, > ) > GpioInt (Level, ActiveLow, ExclusiveAndWake, PullNone, 0x0000, > "\\_SB.GPO3", 0x00, ResourceConsumer, , > ) > { // Pin list > 0x0001 > } > }) > > Where as the AXP288 PMIC is I2C7 address 0x034: > > Device (PMI1) > { > Name (_ADR, Zero) // _ADR: Address > Name (_HID, "INT33F4" /* XPOWER PMIC Controller */) // _HID: Ha > Name (_CID, "INT33F4" /* XPOWER PMIC Controller */) // _CID: Co > Name (_DDN, "XPOWER PMIC Controller") // _DDN: DOS Device Name > Name (_HRV, 0x03) // _HRV: Hardware Revision > Name (_UID, One) // _UID: Unique ID > > Method (_CRS, 0, NotSerialized) // _CRS: Current Resource Setti > { > Name (SBUF, ResourceTemplate () > { > I2cSerialBusV2 (0x0034, ControllerInitiated, 0x000F4240, > AddressingMode7Bit, "\\_SB.PCI0.I2C7", > 0x00, ResourceConsumer, , Exclusive, > ) > > So basically this laptopt is using a separate FG chip instead of the one > embedded in the AXP288. > > To have this correctly working we need basically to avoid the fallback on the > AXP288 driver enabling again the ACPI AC/battery drivers and at the same time > avoiding that the AXP288 FG driver is probed at all. > > I'm still not fully convinced that having two different quirks (one to disable > the blacklist and another to disable the AXP288 FG probing) is the right way to > fix this. So any comment is welcome. > > Changelog: > > v2: > - Split [PATCH 2/2] in two parts > - Rework subject prefixes > > Carlo Caione (3): > ACPI: AC/battery: Add quirk to avoid using PMIC > ACPI: AC/battery: Add quirks for ECS EF20EA > power: supply: axp288_fuel_gauge: Do not register FG on ECS EF20EA > > drivers/acpi/ac.c | 33 ++++++++++++++++++++++++-------- > drivers/acpi/battery.c | 33 ++++++++++++++++++++++++-------- > drivers/power/supply/axp288_fuel_gauge.c | 6 ++++++ > 3 files changed, 56 insertions(+), 16 deletions(-) >