Received: by 10.213.65.68 with SMTP id h4csp852642imn; Sat, 7 Apr 2018 11:03:03 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/v3u7+vcvmpKFu7grbSWR60TvvN8Ll2KajpbJ67KtPjMaxNAneD81hFLKc3gA2XfG7YI4t X-Received: by 10.101.101.196 with SMTP id y4mr13240960pgv.129.1523124183836; Sat, 07 Apr 2018 11:03:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523124183; cv=none; d=google.com; s=arc-20160816; b=JyKCqvxce/UCJF93rocEdDG0sfz8zGnKntJfCJoh1XN9QTtqYUlIoSp0XP3ross1rs 1MPrNpLlzys1UuCLPMtY+GtY2tmgGhhcTIH4ehIPO5ONHMDk0FGvjT/nisNj5Ynxu4bX jNwmyDHizk284XNGJH1RDM7m/GNPF2n3SbBUgbxj2Z3xO8FRhYuYpT4EewJsa6GKjBkY zZYK2wpzFYqIDmx5cZv6NQY9EAHqxAnO7TBSh+AERSmV3tFTd8qMPOWB3ACf9otEpg0e YmyzoaX12BaJQYfTvDuQnbDGDUHKCYJnQtc+rwx4R/jw8Ok3aEWZG/eoyQMyu70zNlPF 7fUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:in-reply-to:message-id:date :subject:cc:from:dkim-signature:arc-authentication-results; bh=yZmxzOIBiHi1qC+Qn/37m/M9pZawE0RbZYAJS0N6Jgs=; b=OAfTOBRVJk27YnrbhGZqyqPDxnl+iUcM5bEM6ivHDHxUPiGABtIKtaWiUb7Vj/ZE72 Jge8IX2egyw0F12OlfbZU7IbKVSm9f3K53XBT58q54Y8ra/2hsk0ei5quE3L+y3cJnUO aAKu95/B9qMwTfYeHpHWbRjucqoUEp6rpq+jSpB6NX+ik+iI3RBVUM5or2A/vE67Idpm Uqtknlv5/H1u8khypH/exn28l+7om2eG4WuR2aBtnQEvYBEXTQrDVeEjx7pi49V36HWD RApAknzdmmX3ooEzzsVE5K6tipQQA16SOY7sG9o0cvmXm9SCQKxziRnVYm6zG3eXiHii Ggug== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=WfL/bWio; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3-v6si13153682plv.323.2018.04.07.11.02.27; Sat, 07 Apr 2018 11:03:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=WfL/bWio; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752289AbeDGR7J (ORCPT + 99 others); Sat, 7 Apr 2018 13:59:09 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:42149 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752240AbeDGR7H (ORCPT ); Sat, 7 Apr 2018 13:59:07 -0400 Received: by mail-wr0-f196.google.com with SMTP id s18so4337875wrg.9; Sat, 07 Apr 2018 10:59:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=yZmxzOIBiHi1qC+Qn/37m/M9pZawE0RbZYAJS0N6Jgs=; b=WfL/bWiolgPzDZi+q8LF7Gt6QpelIbJUfz+je232MzpvBeW9sUHGQmZkdX+BstDYP1 14lgmq60vFkZC4xnXLqyjbVgfI37qcoAJ0dnxQns9GJ/oNSG7fpkM6nWF3tneYHpEjPT dfK5vITluRPzbmm7u/f1M/cGWrASzByEqYOiOx2feNNwdi/2MZHFT1vL+OR05ya4ULm6 odbz4kWwfSHHaVNBFE2h3oyohPmRUn7hB1tKCJrTFWyxoZ9HQOFOINjOCX6o2XS5AmqP QvliGvhxJuTjwBuOYg2iBp6RqsiDnV6ozZezMhWs6s2CCaVGwF256/TDPC4fwWRTum86 uyIw== 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; bh=yZmxzOIBiHi1qC+Qn/37m/M9pZawE0RbZYAJS0N6Jgs=; b=PGjWuFg9GrPIrtORqtRFjFcijkqV5ANE1eBAa0xbBO/jv4myRqnuXztxVuK/XU9K6Q 9K99Um2j+KqRi3BQ4VQt0gVx9OUixKYcaqw2cFffF6Tt50xjUG3GokFXzixLCU0wn1qb glhjrDTQ1xCf7Rza3u6KhS0LNYtmu2EKrgxQLumLTWOhSWXtJEuA3OtAERmapDNoVFH8 Ild7kIdz6NTI3T2W+lcLki/Ww7wK1cCswRHOjbXspvqy8bEpBqp7ju/MHDMEi/U8mOKK 2PJniQljzbsb3uLHlkDooOM7k7Cx9VlNsIK7N7idIP+0x/HiBrTdLD10lbWD5gruLD9G NQiA== X-Gm-Message-State: AElRT7F7xAxqwZkaGBuxU4Kw32sWlmD5kEJOuovguZqDio2Q55Ai3nqt Rlxs4vTSJuzPbAIhL+lh8Q== X-Received: by 10.223.152.83 with SMTP id v77mr23067367wrb.225.1523123945307; Sat, 07 Apr 2018 10:59:05 -0700 (PDT) Received: from arch.home (host86-177-67-114.range86-177.btcentralplus.com. [86.177.67.114]) by smtp.googlemail.com with ESMTPSA id o23sm21805710wrf.93.2018.04.07.10.59.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Apr 2018 10:59:04 -0700 (PDT) From: Craig Tatlor Cc: ctatlor97@gmail.com, linux-arm-msm@vger.kernel.org, Sebastian Reichel , Rob Herring , Mark Rutland , Mauro Carvalho Chehab , "David S. Miller" , Greg Kroah-Hartman , Linus Walleij , Andrew Morton , Randy Dunlap , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 2/3] dt-bindings: power: supply: qcom_bms: Add bindings Date: Sat, 7 Apr 2018 18:57:45 +0100 Message-Id: <20180407175802.29444-2-ctatlor97@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180407175802.29444-1-ctatlor97@gmail.com> References: <20180407135934.26122-1-ctatlor97@gmail.com> <20180407175802.29444-1-ctatlor97@gmail.com> To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add bindings for the Qualcomm Battery Monitoring system. Signed-off-by: Craig Tatlor --- .../bindings/power/supply/qcom_bms.txt | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 Documentation/devicetree/bindings/power/supply/qcom_bms.txt diff --git a/Documentation/devicetree/bindings/power/supply/qcom_bms.txt b/Documentation/devicetree/bindings/power/supply/qcom_bms.txt new file mode 100644 index 000000000000..6296399edc09 --- /dev/null +++ b/Documentation/devicetree/bindings/power/supply/qcom_bms.txt @@ -0,0 +1,93 @@ +Qualcomm Battery Measurement System + +The Qualcomm Battery Measurement System is found inside of Qualcomm PM8941 +PMICs. It provides OCV and coulomb counter registers that allow the kernel +to infer a capacity level. + +Required properties: +- compatible: Should contain "qcom,pm8941-bms". +- reg: Specifies the SPMI address and length of the + controller's registers. +- interrupts: OCV threshold interrupt. +- io-channels: Should contain IIO channel specifier for the + ADC channel that reports battery temperature. +- io-channel-names: Should contain "temp". +- qcom,fcc-temp-legend: An array containing the temperature, in degC, + for each column of the FCC lookup table. +- qcom,fcc-lut: An array of FCC values in mah, one entry for each + temperature defined in in qcom,fcc-temp-legend. +- qcom,ocv-temp-legend: An array containing the temperature, in degC, + for each column of the OCV lookup table. +- qcom,ocv-capacity-legend: An array containing the capacity for each + row of the OCV lookup table. +- qcom,ocv-lut: An array of OCV values in mV, one entry for each + capacity defined in qcom,ocv-capacity-legend. + +Example: + + pm8941_vadc: vadc@3100 { + compatible = "qcom,spmi-vadc"; + reg = <0x3100>; + interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>; + #address-cells = <1>; + #size-cells = <0>; + #io-channel-cells = <1>; + + bat_temp { + reg = ; + }; + }; + + bms@4000 { + compatible = "qcom,pm8941-bms"; + reg = <0x4000>; + interrupts = <0x0 0x40 0x4 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "ocv_thr"; + + io-channels = <&pm8941_vadc VADC_LR_MUX1_BAT_THERM>; + io-channel-names = "temp"; + + qcom,fcc-temp-legend = /bits/ 8 <(-10) 0 25 50 65>; + qcom,fcc-lut = /bits/ 16 <6010 6070 6680 6780 6670>; + + qcom,ocv-capacity-legend = /bits/ 8 <100 95 90 85 + 80 75 70 65 + 60 55 50 45 + 40 35 30 25 + 20 15 10 9 + 8 7 6 5 4 + 3 2 1 0>; + + qcom,ocv-temp-legend = /bits/ 8 <(-10) 0 25 50 65>; + qcom,ocv-lut = /bits/ 16 <4288 4288 4306 4315 4315 + 4261 4241 4259 4266 4246 + 4201 4181 4201 4207 4187 + 4153 4133 4150 4155 4135 + 4105 4085 4100 4104 4084 + 4058 4038 4052 4058 4038 + 4012 3992 4004 4014 3994 + 3970 3950 3959 3971 3951 + 3931 3911 3915 3927 3907 + 3899 3879 3880 3884 3864 + 3873 3853 3851 3853 3833 + 3848 3828 3827 3829 3809 + 3829 3809 3808 3809 3789 + 3815 3795 3791 3791 3771 + 3801 3781 3775 3772 3752 + 3785 3765 3751 3746 3726 + 3767 3747 3727 3719 3699 + 3750 3730 3702 3692 3672 + 3728 3708 3680 3672 3652 + 3720 3700 3676 3665 3645 + 3712 3692 3670 3660 3645 + 3695 3675 3658 3648 3633 + 3662 3647 3629 3620 3610 + 3620 3605 3589 3580 3570 + 3562 3552 3538 3529 3519 + 3490 3480 3474 3470 3465 + 3403 3398 3388 3380 3375 + 3320 3300 3255 3221 3206 + 3000 3000 3000 3000 3000>; + }; + }; +}; -- 2.17.0