Received: by 10.223.185.116 with SMTP id b49csp1014791wrg; Fri, 16 Feb 2018 10:50:41 -0800 (PST) X-Google-Smtp-Source: AH8x227uSlgpl7pjdDkF3+3LTNEm5YonZklHba4ZlZKn3+d/cbYiW9oD1l7AH+WLGIZ7CmXr90IE X-Received: by 2002:a17:902:968d:: with SMTP id n13-v6mr6843046plp.33.1518807041408; Fri, 16 Feb 2018 10:50:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518807041; cv=none; d=google.com; s=arc-20160816; b=OrtNq/IGG3VokiCKesQg0yXW5AwUvlou3gmEYpTTPwFvTc6wUXf+jDcZ0DMvyyiEzn k35XQulC4PbicFfNNNtDQbyeyaPeOO9eGxRYf/MFwt5G60z65DQ5eTE4Yh/ISrCKrYj9 OLc8I9aTY+oUHUkIqNMlSWLmIEA1ZF2mjV6lz7wTuO7doTqVhYky1/OISh2BSd3AqidH S5TUnsZTTSRMV6AzAYL2i5AjBFcfrLPv4cZ8SS/kI9IxJ5ZGZfZ+6iAkYOShvXB1+Uj5 Vq/PxOXHGNicJDZ7jhxVbUUIea9Q2cAufu8hSWYew+PTytEV2cL00GCLNky2LtYWw+yc EsrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=It1e4FWcCe/OIgb6XFYeNk090c9BPkOqQ18Ng4Ap9+E=; b=UUCAUjUyaG1qkoFbU3Sf2JjENQC02Hm0seiRlSTtmsVbM4vXyR/GlA0SxSD2QVi+D8 Inxm9GzRKk+UxNKM7M/wC1+eCNbPX77SeiRSvrEdja+otsFQ4SRzcpdckCvN6ZRMOFEA yVnSVywtISeRzez5mdPRHhubYaNqYL9WTbfuDY2m8nqs47o2xDxlL+z6NR5+vZwkU/Yc 0Qh2c6dSm4gOUNMp2I+tI4tblGmxxjdIeFIsQgLpw1QSfASIt0WUZ7/eBp467fT6O66Q P3RBEs+y5/zt3G0xXdlZCrAGGrkK38mjNMK+GW9cFdmNMGZhnLPd1/fbPi9sbntNfBwE Al/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=BjIk7hDK; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f15-v6si4840333plr.336.2018.02.16.10.50.27; Fri, 16 Feb 2018 10:50:41 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=BjIk7hDK; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754285AbeBPI1C (ORCPT + 99 others); Fri, 16 Feb 2018 03:27:02 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:51731 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754112AbeBPI05 (ORCPT ); Fri, 16 Feb 2018 03:26:57 -0500 Received: by mail-wm0-f68.google.com with SMTP id r71so1676441wmd.1; Fri, 16 Feb 2018 00:26:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=It1e4FWcCe/OIgb6XFYeNk090c9BPkOqQ18Ng4Ap9+E=; b=BjIk7hDKVUHmyXvECsuuuWYiWfhaeP7CsPhUEOso4s3Az+9pMAcnVM966x00KsScan VZPgIxifUwo2VqOUUm4ahA87lSgCrwomxQDpjmJp/ocV2MwmDJUjYuUjbCqFn3+c1nzB WB89eeBIpv5/KdfadmH5E+vUL6UEPaBnt3GVO6cVmu80Ofub2WyYRZAU2aaeCjEJJb3g CsMnSDDV3sPZMlCwf9KD1PPj0LaWKFIuX0EeaHuqj5+CurXHjvExhEkKZdqf1lQZalNn YsuMSWeceQML4XdiAbuKN6tQIaz62MYiGWZjRN2/LjCpUYwNKvxtA33eMwitfJh4XOC8 yvWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=It1e4FWcCe/OIgb6XFYeNk090c9BPkOqQ18Ng4Ap9+E=; b=WQsSyFXflEBKEUdEYAGYN1Q9hMv8GBRRH3sOBoGEO0GLBH9Gxf1yF238PFYyj9lcog SO3T0TQlduyIIzLewXT67v1OsWpwhQuuABweCwvx7G7Bgu6Swk8vKM3joHslUZoqMrGA okRk0daARZsaDIe21k1s+Q45hK7o5EXAlTlQLNYpMTFIT5eWZt8G5FWKK65jSBNX2pkZ ZbsQZ9K68EkSfH7UO/H5IiLhZ+Ez3pQ8HNnZ/Sgt/6zoZCwHejpuSD8vWZxUmz8ss5tj lbEyfXzubh2iBCV/5IsoLFo5R/51Ot04Y6ssJ3ZPceP3UcZRBX8+25bAtEtMxwXNU5Mc aw4A== X-Gm-Message-State: APf1xPDJSKq5i6UTYLkmEayKROKSBUoVG21oDPHZd3gnJKv+YRdlc8iX 2i977lP6sLwXztWVY9Ws+jyrP9Ua X-Received: by 10.28.173.20 with SMTP id w20mr3886239wme.15.1518769615693; Fri, 16 Feb 2018 00:26:55 -0800 (PST) Received: from satan.home ([2a00:23c4:f78b:2a00:9520:864c:b8f0:f03d]) by smtp.gmail.com with ESMTPSA id s126sm7846552wmd.43.2018.02.16.00.26.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Feb 2018 00:26:54 -0800 (PST) From: Carlo Caione To: linux@endlessm.com, hdegoede@redhat.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 Subject: [PATCH v2 0/3] power: supply: Fix AXP288 fallback when not needed Date: Fri, 16 Feb 2018 08:26:13 +0000 Message-Id: <20180216082616.25084-1-carlo@caione.org> X-Mailer: git-send-email 2.14.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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(-) -- 2.14.1