From patchwork Mon Nov 5 07:39:10 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: 10667517 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 E40D21709 for ; Mon, 5 Nov 2018 07:39:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D0C21295A8 for ; Mon, 5 Nov 2018 07:39:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C5137295D8; Mon, 5 Nov 2018 07:39:49 +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 B1558295A8 for ; Mon, 5 Nov 2018 07:39:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729431AbeKEQ6H (ORCPT ); Mon, 5 Nov 2018 11:58:07 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:39647 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729458AbeKEQ6G (ORCPT ); Mon, 5 Nov 2018 11:58:06 -0500 Received: by mail-pl1-f195.google.com with SMTP id b5-v6so4025439pla.6 for ; Sun, 04 Nov 2018 23:39:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=zoHDBRr8V506wAGV46dRQ9HlyZ72D4GORBRguuUgxtM=; b=Hp9mCV8BbKr/kLyPOcRuzKH0z9NDFLbdbzZEce8X6Uxq++2C0iKDigfBkG/dVQHMxp 8tuIt3Hw2deM6SUaR4UDdObhe8RxZ+htC80820oV4XFKO4SkKZEPgcJxAqJ3lE4nVK26 tkzISHAaxiEVSv8QOly0WY8SigUqXLRtqFon8= 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:in-reply-to :references:in-reply-to:references; bh=zoHDBRr8V506wAGV46dRQ9HlyZ72D4GORBRguuUgxtM=; b=EUbJJi+qXlYSAdfAVXNMdj+Z1MQ8zMe4/0A8nJzQWONcsRq8vlCOxhL65j+Or0mP4d Y6lqdErVVosEUCkNH2eMM4kTdNgrpK/ykYGLDoz3mfSNO10/9VFQ6mcDeYzvFJh1IHV9 OFXXCdkZ2PEEJEDdP35xcmcH3hb2+oRNMHSTOalqTpPFNSy1meNAMApQ6X+eVu/P/7IX pN9njtXWLhXWZrb0NhZSU+6k6AICGRCXgWCOWnQUTEQAjyaoqwF5/V24BSa8jq77h4zJ 1/Rv4pujhaXbOxYls2gSzDSiFzxmNhMxltr0VLCHrYJaxyA8V8LYwx4Wg7RKiJJbSNsc Lg/g== X-Gm-Message-State: AGRZ1gLitkqA+W/cX0ycmu5AU5lss45DNkMOhl7pookdIL9FJ3Iyb1se bvANdW8GYljCuaMIsWqQR5TKEQ== X-Google-Smtp-Source: AJdET5fVowLwncj3oizzYSSxol09rgWoYtuCuRL6uhG2fv5f/9rGmDAvTN6ZzQkCmjbkr2XIKMa+/g== X-Received: by 2002:a17:902:2bc3:: with SMTP id l61-v6mr16102531plb.5.1541403586522; Sun, 04 Nov 2018 23:39:46 -0800 (PST) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id d5-v6sm27632040pfo.131.2018.11.04.23.39.42 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 04 Nov 2018 23:39:45 -0800 (PST) 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, ctatlor97@gmail.com, linus.walleij@linaro.org, quentin.schulz@bootlin.com Subject: [PATCH v7 5/6] dt-bindings: power: Add Spreadtrum SC27XX fuel gauge unit documentation Date: Mon, 5 Nov 2018 15:39:10 +0800 Message-Id: <9730ea8efe4132af75aaabbac54eea15d46a6b71.1541393063.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <5640f29e0b7f46f9ee77d80745f8c93eda355c34.1541393063.git.baolin.wang@linaro.org> References: <5640f29e0b7f46f9ee77d80745f8c93eda355c34.1541393063.git.baolin.wang@linaro.org> In-Reply-To: <5640f29e0b7f46f9ee77d80745f8c93eda355c34.1541393063.git.baolin.wang@linaro.org> References: <5640f29e0b7f46f9ee77d80745f8c93eda355c34.1541393063.git.baolin.wang@linaro.org> 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 Reviewed-by: Linus Walleij Reviewed-by: Rob Herring --- Changes from v6: - None. Changes from v5: - None. Changes from v4: - None. Changes from v3: - Add reviewed tag from Rob. Changes from v2: - Add reviewed tag from Linus. Changes from v1: - Renamed GPIO property. - Use standand battery properties instead of 'sprd,inner-resist' and 'sprd,ocv-cap-table'. - Remove battery node's description. --- .../devicetree/bindings/power/supply/sc27xx-fg.txt | 52 ++++++++++++++++++++ 1 file changed, 52 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..98a2400 --- /dev/null +++ b/Documentation/devicetree/bindings/power/supply/sc27xx-fg.txt @@ -0,0 +1,52 @@ +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. +- battery-detect-gpios: GPIO for battery detection. +- io-channels: Specify the IIO ADC channel to get temperature. +- io-channel-names: Should be "bat-temp". +- monitored-battery: Phandle of battery characteristics devicetree node. + 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>; + ocv-capacity-celsius = <20>; + ocv-capacity-table-0 = <4185000 100>, <4113000 95>, <4066000 90>, + <4022000 85>, <3983000 80>, <3949000 75>, + <3917000 70>, <3889000 65>, <3864000 60>, + <3835000 55>, <3805000 50>, <3787000 45>, + <3777000 40>, <3773000 35>, <3770000 30>, + <3765000 25>, <3752000 20>, <3724000 15>, + <3680000 10>, <3605000 5>, <3400000 0>; + ...... + }; + + 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>; + battery-detect-gpios = <&pmic_eic 9 GPIO_ACTIVE_HIGH>; + io-channels = <&pmic_adc 5>; + io-channel-names = "bat-temp"; + monitored-battery = <&bat>; + }; + };