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: 146508 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp4497875ljw; Wed, 12 Sep 2018 00:30:20 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbcStO3F+GZ9Zvb74L3u1mNIjoSxN3RFzwaqz7J2RKWbQ6QTNhnCdIiOVP3A2SmpsjHVT3K X-Received: by 2002:a63:5964:: with SMTP id j36-v6mr645543pgm.222.1536737419878; Wed, 12 Sep 2018 00:30:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536737419; cv=none; d=google.com; s=arc-20160816; b=vfRIHTCBPmyUFF1CreofGbZd1B6GY7YDG9RBdhdP5yQSS/VrgkIPKgqkZm6qYpgSjF fcFBBULiSwQD2gENYQS1bnfA2YhA2kMyzUvP9DOO4sS0augZfgF8UHeTX6gNDPx6m3yx i/cFRgLiII2xSusoDqWnkFtB+wxGyPgaTBlKUOQyOe50yIkJQyXVdmL4YUIWAbCOBhCQ gy/PWEMeFEXpAWVCPOBYX5xssCCPI2/82y61oDy4qGU0LEbRHEz0BLa9exGrtX2CrIbh cwxNGhZUU/U3V28rNO44Pk7dwvh7oCvGHt3FPV6Bs+NMJlHoK0VJgzmcZwoi1cGRmjRC 3Yug== 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=6a2K6qNZh60/sMvmbkck3n+/n6PkI3DTt1DQ2AdQSgY=; b=RAeVbO4cALnY+1fUYFIzEZPtaOGT5DU9ChkzCzIvS3d8icZaY0mNyoblAyubmkd0Xd OLa61D3HD8plzVvNpuebWF5xBP9kvDin2YOto+3+m6B8ukie17z1L2Y1uFEPUsloIebi 0DwQqT6P2u1Nqvg2LbrrdpS+RjRzYJ7HHK72kqFbxvKdUdGmdDt0xBXOX/ehdngt7EkE GQbkNkVQdTtiVHo+gHAKAFnEKFCVWH1p4OAlm6JfWHbQWuG3RG9sCC1rauTTKJpbvRnq F1E54yLR3XdkbXKJ6O2G0Jh30Pd3QzH1V/n3Up8cUNp7CB6kmJIxYnVF0GvxXF9ZQhjh lE8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iPorLxcR; 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 k190-v6si254207pgd.80.2018.09.12.00.30.19; Wed, 12 Sep 2018 00:30:19 -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=iPorLxcR; 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 S1726860AbeILMdb (ORCPT + 10 others); 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-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 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 -- 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..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>; + }; + };