From patchwork Fri Oct 19 10:53:14 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: 149255 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp3143384lji; Fri, 19 Oct 2018 03:53:51 -0700 (PDT) X-Google-Smtp-Source: ACcGV62XYzsrcqLfd8BI/vi6si2+jNJSKHnCIh6LAIuYYMNo/F91eKGTo7wOROmYNULtrCJWyFTX X-Received: by 2002:a63:e04d:: with SMTP id n13-v6mr12947349pgj.426.1539946431706; Fri, 19 Oct 2018 03:53:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539946431; cv=none; d=google.com; s=arc-20160816; b=BBC034WAQUDw87NITRPKn7hYIUP4a7vgD+X5ny/9mAc/M8eCxzZFga6hfvCPFEcAUP kt70O2q3aEwlVnL4nL02YTglt9BvlH7V8pQpnFuJcDQnt8KrqBm3EgGPqsDV6B6Mtqve ShmlRucB1R84y4VpfVq7M40LCWK579OnUd+LGUtKaGVGVhJBsi9hi+nIM2UXqPkoVbI2 vRtqukxsdyRLwgEc3L7O3HYEMjcm48tWwpfQ3F8v55pjkzcU8pSJvvxxUcDfUoleTwv0 HOcPH/yLvnfcIyupzddvGXI2TWto6Z32j9zb3r9v9qqIO7R/1fqR8S/bL8f8i6yMi5vS Rezg== 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=Yg2NqsPWyEaCTubWb3spqrxS0nBIYblv+mmU9f9ac4E=; b=fBTQc+3wXN7xx3Yq4TBEzf6PZeYZQX131ONrfyVf48jo5nIgWr9LTjpYTXAgwJKcbl NKRG4WtS/Am5ul85fFs+7Qy/LPwyjvMvPyqo45D8H/HSQFiNXKueh3bejPW/JoomX10F JrjnhGooE1WxxmeEKE6ApEtseZmFESOgSf0u/NHqCvo3jskH1vNb81ymEia465ovSvTD jqlJfpxvi/KWW5ZwPHZK0f8/Qs+gfFTcnBzxd1ezTqvB05D4KplwxCWWv/xlY3g34n/c Xt7spZpHRuLQGn/RUh6S6UwT+jqgpHFh0fTyOezq5EhKx0uqra8/9Mj4bFG5fzCkPyb+ V4tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U4RJBdZW; 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 d12-v6si25766567pga.81.2018.10.19.03.53.51; Fri, 19 Oct 2018 03:53:51 -0700 (PDT) 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=U4RJBdZW; 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 S1727305AbeJSS7W (ORCPT + 6 others); Fri, 19 Oct 2018 14:59:22 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:44651 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727300AbeJSS7V (ORCPT ); Fri, 19 Oct 2018 14:59:21 -0400 Received: by mail-pg1-f193.google.com with SMTP id w3-v6so70241pgs.11 for ; Fri, 19 Oct 2018 03:53:48 -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=Yg2NqsPWyEaCTubWb3spqrxS0nBIYblv+mmU9f9ac4E=; b=U4RJBdZWaiebK1+vfkLJ7ia5s0uBdGM/QAgsa2iThK6v72RmukPsnB+tGAE9qcB3FX FBTRwl8nAI+LEg20o0enhqQxmN/IPEZ7CZHdyflZRK/xFVB0Ko2QR+eP3uO82dbM0+I6 DATGs9wF7PCIhCOvvTpxYynyJjwc2CNzsZW24= 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=Yg2NqsPWyEaCTubWb3spqrxS0nBIYblv+mmU9f9ac4E=; b=fhxUwDR94gSvxQTURkwSF9/8iojnmNmag/N0P3uIs9Km5okpnYuGkMiwJZVe79jCFp NjdMKhCEe8/cAQXZ452SfJ8GYIc2KMc/iVX2XrC/7rJuTvPVfhHN0de3OONsDKS2x20n N6ANJGypSEE8h8FiIj8C9t2pekkwfC7Sn0vxoJwo1M0+qjDvZDVpC6294WclyuYlj1x9 OKHt+ZURHYdVk8fGmQIXZ+B+FO/MHZTtx8moPcQj1Drvog6H/0seaqtu+SCJPYm/l3uE j4Di2PLF47sRiCG99D4V2SxV3QR+HqdIeCD67sibS6QWgmBeaVKKTs2fbDzZ/bx1GUbu zTmg== X-Gm-Message-State: ABuFfoixvcddncjTSh1a8onPN31gY2W6kBMXExkVqFLItT5Au5kc5ilU OZrgxHzJU49bo9Kc8sgWt4x24g== X-Received: by 2002:a63:5949:: with SMTP id j9-v6mr32169578pgm.210.1539946428500; Fri, 19 Oct 2018 03:53:48 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id m67-v6sm54918pfm.13.2018.10.19.03.53.44 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 19 Oct 2018 03:53:47 -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 v5 5/6] dt-bindings: power: Add Spreadtrum SC27XX fuel gauge unit documentation Date: Fri, 19 Oct 2018 18:53:14 +0800 Message-Id: <14b947c6195133ed93cf0302b1575c033c4ccf04.1539915051.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: 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 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>; + }; + };