From patchwork Mon Nov 5 07:39:06 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: 150143 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2286212ljp; Sun, 4 Nov 2018 23:39:32 -0800 (PST) X-Google-Smtp-Source: AJdET5eyyVuw9/H7JcSLa2sBIufVs7kL0OupMzSftQmhjp4R6Q3IPP4HBoQHazt36GtmIV63eGm0 X-Received: by 2002:a63:d757:: with SMTP id w23-v6mr18924821pgi.415.1541403572031; Sun, 04 Nov 2018 23:39:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541403572; cv=none; d=google.com; s=arc-20160816; b=qjt/q14W2Ntnri/Mjbbd4VHUXK55712EuqPPNjifuHwJ8xqQHEL62mSVDAWs62hRC0 gDxw6zerAM/pCyyA6QnjoVzTfZQ+9vwGyaUPnE5yvA8spnEItNZwfTR2kHULK7y/M/3j tnkkN41oBvoAx94ER2yu/9H63Ow4HXghSuyPccmTYbMpPvA1tWavYD4P8UHGqsFg+5vI QVAc5HTTvXvWSmpUwkmM3+D4tPs4NyzqnzBWVqrrjPlQtT/06/SmNPqcjMkCSu0d2tvU 3rFBbWt6VvYslLDay2GCnCyG+Rrh0tdnYmelG7wMO4nl2mIWDEWCui/OVZnqmsa73kf2 5kPQ== 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; bh=7+KsQAiIFIxoDmz5EswpwgvRJ2yLAWBeV0S1HKrrYFA=; b=lZVnK2VsCb5gCDikbXmpX5gi/zCY53zSqqb5fHqB/VOww6+/pyKTnMSDZQzCejIa9b 6Y1EEKmE98efW+tyNjSXYV0CZHiJ9M9rjYjZtRcDvC9nd0SKxuGe2b6udVlmXLMH26sK NXfqfvwBy6gnWGa+39fHCMvXC73TwYzqhX4v6wMq5lIRFRLrFBTfxlUPvD9Ph0Fx8Jf6 jQ5aitjFqOxdcMF5P+r/vlIpEGikwPtEGQd/DrTcuIfeH3OQ28L9PNTpvYlFKMDeWo0K u4w9tgzhdU0j568zBNwqiVj+XWsMphh5gCXDk9nQZjBbePyyamSw3nmSjrXwksNlGkF+ i3rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SvqvZyO7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v23-v6si41726315pgh.581.2018.11.04.23.39.31; Sun, 04 Nov 2018 23:39:32 -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; dkim=pass header.i=@linaro.org header.s=google header.b=SvqvZyO7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729000AbeKEQ5u (ORCPT + 6 others); Mon, 5 Nov 2018 11:57:50 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:37016 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727054AbeKEQ5u (ORCPT ); Mon, 5 Nov 2018 11:57:50 -0500 Received: by mail-pl1-f193.google.com with SMTP id p6-v6so4021923pll.4 for ; Sun, 04 Nov 2018 23:39:30 -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; bh=7+KsQAiIFIxoDmz5EswpwgvRJ2yLAWBeV0S1HKrrYFA=; b=SvqvZyO7B1AF6b9TeCGIzx2VB+ajoHGmW9zoX5HpAJPVxATmn2JLN2W/tYH7qKzExA vlR6CQwotJLPR/SZcr0LHzSnak9H58TGTlqJl5lZKZPeoYQV0Q8oEDurYTfUKN5FniIH aXMKcrtluvcvI5cNn1GeNKK/uyqLipvhpsk0A= 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=7+KsQAiIFIxoDmz5EswpwgvRJ2yLAWBeV0S1HKrrYFA=; b=ekvkmj2438yaVuen587MR636B7IuyLgg09DmrcGswp7it8UIKGYCusYP+LYGpO30aJ hE3nOxgbFmvLS8G7gryyP+piO3xzX6h+F+2/7pHRkFRen23H1hCOiMi8Hr0AHLMNgyol VDPq5Ev7IWz0VqnFGIcLScHXLU9PZf9P97iMDxMvcMPFFxfZgzIPX2f5hI7czNDtCcbF kXn0QMTVZNhfltKIbvL0oqDOtv7yuIbjoF/sPe5pXqrDhUprYftIEWt//TnAJRWjftyH 8cJb6lrirHA5TJbsPY0xk3wrePZJdTSuf8LNSjKMBM2BghFy0wkkyeHlGMbEtCPcrV4D 8VgA== X-Gm-Message-State: AGRZ1gIKOCsRm2RCJif5gbWJdVZdBXoo/fGkdTHtmLxYCSWnT9WnfDpP lJzL9urzvH89c0DExHSwFZdWtA== X-Received: by 2002:a17:902:544:: with SMTP id 62-v6mr20148145plf.73.1541403570279; Sun, 04 Nov 2018 23:39:30 -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.25 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 04 Nov 2018 23:39:29 -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 1/6] dt-bindings: power: Introduce one property to present the battery internal resistance Date: Mon, 5 Nov 2018 15:39:06 +0800 Message-Id: <5640f29e0b7f46f9ee77d80745f8c93eda355c34.1541393063.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The internal resistance of a battery is not a constant in its life cycle, this varies over the age of the battery or temperature and so on. But we just want use one constant battery internal resistance to estimate the battery capacity. Thus this patch introduces one property to present the battery factory internal resistance for battery information. Signed-off-by: Baolin Wang Reviewed-by: Linus Walleij --- Changes from v6: - None. Changes from v5: - None. Changes from v4: - None. Changes from v3: - Split binding into one separate patch. - Add LinusW reviewed tag. Changes from v2: - Rename the property. - Improve the commit message. Changes from v1: - New patch in v2. --- .../devicetree/bindings/power/supply/battery.txt | 2 ++ 1 file changed, 2 insertions(+) -- 1.7.9.5 diff --git a/Documentation/devicetree/bindings/power/supply/battery.txt b/Documentation/devicetree/bindings/power/supply/battery.txt index f4d3b4a..938d027 100644 --- a/Documentation/devicetree/bindings/power/supply/battery.txt +++ b/Documentation/devicetree/bindings/power/supply/battery.txt @@ -22,6 +22,7 @@ Optional Properties: - charge-term-current-microamp: current for charge termination phase - constant-charge-current-max-microamp: maximum constant input current - constant-charge-voltage-max-microvolt: maximum constant input voltage + - factory-internal-resistance-micro-ohms: battery factory internal resistance Battery properties are named, where possible, for the corresponding elements in enum power_supply_property, defined in @@ -42,6 +43,7 @@ Example: charge-term-current-microamp = <128000>; constant-charge-current-max-microamp = <900000>; constant-charge-voltage-max-microvolt = <4200000>; + factory-internal-resistance-micro-ohms = <250000>; }; charger: charger@11 { 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: 150147 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2286390ljp; Sun, 4 Nov 2018 23:39:48 -0800 (PST) X-Google-Smtp-Source: AJdET5e0QLi9JYIoGcUgg8RtUxg2+PLmPXjOAVkQdWZ97mHAJerEaq7ATqPGv+l5HGIm/s8Gl9yG X-Received: by 2002:a62:8f8c:: with SMTP id n134-v6mr21288263pfd.258.1541403588601; Sun, 04 Nov 2018 23:39:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541403588; cv=none; d=google.com; s=arc-20160816; b=1CdKPJoje+V52ciiQCWcdiRP0H6Ur0nCKHSXgfN01YcJe557Da/CwcWF5ZnwmZkMOr pQBC17KURFA4slDL2oax7Pjq8ssA+sAxCGo3j2xB1essSb3Kaq9MgPhdaBZFKVmHgbbK 8IO+iZXTVZo+jlLeYcPIlhNbQkPSKyE704jQsN0wPYXzdOBSl7oNiZ3xjCKZDnw8qHtr Q5PSHg1WYWw7GJQkB/3zGtDKtINbMtomOMl6Lk1UJ8z6OkRzZBy5FA/+J4ljjoXIMRhG PDM88R5JnvYmSXkYDtQMMQ7o3WkbnIwJyipnIx2S/+C61vknxojY6gcqt8mg46/xd4KB T6Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=zoHDBRr8V506wAGV46dRQ9HlyZ72D4GORBRguuUgxtM=; b=gU761vSCs8OkhEm6f2WXjnKr/cq73us+neA8AR+/2Z/X23ULnh1Q6oRx8+k5sZGe4M rviAu/VmSvkyTirQ0e5XWbifYa/y63AcJx+L6aRUrkofwUMR1j2x58LZrzfMvRasF7kx lXW8CFIHHMGN4OFSQYX5g5YmEjDqT+UDJBPCOLS4grIMqeAOzxi8HRI6Q8kFtFr0wSI0 xRcR2UGeu5nYpehyp9gJLBi6+MGC6kkmes+Hvcjka7EKAEKY7xlbAf+qXtfqRorlSZ3Q in1nSEUDoyC/G1kIH+AK+cMAb23ngHzUf6mdHMgB2qFs3n55I5W19q9TNFU5ehcD4rPB Zjsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Hp9mCV8B; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c18-v6si33946699plz.116.2018.11.04.23.39.48; Sun, 04 Nov 2018 23:39:48 -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; dkim=pass header.i=@linaro.org header.s=google header.b=Hp9mCV8B; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729458AbeKEQ6H (ORCPT + 6 others); Mon, 5 Nov 2018 11:58:07 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:36467 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729439AbeKEQ6G (ORCPT ); Mon, 5 Nov 2018 11:58:06 -0500 Received: by mail-pl1-f194.google.com with SMTP id w24-v6so4031595plq.3 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=oxp2x7wE8nR2+8dR7XPWmxquYFz1nvjGiMPmW77jO15n1XLKNzl5GloJb4cPoi7YNG SzBxlxEESRBqVJBOcplVxoa/6733XoyTzcuTmFLtihGF+MrD3kmJy6RPwNKlEc/0AZQ8 tTPF0f0OshxHq1qRPMr6W20BWqzRE6EKq5le1pgyWxtkUmCdPttlxdTpJw4gjAym39Vw SwjuRT/LRPNLkMiqiNBwSyOeuLiV5Hiv1Bcpg1vcuuuBACnGSbzeapuQUhWfmTCmeE2N fVIEMEWunQXvjSGVVEnL8vAqo1PO9dIhe/5BUKbdBTJpYyQLcMwLewpofQS062UojtkW C4ZA== X-Gm-Message-State: AGRZ1gKKa93xzWh851ui8pQAYh9DLmConLtyvR1NGgjfp6/m2J31fqor /RIOt/FOf3kfzy4fGEpG1QNnWQ== 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: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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 -- 1.7.9.5 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>; + }; + };