From patchwork Wed Sep 26 02:59:13 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: 147525 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp180931lji; Tue, 25 Sep 2018 20:00:08 -0700 (PDT) X-Google-Smtp-Source: ACcGV62KZdKLRHk/7Uw3DlTa5u2/ei60sewRw/26aEe8y0m22zhqf7dmQgDB+2g4IYSooQXKQK4b X-Received: by 2002:a62:438f:: with SMTP id l15-v6mr4041445pfi.196.1537930808498; Tue, 25 Sep 2018 20:00:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537930808; cv=none; d=google.com; s=arc-20160816; b=zaFCQi5Bj2mq4apQjUCJKsyiNJZPb/L5dzGyRLmAzSXf/POsA52R9mD1KgshwSojwQ 0xWB+Fp2OX/LbSSLJc6Fd/0UVxyXxA7y68EAbm4ePO/nlPaWxjCuXHjuj+K0Xc0pRM+H lT6/sLjj+lNBg6tHmoGrrf90iFcxAdiVGcQSFNnGCjOlVaKufMkqmD/GihWDtnGXcghG tUyeXl0SM7xOT5/OPDEzRMZTXYfOo5WcpA+AmXjnXBgr7vk9oqDUmaSdJBdybdOLMmYR /aKX9CLNeXc+OmeepHi8TKky4kLmUdo1QzjC95tpstea1EpsvX9dXJ1VZZeHLi0pXXbr N6iw== 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=FM8t3RKYN0d8fne2p5QSPiCux/ygI5pU4yXE2CVZ35c=; b=kv8K9WyRdCKVvVaP0NSLEhtCd0FTbt9zmLPW94Bn8YDtKpzqYgcYgGijLSKqXtSrJ2 MQp6T7Iiv+Mk0D1+vFOvt3MEp635m/Vgu6Cb0G56SLf85Y/q6LRUqrEfp+wQG34XcpJ0 At2QizSozW/khBfSWxbMmWWcUmjrAQDSNHgtT+x0L5FX3c7f2Zeh4L8lPE464wUik/f9 CqBRH0BclkdcqKTD1I6iUQEtDkogWl5W2BWhjVrLv22jND+5JeiXmFeuEnV2W8yy80wg RY0xMXKBXXujnEPYcAMVPIAItTiBekAlS/K46nI571lEg15KPk4Ic6Lt0HUyhVzeZVt/ 2DcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AoMmcS17; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 e4-v6si1106315pfa.274.2018.09.25.20.00.07; Tue, 25 Sep 2018 20:00:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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=AoMmcS17; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 S1726880AbeIZJKq (ORCPT + 10 others); Wed, 26 Sep 2018 05:10:46 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:45258 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726242AbeIZJKp (ORCPT ); Wed, 26 Sep 2018 05:10:45 -0400 Received: by mail-pf1-f195.google.com with SMTP id a23-v6so4902672pfi.12 for ; Tue, 25 Sep 2018 20:00:05 -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:in-reply-to:references :in-reply-to:references; bh=FM8t3RKYN0d8fne2p5QSPiCux/ygI5pU4yXE2CVZ35c=; b=AoMmcS17knMqVy4/yoHWQjtYTLz0BAlWK9g1N7om2VXmK119J+SmvPNrecEUMloGts 1aD33GyqIfedb6WJz3pCvKY8ozM8PPHmkuSi6pLTfvugG37HIbcM8X+2hvOczitJT8/O CgTkJqg1a3uJpEtvmgKyTXzAGabEvWAVez6GA= 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=FM8t3RKYN0d8fne2p5QSPiCux/ygI5pU4yXE2CVZ35c=; b=MDPw0TjWFYAe3vOabAc0T/EsYhJRMPTCwmBgbnIRUeLPniQsXbwjmCDmZJ2bTnwqvs y16c6nJly5e2x7jlgRIIqFIqD1V7CLuWwBS49JqMfkobW5WY5S8Vzx9Ff8s+KlB0Na9V QuQKQjlDVTGi4FfMmTeT3NJ40f/PenEvefkKbiENLdxibjCwCrZeQj9I0SssV2v++Yj/ 8ggyt66/oi37gRqR/amGe/UC0UAEWIYeYkd2RpHFMlrJmbcf7qPOtG6srI1II51c3yO5 6TcZj9mwSiu4U2DqUKKl52bUoCHAoO7Pe7VTvHwcsx0ruGtmsp4msFzIILY5ip2gsZlx /k8w== X-Gm-Message-State: ABuFfojjtih+KaFqmXWjjrozBcbBKI+Sa7VLtvy1XaDz+h5FV7ByXhlR qJZswaVVvEBluYd78uGI+4hVRg== X-Received: by 2002:a62:71c4:: with SMTP id m187-v6mr3982624pfc.232.1537930805186; Tue, 25 Sep 2018 20:00:05 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id s13-v6sm5471703pfj.105.2018.09.25.20.00.01 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 25 Sep 2018 20:00:04 -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, ctatlor97@gmail.com, linus.walleij@linaro.org Subject: [PATCH v2 3/4] dt-bindings: power: Add Spreadtrum SC27XX fuel gauge unit documentation Date: Wed, 26 Sep 2018 10:59:13 +0800 Message-Id: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <358665e3f4f9ec105dc2f8a2dc6dd98dbe761fae.1537930252.git.baolin.wang@linaro.org> References: <358665e3f4f9ec105dc2f8a2dc6dd98dbe761fae.1537930252.git.baolin.wang@linaro.org> In-Reply-To: <358665e3f4f9ec105dc2f8a2dc6dd98dbe761fae.1537930252.git.baolin.wang@linaro.org> References: <358665e3f4f9ec105dc2f8a2dc6dd98dbe761fae.1537930252.git.baolin.wang@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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 --- 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..b161468 --- /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-table-temperatures = <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>; + }; + };