From patchwork Fri Jan 13 06:17:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ChiYuan Huang X-Patchwork-Id: 43029 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp122703wrt; Thu, 12 Jan 2023 23:00:14 -0800 (PST) X-Google-Smtp-Source: AMrXdXvbMR9OmzbM8SQMXYLb3FRU4P8EhqZ/2ElzmtoyMSM7tRV1CZRtB0sIwhatIrv3LryaXiJS X-Received: by 2002:aa7:cb94:0:b0:496:6a20:6b61 with SMTP id r20-20020aa7cb94000000b004966a206b61mr20377053edt.22.1673593213943; Thu, 12 Jan 2023 23:00:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673593213; cv=none; d=google.com; s=arc-20160816; b=rHLqkQpT8ek68fX/oh0lroRK06zxQKOSCamPz4Ybwl2GXVaLGAh38kvtasxZgMxZPA jTleZDDE0OkbeJUDTsZS31YSOIph4jdo27hZCdEsT1Qp1kIsROGj5al9LtbNSKpWeDG7 NloGTAW9VVvsyJJ6oijTm5qBKiZCUz4jzbe9Tts+uwlFhqriInAkPFnN7VlLSuyZRwMe tNWhZ1osk2tcx9K11Jq97M03C2utyFuHI9Tin2Oi+lo+oRlkOmIwkkOIWhx9GYK6R1LB l/71rX5ODxwG9bpoEtdSGCcJrl2vjqoTnlKsrCp2+xNADQ29KpFXTmrQ95C3z+q6EV8v srSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=WdPMA2pH0mS9gX0lH3J9f/5y/00ONBhVpJZxWxuBUaU=; b=URwgwasJ/NKY6vIHflvZ5gccaiswyGiZsm/FMjyooDFkvPWKMdgx6Qrwhm2/Zkpuv+ 3aKBYAZwioj2kSxgj5pe1WratGOii2PtFUw+xDbH/7OiDGd+LdShyUFW0c+e0WQTf5QC oPhEhUl7mON+aVZ41jz7vjWGaw0cgbcfGXHqRF8haeUtdrntIW0rF6H5fXHn2075Mtda CvP2kqQMoH2iVMVGNLYZEsJ5ClP87EDst0x1ziWktsj+E/5MDeHwtrVwyGH5noPw9Ux9 kwi/O2H+0ehj9O6KgzIUyj1Hffp45kRjT6vhXvmXhZbzSyyMczujGqqKf/aurg3E1jEJ DFOw== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v1-20020aa7d641000000b0046aee4c4ebbsi464096edr.521.2023.01.12.22.59.50; Thu, 12 Jan 2023 23:00:13 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240129AbjAMG7M (ORCPT + 99 others); Fri, 13 Jan 2023 01:59:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240995AbjAMG5I (ORCPT ); Fri, 13 Jan 2023 01:57:08 -0500 Received: from mg.richtek.com (mg.richtek.com [220.130.44.152]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 33FDC81C34; Thu, 12 Jan 2023 22:42:28 -0800 (PST) X-MailGates: (compute_score:DELIVER,40,3) Received: from 192.168.8.21 by mg.richtek.com with MailGates ESMTP Server V3.0(2732:0:AUTH_RELAY) (envelope-from ); Fri, 13 Jan 2023 14:23:39 +0800 (CST) X-MailGates: (compute_score:DELIVER,40,3) Received: from 192.168.10.46 by mg.richtek.com with MailGates ESMTP Server V5.0(16494:0:AUTH_RELAY) (envelope-from ); Fri, 13 Jan 2023 14:17:47 +0800 (CST) Received: from ex4.rt.l (192.168.10.47) by ex3.rt.l (192.168.10.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.20; Fri, 13 Jan 2023 14:17:47 +0800 Received: from linuxcarl2.richtek.com (192.168.10.154) by ex4.rt.l (192.168.10.45) with Microsoft SMTP Server id 15.2.1118.20 via Frontend Transport; Fri, 13 Jan 2023 14:17:47 +0800 From: To: , , CC: , , , , , Subject: [PATCH RESEND v8 1/3] dt-bindings: power: supply: Add Richtek RT9471 battery charger Date: Fri, 13 Jan 2023 14:17:44 +0800 Message-ID: <1673590666-24618-2-git-send-email-cy_huang@richtek.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1673590666-24618-1-git-send-email-cy_huang@richtek.com> References: <1673590666-24618-1-git-send-email-cy_huang@richtek.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754889677628258401?= X-GMAIL-MSGID: =?utf-8?q?1754889677628258401?= From: ChiYuan Huang Add bindings for the Richtek RT9471 I2C controlled battery charger. Reviewed-by: Krzysztof Kozlowski Co-developed-by: Alina Yu Signed-off-by: Alina Yu Signed-off-by: ChiYuan Huang --- Since v3 - Move unevaluatedProperties line after $ref for binding patch. - Add Reviewed-by tag for binding patch. Since v2 - Remove the properties for interrupt controller things in the binding documentation. - Fix dtc error for typo, it's 'regulator-name', not 'regulator-compatible'. - Add regulator min/max microamp to allow otg vbus current adjustable in example. - Specify the active-level for charge-enable-gpios in binding example. --- .../bindings/power/supply/richtek,rt9471.yaml | 73 ++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 Documentation/devicetree/bindings/power/supply/richtek,rt9471.yaml diff --git a/Documentation/devicetree/bindings/power/supply/richtek,rt9471.yaml b/Documentation/devicetree/bindings/power/supply/richtek,rt9471.yaml new file mode 100644 index 00000000..fbb54cf --- /dev/null +++ b/Documentation/devicetree/bindings/power/supply/richtek,rt9471.yaml @@ -0,0 +1,73 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/power/supply/richtek,rt9471.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Richtek RT9471 3A Single Cell Switching Battery charger + +maintainers: + - Alina Yu + - ChiYuan Huang + +description: | + RT9471 is a switch-mode single cell Li-Ion/Li-Polymer battery charger for + portable applications. It supports USB BC1.2 port detection, current and + voltage regulations in both charging and boost mode. + + Datasheet is available at + https://www.richtek.com/assets/product_file/RT9471=RT9471D/DS9471D-02.pdf + +properties: + compatible: + const: richtek,rt9471 + + reg: + maxItems: 1 + + charge-enable-gpios: + description: GPIO used to turn on and off charging. + maxItems: 1 + + wakeup-source: true + + interrupts: + maxItems: 1 + + usb-otg-vbus-regulator: + type: object + $ref: /schemas/regulator/regulator.yaml# + unevaluatedProperties: false + +required: + - compatible + - reg + - wakeup-source + - interrupts + +additionalProperties: false + +examples: + - | + #include + #include + i2c { + #address-cells = <1>; + #size-cells = <0>; + + charger@53 { + compatible = "richtek,rt9471"; + reg = <0x53>; + charge-enable-gpios = <&gpio26 1 GPIO_ACTIVE_LOW>; + wakeup-source; + interrupts-extended = <&gpio_intc 32 IRQ_TYPE_EDGE_FALLING>; + + usb-otg-vbus-regulator { + regulator-name = "usb-otg-vbus"; + regulator-min-microvolt = <4850000>; + regulator-max-microvolt = <5300000>; + regulator-min-microamp = <500000>; + regulator-max-microamp = <1200000>; + }; + }; + };