From patchwork Fri Sep 15 05:01:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikita Travkin X-Patchwork-Id: 140162 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp842656vqi; Thu, 14 Sep 2023 23:26:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEYLBx8NWv03k7XBLR2FD60evBD1rzyHi16TkzjaQw1kaEciq2ZO77telpZ4BAvbaPJrkOT X-Received: by 2002:a17:90a:17cd:b0:268:e43a:dbfd with SMTP id q71-20020a17090a17cd00b00268e43adbfdmr659944pja.1.1694759160914; Thu, 14 Sep 2023 23:26:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694759160; cv=none; d=google.com; s=arc-20160816; b=HobgDwiTtAWoiCkWOwg0ZduvAJ5Hr29j+Q6d1Sgis1d9fw8ewRbAClFgOzcM26Sbiy tT571EExdbQ82CwFl3Kt4zx5SGuZ28fa5dElfRwIQPmmTipaYaCXvdK3rP0NnynIvAih c/oNSvu3+m8/gKSIr0Gzf1f29lkIn26zdlFFU2yWWuvu6m5xQ9BWvllr9jv46ba+9U89 wC12cv8P+XnJY4yZpYK/8XqBL74mkzmOMz4SJ5HKdU0JUJgnXNtmOIYysELmFUQ8Z9ln C9bjzQqrgj6OdHe9H8TCDvgmNHZaor5jZJETqngNN2+nJ2jchg39NkRw1E678fJzcNFD s/wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=QR6GIP/3tRnrs06ez+emilveEQMG33KGm2b5rHO5VgM=; fh=8ChIgZP2C0uLMkY6q9m5BeYM4aktykEoN9RArRJ3GBg=; b=A5rUDCtNFXpsCatuJFCBd/3o1wbaCkspuk87kURK4ekyigecArjAiAy+06YrgN8P5p XSSbzTcry4iebT+0Eyr8jn+AE7RKUuu4n4hlbQbHyc4STf9kBUzq2PFWXXQvHzOtWvST YtWCcspNp1gs/gKPqjTsoGyEMAg82YC5tLR/S2xdZ4FYwaGZHlIGd9ZOenAp/Q6vb7Gl ANRksid0fPRLbbhnP9RO6YvkMQsY/nTfVVVQ59Y+950EQ8ySVBbVxRPQ1Se22ih908Zw X/BUE5Gw3CG4W8iizRFfuPRuXMu1jlYmqRD0KYh0YfL/gYr0AB4f8O5k25SasGoHgHdZ vTDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@trvn.ru header.s=mail header.b=lXRm7QUV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=trvn.ru Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id e11-20020a17090a804b00b002746ab58dfcsi2586165pjw.18.2023.09.14.23.26.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 23:26:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@trvn.ru header.s=mail header.b=lXRm7QUV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=trvn.ru Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 95226825A3E6; Thu, 14 Sep 2023 22:02:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232019AbjIOFCH (ORCPT + 33 others); Fri, 15 Sep 2023 01:02:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232003AbjIOFCB (ORCPT ); Fri, 15 Sep 2023 01:02:01 -0400 Received: from box.trvn.ru (box.trvn.ru [194.87.146.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFD7C2710; Thu, 14 Sep 2023 22:01:54 -0700 (PDT) Received: from authenticated-user (box.trvn.ru [194.87.146.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by box.trvn.ru (Postfix) with ESMTPSA id 6F70F424AE; Fri, 15 Sep 2023 10:01:50 +0500 (+05) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=trvn.ru; s=mail; t=1694754110; bh=rGP+tXUnWOMGHdQJ8R0srdv2Kny66mnF5MC7ifV715k=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=lXRm7QUV1IYXq/QeuTPCugFytuP2FrCDCNtJ73bE2ayi/Gh7Q0pHZGmLjvcvuVTQD hBi2u3FTzNq5ZcLnvcFZCOzx9QbHPWDQNi16/CBWi9x+CwddhlkbaMX0odDAJE3TfS 2RNYQmWc2WYkse6hbQd7gX6eWI2YbPeI2VZrWpmIyachwjf1L62YFslUJDbuN78itk KSPBmVJxuSzQp5sDZyFrV9GivFbP1L/g2ayUJ20iMSZXsn8RruAMLQf0s6vOqnb3dB uVlCFpdD9eKKebNgH8uDnFpv6ZKQTRc0wMXpQBrFbW6YR0nPAxhhaBADpccQ1jzN5t vYNcaAMUp4Rsg== From: Nikita Travkin Date: Fri, 15 Sep 2023 10:01:19 +0500 Subject: [PATCH v3 2/4] dt-bindings: power: supply: Add pm8916 LBC MIME-Version: 1.0 Message-Id: <20230915-pm8916-bms-lbc-v3-2-f30881e951a0@trvn.ru> References: <20230915-pm8916-bms-lbc-v3-0-f30881e951a0@trvn.ru> In-Reply-To: <20230915-pm8916-bms-lbc-v3-0-f30881e951a0@trvn.ru> To: Sebastian Reichel , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Nikita Travkin , Rob Herring X-Developer-Signature: v=1; a=openpgp-sha256; l=4501; i=nikita@trvn.ru; h=from:subject:message-id; bh=rGP+tXUnWOMGHdQJ8R0srdv2Kny66mnF5MC7ifV715k=; b=owEBbQKS/ZANAwAIAUMc7O4oGb91AcsmYgBlA+U78/A2JnnlDCpflyrOzd5BNNlzgR8hOvd4w CkCp1IC6BaJAjMEAAEIAB0WIQTAhK9UUj+qg34uxUdDHOzuKBm/dQUCZQPlOwAKCRBDHOzuKBm/ dYGOD/9yiqmvm1IdeYt3zmmsn4Bos6U3t5HGejjkolM32oggULuD+g1Hum8m+vC++bdvPit5bhA lM1qH8FzdfDa8AXIe7LNqhKdb3Y+Kh/6d3DSZuZ53yet8Tqcn1RKe78d4lIzkAGbWhXq1VdgjOw DthtOHSMu4dyo9IYnGYprD//6ttuwM3y6vSpiguC1mHbq0104TtgGWHgPF0THFwO94qrnMx1YxT snKVkn9GUEomrGsb4e+c35J6tdjNspPSmHatQvmWwitixWdVUSJC3bAi3CuuH7f5oufUwVYPRiv 9s4KUgdtXo7igFKucSmCtevBF99tUmNJzQR8ZKPrb0reCJjQ8PpduO2ASQxSPIz6AOkJHK527fo aEjCfotm/LHUS/L3DgirzQyMtr2qolBuO66yUmvn/vbxhVABk/p5/BIIxrBYT27/AuSTaZhECmV zqugOlM12NvePEOVhZ92GjxV3TmDa7dIm/jNZ/dV+Qh7nm8dzp2wNPU4y0MnEQ9WO5LCitruity HkVTv6NhRQAQTeVC/JKott/YKn+BN+irW9tD0Js3NswsO0BUhPvFbuDyWzU0bQgkKcI5vMfrrhd Mwzdk9pj/4Xm2w8pPxE7yjBRzFLrV9LXy+QDkEso9kYumX5zds+GrPyhG74ARiV0CO1arCHHCxQ Xzw1nk+mnQC3eCw== X-Developer-Key: i=nikita@trvn.ru; a=openpgp; fpr=C084AF54523FAA837E2EC547431CECEE2819BF75 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 14 Sep 2023 22:02:21 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777083782292393918 X-GMAIL-MSGID: 1777083782292393918 Qualcomm Linear Battery Charger is a CC/CV charger block in PM8916 PMIC. Document it's DT binding. Signed-off-by: Nikita Travkin Reviewed-by: Rob Herring --- v2: List all interrupts (Conor) --- .../bindings/power/supply/qcom,pm8916-lbc.yaml | 128 +++++++++++++++++++++ 1 file changed, 128 insertions(+) diff --git a/Documentation/devicetree/bindings/power/supply/qcom,pm8916-lbc.yaml b/Documentation/devicetree/bindings/power/supply/qcom,pm8916-lbc.yaml new file mode 100644 index 000000000000..cdf14e5ed119 --- /dev/null +++ b/Documentation/devicetree/bindings/power/supply/qcom,pm8916-lbc.yaml @@ -0,0 +1,128 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/power/supply/qcom,pm8916-lbc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Linear Battery Charger + +maintainers: + - Nikita Travkin + +description: + Linear Battery Charger hardware block, found in some Qualcomm PMICs + such as pm8916. Implements a simple, autonomous CC/CV charger. + +allOf: + - $ref: power-supply.yaml# + +properties: + compatible: + const: qcom,pm8916-lbc + + reg: + items: + - description: Charger + - description: Battery + - description: USB + - description: MISC + + reg-names: + items: + - const: chgr + - const: bat_if + - const: usb + - const: misc + + interrupts: + items: + - description: Battery detection + - description: Fast charging + - description: Charging failed + - description: Charging done + - description: Battery present + - description: Battery temperature OK + - description: USB coarse detection + - description: USB IN valid + - description: Charger gone + - description: Overtemperature + + interrupt-names: + items: + - const: vbat_det + - const: fast_chg + - const: chg_fail + - const: chg_done + - const: bat_pres + - const: temp_ok + - const: coarse_det + - const: usb_vbus + - const: chg_gone + - const: overtemp + + qcom,fast-charge-safe-voltage: + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 4000000 + maximum: 4775000 + description: + Maximum safe battery voltage in uV; May be pre-set by bootloader, + in which case, setting this will harmlessly fail. + + qcom,fast-charge-safe-current: + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 90000 + maximum: 1440000 + description: + Maximum safe battery charge current in uA; May be pre-set by + bootloader, in which case setting this will harmlessly fail. + + monitored-battery: true + +required: + - compatible + - reg + - interrupts + - interrupt-names + - qcom,fast-charge-safe-voltage + - qcom,fast-charge-safe-current + +additionalProperties: false + +examples: + - | + #include + pmic { + #address-cells = <1>; + #size-cells = <0>; + + charger@1000 { + compatible = "qcom,pm8916-lbc"; + reg = <0x1000>, <0x1200>, <0x1300>, <0x1600>; + reg-names = "chgr", "bat_if", "usb", "misc"; + + interrupts = <0x0 0x10 0 IRQ_TYPE_EDGE_BOTH>, + <0x0 0x10 5 IRQ_TYPE_EDGE_BOTH>, + <0x0 0x10 6 IRQ_TYPE_EDGE_BOTH>, + <0x0 0x10 7 IRQ_TYPE_EDGE_BOTH>, + <0x0 0x12 0 IRQ_TYPE_EDGE_BOTH>, + <0x0 0x12 1 IRQ_TYPE_EDGE_BOTH>, + <0x0 0x13 0 IRQ_TYPE_EDGE_BOTH>, + <0x0 0x13 1 IRQ_TYPE_EDGE_BOTH>, + <0x0 0x13 2 IRQ_TYPE_EDGE_BOTH>, + <0x0 0x13 4 IRQ_TYPE_EDGE_BOTH>; + interrupt-names = "vbat_det", + "fast_chg", + "chg_fail", + "chg_done", + "bat_pres", + "temp_ok", + "coarse_det", + "usb_vbus", + "chg_gone", + "overtemp"; + monitored-battery = <&battery>; + + qcom,fast-charge-safe-current = <900000>; + qcom,fast-charge-safe-voltage = <4300000>; + }; + };