From patchwork Fri Jul 28 17:19:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikita Travkin X-Patchwork-Id: 127825 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp616609vqg; Fri, 28 Jul 2023 11:25:19 -0700 (PDT) X-Google-Smtp-Source: APBJJlE3h+4XjqAUJ/gA8JfBJ+6xpVqtLyybGKMwAcAOUbRpWVzUkjDDWLaCp4f4MsqAMqyYZput X-Received: by 2002:a05:6a21:7189:b0:115:5ed5:34d3 with SMTP id wq9-20020a056a21718900b001155ed534d3mr1855314pzb.20.1690568718741; Fri, 28 Jul 2023 11:25:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690568718; cv=none; d=google.com; s=arc-20160816; b=m7vPqPsX6XT6IDp85KUylW/rRAI3de5f/xcH3GmiP0Ky4KjfDuIVIjWkOHO8/insd/ nkxflC1OFtcq6bdGgQc1semnAcyRfKRKj9CAZ0hI0Nbq+3JyY8PtfDwkX2OW9Cv89R/d CGKLWv2H57Sw2QSxopkeTdNNhx+JDh8/TxoELZRd0SfPQAnnaCEcKvJP65ehfDXtrPl5 f9sO3cBwh1aYDf1D2hvjUFDJDAOOkujlExD2cCNsUZvTFv1bUVRxsN0NjX3wxE/AQJ4X 8x6YlsxvsDSirzyrNSOi4P/l21BPgsyvYfu+5hksAz8KtnwoIiN3PG2+Vh1bMgODNw/8 GiKA== 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=4fKqk+48FCKxMA4M0hzhxYX/xIq1G2iAfm+Jizyjr/U=; fh=DWfKZrqDT5uR0d7BPg516BB12nZg8AlVJgKxCaTggqo=; b=URfqtDTz4jggWhLHgpF+fGPes3mfCPjD+Kc+VfTZM7HTGf9YWZtoPWefHMEJ7wi7q3 x52WxDbpLQXbGz4djmnwmHt4h1MCUMDvawV6o3dDBG79mjVoI+OI3UwphMwQPUKKc4pL SUUNPiSZXa/l/yOEv2MzGY00IBk+4BhO+4GtdZ4r5mqBsHvI7n2FBLxm7fi9DSQqtOm3 hgG37UavR2dNXouDfjgzQnXdnHc5oSfzWn8U5X6lgdw9N3zzQkqzZwO11OyD5IZ7msO0 RV0d4IIBLlRTCMuY5luPzRcE0KFUHdiiFZJHBE8m4a3Tr9aP7cLK0q1ODsVXrVE4pUVs nWsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@trvn.ru header.s=mail header.b=uvxAYqYy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bw17-20020a056a00409100b00682642ec7c0si3435408pfb.338.2023.07.28.11.25.05; Fri, 28 Jul 2023 11:25:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@trvn.ru header.s=mail header.b=uvxAYqYy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=trvn.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233913AbjG1R3k (ORCPT + 99 others); Fri, 28 Jul 2023 13:29:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229572AbjG1R3b (ORCPT ); Fri, 28 Jul 2023 13:29:31 -0400 Received: from box.trvn.ru (box.trvn.ru [194.87.146.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42F3C35BF; Fri, 28 Jul 2023 10:29:29 -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 9431A423EE; Fri, 28 Jul 2023 22:20:26 +0500 (+05) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=trvn.ru; s=mail; t=1690564826; bh=s4ixMcdZJsN0/3Reb+BBUuoWu+guNJbfDt3OOtbMHBM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=uvxAYqYyEKfq4MGSr8DGFiP8Xdvw5m20nct6RePfOaXJIrzOsYQ5FofF6TADXRBLD s5K/q0qDtozf6SxJ61CeijzB45xPi1r+I54LSQN3AipDTIv6j04EE5YBhD4jqwWPOm Dep6X+nxIwjF0PcZ2ikrJBBvqzudFEyJ+dpwpxnUuvcKMJMIIGaYYGighGnsT1G713 a2kduGuYkuRGsprDYP48/H3LaeN6sK3JX0ju5VwMB3Rsj7w4z/4tJUqJ+v/osmBE9l 7MpoI8ANkdJm5bDjP3v7uNDIZKZ7eP34GOjvwKh9ygHTe0QqTpEVMHQEUYAdODi5oU pTSNrICUaljNQ== From: Nikita Travkin Date: Fri, 28 Jul 2023 22:19:31 +0500 Subject: [PATCH 2/4] dt-bindings: power: supply: Add pm8916 LBC MIME-Version: 1.0 Message-Id: <20230728-pm8916-bms-lbc-v1-2-56da32467487@trvn.ru> References: <20230728-pm8916-bms-lbc-v1-0-56da32467487@trvn.ru> In-Reply-To: <20230728-pm8916-bms-lbc-v1-0-56da32467487@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 X-Developer-Signature: v=1; a=openpgp-sha256; l=2962; i=nikita@trvn.ru; h=from:subject:message-id; bh=s4ixMcdZJsN0/3Reb+BBUuoWu+guNJbfDt3OOtbMHBM=; b=owEBbQKS/ZANAwAIAUMc7O4oGb91AcsmYgBkw/jQ7P3tIhWXpdsvQk1Zy9Bh5v2KLmRccz6u6 au35+aMde6JAjMEAAEIAB0WIQTAhK9UUj+qg34uxUdDHOzuKBm/dQUCZMP40AAKCRBDHOzuKBm/ dZbQD/4jWSHCwfnAzhRr2WSfVinIjYjJYchxM02soLIcJ96riDT9MMKMbgey0126+IHmVCpUBZ1 qBWJfXRU2fg9Ows6e5FM6RCNE7O+0Kvof65t6g3Dqz5AckrG/h/3pvHRsd9oSlhl3cZZ2+Q/H1h N52VoF/JMP9gPzlTksozrCLWG39GgK8QoOHibc6CxNNu5TSi4RiEMVerueJvs9UvIWsxR1DEiET VnidsdVRuoHO7r+6OFKc5XYt/yqC9z8rQRnkg2QaiZCiHuxGVgRnxSlKmrSoh31Z3zFAD8hbV3b qK095mTyZoMza3HcNIg7178YQf+wDXfhOu9IRQzD7Euf3q89ZuASEcP3GcB4umb+xyWCb67FRlm qVf0peiJ9uPCEFm8WXKJLvqaPBf/dXtOivAbCYqRMJH0H60/X6cR3UL9X38e7ARULf1olGGSbwh 9q8nBCo8Sud/2epeQzRW0+40qfX2G1jM6LpZ4MeTzlaTfB3X6m7hkYUuep8w9If0P/RnCGYTQlF yLyoXP7LIuj3vlB9OcVNAgq2CZwxH+fCM3inQhOmmp4JmMIHhfWMsVAffI762iksT32dnEpwRhb oY7oCF/8drrqbytKFyXjIGj8+5D8GtxOrCTdbIu5w423AoXhoJ295si9lZSQjB47LsWoUCpBgC+ HW4/4VW13TqZ5OQ== X-Developer-Key: i=nikita@trvn.ru; a=openpgp; fpr=C084AF54523FAA837E2EC547431CECEE2819BF75 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772689784678202683 X-GMAIL-MSGID: 1772689784678202683 Qualcomm Linear Battery Charger is a CC/CV charger block in PM8916 PMIC. Document it's DT binding. Signed-off-by: Nikita Travkin --- .../bindings/power/supply/qcom,pm8916-lbc.yaml | 93 ++++++++++++++++++++++ 1 file changed, 93 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..baf232b61e02 --- /dev/null +++ b/Documentation/devicetree/bindings/power/supply/qcom,pm8916-lbc.yaml @@ -0,0 +1,93 @@ +# 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: USB IN valid + + interrupt-names: + items: + - const: usb_vbus + + 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 0x13 1 IRQ_TYPE_EDGE_BOTH>; + interrupt-names = "usb_vbus"; + + monitored-battery = <&battery>; + + qcom,fast-charge-safe-current = <900000>; + qcom,fast-charge-safe-voltage = <4300000>; + }; + };