From patchwork Wed Sep 12 07:29:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "(Exiting) Baolin Wang" X-Patchwork-Id: 10596899 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BE8D813BF for ; Wed, 12 Sep 2018 07:30:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E212297F0 for ; Wed, 12 Sep 2018 07:30:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9C24A2991E; Wed, 12 Sep 2018 07:30:19 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,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 22414297F0 for ; Wed, 12 Sep 2018 07:30:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726860AbeILMdb (ORCPT ); Wed, 12 Sep 2018 08:33:31 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:43851 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726412AbeILMdb (ORCPT ); Wed, 12 Sep 2018 08:33:31 -0400 Received: by mail-pg1-f195.google.com with SMTP id v66-v6so577407pgb.10 for ; Wed, 12 Sep 2018 00:30:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=6a2K6qNZh60/sMvmbkck3n+/n6PkI3DTt1DQ2AdQSgY=; b=iPorLxcRqqnX36iDXtgmi7Uj/mY/V2wO58pdn9ts1QvQjMjGFgApquqSnqj+VJxtXQ Ye20L4jSxMA9Z1wn9zN9gg+jkhKpwm0tgxSy2TOM7On5c19ONvuisZCXAnqL9De6jocQ Bqafvr3uG2rdZTUHJ31dTxvL7XysfnQUMSH0o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=6a2K6qNZh60/sMvmbkck3n+/n6PkI3DTt1DQ2AdQSgY=; b=qHn8VTDtXosYH0GACu+/WiQcB5JNVUtSkWkyubISy1Xk7Ur7h/bfpBNTjZUG/tmA8f 3mqHrejtXBH98x2SvdZqN0b8hr8vOr6Xy0nJhR89ROm9f49ldHJ7+YyJFXr7c3gkioao iWTKVca6iR8519AH8Vqrnxk0zyXNbB0adfVIjDLdk9QTdz12ntu6/p9rJs8N5bZ1w5aR VlPLx1NWbymmjl8akZF1cSEL2+75iomeLNKGXsU6YgOOrqSkaU4dLSCaswgY/3U9U/wb 3EPL67OtdfsB5aoS529HW3BRglp+QtbL/Y8tS1pxyAXwqcMLUXEVeKB29xtExgXwH25F b2tg== X-Gm-Message-State: APzg51Bi6I338rEk3MXdFnbHbiq+v53Q7dlIG/ilLpa9+jSz0ODjbHuI R6oxH6vJ79YFuPtTSqxPob0WIQ== X-Google-Smtp-Source: ANB0VdYV65omcXOQ4TkODt9E9TqncsJkdfLEIppG0ahYeQgjrOIHvmXyv0ysdW5LPiMmyviTy39igA== X-Received: by 2002:a63:221b:: with SMTP id i27-v6mr629030pgi.212.1536737417455; Wed, 12 Sep 2018 00:30:17 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id y69-v6sm624695pfd.36.2018.09.12.00.30.14 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Sep 2018 00:30:16 -0700 (PDT) From: Baolin Wang To: sre@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, yuanjiang.yu@unisoc.com, baolin.wang@linaro.org, broonie@kernel.org Subject: [PATCH 1/2] dt-bindings: power: Add Spreadtrum SC27XX fuel gauge unit documentation Date: Wed, 12 Sep 2018 15:29:38 +0800 Message-Id: <1b3f165e2a806dd3d4b7712160ee3bda72f7d675.1536736399.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds the binding documentation for Spreadtrum SC27XX series PMICs fuel gauge unit device, which is used to calculate the battery capacity. Signed-off-by: Baolin Wang --- .../devicetree/bindings/power/supply/sc27xx-fg.txt | 55 ++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 Documentation/devicetree/bindings/power/supply/sc27xx-fg.txt diff --git a/Documentation/devicetree/bindings/power/supply/sc27xx-fg.txt b/Documentation/devicetree/bindings/power/supply/sc27xx-fg.txt new file mode 100644 index 0000000..7447bae --- /dev/null +++ b/Documentation/devicetree/bindings/power/supply/sc27xx-fg.txt @@ -0,0 +1,55 @@ +Spreadtrum SC27XX PMICs Fuel Gauge Unit Power Supply Bindings + +Required properties: +- compatible: Should be one of the following: + "sprd,sc2720-fgu", + "sprd,sc2721-fgu", + "sprd,sc2723-fgu", + "sprd,sc2730-fgu", + "sprd,sc2731-fgu". +- reg: The address offset of fuel gauge unit. +- bat-detect-gpio: GPIO for battery detection. +- io-channels: Specify the IIO ADC channel to get temperature. +- io-channel-names: Should be "bat-temp". +- sprd,inner-resist: Specify the the battery inner resistance (mOhm). +- sprd,ocv-cap-table: Provide the battery capacity percent with corresponding + open circuit voltage (ocv) of the battery, which is used to look up current + battery capacity according to current baterry ocv values. +- monitored-battery: Phandle of battery characteristics devicetree node. + The fuel gauge uses the following battery properties: +- charge-full-design-microamp-hours: battery design capacity. +- constant-charge-voltage-max-microvolt: maximum constant input voltage. + See Documentation/devicetree/bindings/power/supply/battery.txt + +Example: + + bat: battery { + compatible = "simple-battery"; + charge-full-design-microamp-hours = <1900000>; + constant-charge-voltage-max-microvolt = <4350000>; + ...... + }; + + sc2731_pmic: pmic@0 { + compatible = "sprd,sc2731"; + reg = <0>; + spi-max-frequency = <26000000>; + interrupts = ; + interrupt-controller; + #interrupt-cells = <2>; + #address-cells = <1>; + #size-cells = <0>; + + fgu@a00 { + compatible = "sprd,sc2731-fgu"; + reg = <0xa00>; + bat-detect-gpio = <&pmic_eic 9 GPIO_ACTIVE_HIGH>; + io-channels = <&pmic_adc 5>; + io-channel-names = "bat-temp"; + sprd,inner-resist = <250>; + sprd,ocv-cap-table = <4185 100>, <4113 95>, <4066 90>, <4022 85>, <3983 80>, <3949 75>, <3917 70>, + <3889 65>, <3864 60>, <3835 55>, <3805 50>, <3787 45>, <3777 40>, <3773 35>, <3770 30>, + <3765 25>, <3752 20>, <3724 15>, <3680 10>, <3605 5>, <3400 0>; + monitored-battery = <&bat>; + }; + };