From patchwork Wed Feb 28 10:35:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 879041 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=bootlin.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zrsV66rYnz9s3W for ; Wed, 28 Feb 2018 21:38:22 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752475AbeB1Kgu (ORCPT ); Wed, 28 Feb 2018 05:36:50 -0500 Received: from mail.bootlin.com ([62.4.15.54]:55868 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752109AbeB1Kgs (ORCPT ); Wed, 28 Feb 2018 05:36:48 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id 5A6412092C; Wed, 28 Feb 2018 11:36:45 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost.localdomain (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.bootlin.com (Postfix) with ESMTPSA id CE4F920794; Wed, 28 Feb 2018 11:36:34 +0100 (CET) From: Quentin Schulz To: sre@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, wens@csie.org Cc: maxime.ripard@bootlin.com, lee.jones@linaro.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, linux-sunxi@googlegroups.com, Quentin Schulz Subject: [PATCH v5 0/6] add support for AXP813 ADC and battery power supply Date: Wed, 28 Feb 2018 11:35:55 +0100 Message-Id: X-Mailer: git-send-email 2.14.1 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The AXP813 PMIC is relatively close to the already supported AXP20X and AXP22X. It provides three different power outputs: battery, AC and USB, and measures a few different things: temperature, power supply status, current current and voltage supplied, maximum current limit, battery capacity, min and max voltage limits. One of its two GPIOs can be used as an ADC. There are a few differences with AXP20X/AXP22X PMICs though: - a different constant charge current formula, - battery temperature, GPIO0 and battery voltages are the only voltages measurable, - all data are stored on 12 bits (AXP20X/AXP22X had one type of data that was stored on 13 bits), - different scales and offsets, - a different ADC rate formula and register, This patch series adds support for the PMIC's ADC and battery power supply in the existing drivers. Make the axp20x MFD automatically probe the ADC driver, add the battery power supply node in axp81x node and enable it for the TBS A711 since it has a soldered battery. I suggest patches: - 1,2,6 go through Lee's tree, - 3,4,5 go through Sebastian's tree, v5: - added static in front of the axp_data struct in the battery driver to make sparse happy, - removed merged patches, v4: - shortened one commit title as a workaround to Chen-Yu note, - added const to data structures as proposed by Chen-Yu, - added last patch for making sparse happy, on a proposal from Jonathan, - removed already applied patches (IIO ones), v3: - merging dt-bindings patches for axp_adc as requested by Rob, - re-ordered constant in IIO driver as requested by Julian, - compatibles for ADC are now named after the first design that introduced the IP instead of wildcard as requested by Maxime, - renamed DT node name from axp-adc to adc as requested by Rob, - replaced enumeration of supported PMICs in battery power supply DT bindings documentation by "supported devices" as requested by Jonathan, - added a new patch for removing "axp-" from axp81x's pinctrl DT node, v2: - introduce data structure instead of ID for variant specific code in battery driver, - add DT binding for ADC driver, - make mfd probe the ADC driver via DT as well so that its IIO channels can be consumed by other drivers via DT mapping, Thanks, Quentin Quentin Schulz (6): mfd: axp20x: make AXP209/22x cells probe their ADC via DT mfd: axp20x: probe axp20x_adc driver for AXP813 power: supply: axp20x_battery: use data struct for variant specific code dt-bindings: power: supply: axp20x: add AXP813 battery DT binding power: supply: axp20x_battery: add support for AXP813 mfd: axp20x: add battery power supply cell for AXP813 Documentation/devicetree/bindings/power/supply/axp20x_battery.txt | 8 ++-- drivers/mfd/axp20x.c | 13 +++++-- drivers/power/supply/axp20x_battery.c | 134 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------- 3 files changed, 119 insertions(+), 36 deletions(-) base-commit: 827ad482fda17d0de5df5116fda827cd3671e62e