From patchwork Mon Dec 4 14:12:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 120544 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4486745qgn; Mon, 4 Dec 2017 06:15:05 -0800 (PST) X-Google-Smtp-Source: AGs4zMZSpK6K+7w4QqOx3jomUSirFZlp6sqUJIDEab8dAMB8FTkUa0mZA1q4/9FR4YD0MVvn8y6S X-Received: by 10.84.212.1 with SMTP id d1mr14110517pli.91.1512396905349; Mon, 04 Dec 2017 06:15:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512396905; cv=none; d=google.com; s=arc-20160816; b=xc96oobkHlbM49WQWH/c2SxqyPWt5JRyXPFkwEnvp1qx/rOQL0cU7aApYvHOGoDChd WBpuXjtuleApscn3WzBoS5hIK2iadWa143fm441SUvBu7CSkGU66VJIQOuCU3cf5SgZZ t1xMyULJYwvigA6v61GAWQzC1YsUd9je+lvuQ8kYQyKO4zuQ/7ozN9mH7AX1Ih7wj31R 1z84vS09lq+lVjsLdphZTn3fGpUHKbBoL6jl4mLrqYW9JKtCPvgVKuaZIioOBG/OJjyX vl4kJ/NM6zLEglw4r9nBLUby++EJAP1fIviKNHqVetpIz7NAROQJfkfrsaEcTA2lslSe J/dA== 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 :arc-authentication-results; bh=ON22m+I4boveUw669Kkf3PgZE5ts+G96FF2SQglY9W8=; b=cEVI6WhtrwulI8gTdOguaaTVSx03ZH1udZHM2FinHlROBD9hDdC9MqLzPFtJ1ZEbjn FAG9ylRMsufdgrDMILUDgS3oUDrZAtBV6DTVY4421vFadNXf4LHB9Um5ZQ0ushtwDNGm bfo6S209ehvEfrnkZP00cAnudSUoNkIO2LFbzDzH7eCK2IRpm7mopAU0j3Lv/+WOtgFx JjTCmIvb8ywsojp+C7V5bKgZLqJaVPhkMwslgUOHmqeVJZtiy9NlzXJmB7S/Tr7Y2umG 4LFHS/XuE0bROjeemJciHdmaKp3CiZ6Y8oU1HNW1LcLSZUJcEQxZwfHsp1dbKQFexHT/ hRKg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-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 h9si9420955pgp.365.2017.12.04.06.15.05; Mon, 04 Dec 2017 06:15:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-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 devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754132AbdLDOPD (ORCPT + 6 others); Mon, 4 Dec 2017 09:15:03 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:54077 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752688AbdLDOPC (ORCPT ); Mon, 4 Dec 2017 09:15:02 -0500 Received: by mail.free-electrons.com (Postfix, from userid 110) id 42C4B209DC; Mon, 4 Dec 2017 15:15:00 +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.free-electrons.com (Postfix) with ESMTPSA id CBD532073A; Mon, 4 Dec 2017 15:14:49 +0100 (CET) From: Quentin Schulz To: sre@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, wens@csie.org, linux@armlinux.org.uk, maxime.ripard@free-electrons.com, jic23@kernel.org, lee.jones@linaro.org Cc: knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-iio@vger.kernel.org, icenowy@aosc.io, linux-sunxi@googlegroups.com, thomas.petazzoni@free-electrons.com, Quentin Schulz Subject: [PATCH 0/8] add support for AXP813 ADC and battery power supply Date: Mon, 4 Dec 2017 15:12:46 +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. Q: The BananaPi M3 has two solder balls for battery, should the battery power supply node be enabled for this board as well? Thanks, Quentin Quentin Schulz (8): iio: adc: axp20x_adc: put ADC rate setting in a per-variant function iio: adc: axp20x_adc: add support for AXP813 ADC mfd: axp20x: probe axp20x_adc driver for AXP813 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 ARM: dtsi: axp81x: add battery power supply subnode ARM: dtsi: sun8i: a711: enable battery power supply subnode Documentation/devicetree/bindings/power/supply/axp20x_battery.txt | 8 ++-- arch/arm/boot/dts/axp81x.dtsi | 5 +++- arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 4 ++- drivers/iio/adc/axp20x_adc.c | 139 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- drivers/mfd/axp20x.c | 7 +++- drivers/power/supply/axp20x_battery.c | 44 ++++++++++++++++++++++- include/linux/mfd/axp20x.h | 2 +- 7 files changed, 196 insertions(+), 13 deletions(-) base-commit: 7cc61a0a562c7005d2a34f97e94cf26689a2f57c -- git-series 0.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: Rob Herring