From patchwork Fri Jan 13 06:34:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ChiYuan Huang X-Patchwork-Id: 642265 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33A8EC61DB3 for ; Fri, 13 Jan 2023 06:52:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240225AbjAMGwB (ORCPT ); Fri, 13 Jan 2023 01:52:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233217AbjAMGvZ (ORCPT ); Fri, 13 Jan 2023 01:51:25 -0500 Received: from mg.richtek.com (mg.richtek.com [220.130.44.152]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 313977F443; Thu, 12 Jan 2023 22:35:22 -0800 (PST) X-MailGates: (flag:4,DYNAMIC,BADHELO,RELAY,NOHOST:PASS)(compute_score:DE LIVER,40,3) Received: from 192.168.10.47 by mg.richtek.com with MailGates ESMTP Server V5.0(16474:0:AUTH_RELAY) (envelope-from ); Fri, 13 Jan 2023 14:34:43 +0800 (CST) Received: from ex4.rt.l (192.168.10.47) by ex4.rt.l (192.168.10.47) 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:34:43 +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:34:43 +0800 From: To: , , CC: , , , , , Subject: [PATCH RESEND v3 1/3] dt-bindings: power: supply: Add Richtek RT9759 smart cap divider charger Date: Fri, 13 Jan 2023 14:34:40 +0800 Message-ID: <1673591682-25789-2-git-send-email-cy_huang@richtek.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1673591682-25789-1-git-send-email-cy_huang@richtek.com> References: <1673591682-25789-1-git-send-email-cy_huang@richtek.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: ChiYuan Huang Add bindings for the Richtek RT9759 smart cap divider charger. Signed-off-by: ChiYuan Huang Reviewed-by: Rob Herring --- Since v2 - Add Reviewed-by tag for dt-binding patch --- .../bindings/power/supply/richtek,rt9759.yaml | 61 ++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 Documentation/devicetree/bindings/power/supply/richtek,rt9759.yaml diff --git a/Documentation/devicetree/bindings/power/supply/richtek,rt9759.yaml b/Documentation/devicetree/bindings/power/supply/richtek,rt9759.yaml new file mode 100644 index 00000000..04fc6b0 --- /dev/null +++ b/Documentation/devicetree/bindings/power/supply/richtek,rt9759.yaml @@ -0,0 +1,61 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/power/supply/richtek,rt9759.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Richtek RT9759 Smart Cap Divider Charger + +maintainers: + - ChiYuan Huang + +description: | + The RT9759 is a high efficiency and high charge current charger. + The efficiency is up to 97.8% when VBAT = 4.2V, IBAT = 2.5A and the maximum + charge current is up to 8A. The device integrates smart cap divider topology + with dual phase charge pump core. The ADCs provide input and output voltage, + current and temperature information to monitor the whole charging process. + + Datasheet is available at + https://www.richtek.com/assets/product_file/RT9759/DS9759-02.pdf + +properties: + compatible: + enum: + - richtek,rt9759 + + reg: + maxItems: 1 + + wakeup-source: true + + interrupts: + maxItems: 1 + + shunt-resistor-micro-ohms: + description: Battery current sense resistor mounted. + default: 2000 + +required: + - compatible + - reg + - wakeup-source + - interrupts + +additionalProperties: false + +examples: + - | + #include + i2c { + #address-cells = <1>; + #size-cells = <0>; + + charger@66 { + compatible = "richtek,rt9759"; + reg = <0x66>; + wakeup-source; + interrupts-extended = <&gpio_intc 32 IRQ_TYPE_EDGE_FALLING>; + shunt-resistor-micro-ohms = <5000>; + }; + }; From patchwork Fri Jan 13 06:34:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ChiYuan Huang X-Patchwork-Id: 642264 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2CF90C678D7 for ; Fri, 13 Jan 2023 06:52:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232479AbjAMGwE (ORCPT ); Fri, 13 Jan 2023 01:52:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234084AbjAMGv1 (ORCPT ); Fri, 13 Jan 2023 01:51:27 -0500 Received: from mg.richtek.com (mg.richtek.com [220.130.44.152]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 51DE87F458; Thu, 12 Jan 2023 22:35:22 -0800 (PST) X-MailGates: (flag:4,DYNAMIC,BADHELO,RELAY,NOHOST:PASS)(compute_score:DE LIVER,40,3) Received: from 192.168.10.47 by mg.richtek.com with MailGates ESMTP Server V5.0(16475:0:AUTH_RELAY) (envelope-from ); Fri, 13 Jan 2023 14:34:44 +0800 (CST) Received: from ex4.rt.l (192.168.10.47) by ex4.rt.l (192.168.10.47) 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:34:43 +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:34:43 +0800 From: To: , , CC: , , , , , Subject: [PATCH RESEND v3 3/3] Documentation: power: rt9759: Document exported sysfs entries Date: Fri, 13 Jan 2023 14:34:42 +0800 Message-ID: <1673591682-25789-4-git-send-email-cy_huang@richtek.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1673591682-25789-1-git-send-email-cy_huang@richtek.com> References: <1673591682-25789-1-git-send-email-cy_huang@richtek.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: ChiYuan Huang Document the settings exported by rt9759 charger driver through sysfs entries: - watchdog_timer - battery_voltage - battery_current Signed-off-by: ChiYuan Huang --- Since v3: No change Since v2: - Change ABI document date from Oct 2022 to Nov 2022 and KernelVersion from 6.1 to 6.2 --- Documentation/ABI/testing/sysfs-class-power-rt9759 | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-class-power-rt9759 diff --git a/Documentation/ABI/testing/sysfs-class-power-rt9759 b/Documentation/ABI/testing/sysfs-class-power-rt9759 new file mode 100644 index 00000000..8a7258f --- /dev/null +++ b/Documentation/ABI/testing/sysfs-class-power-rt9759 @@ -0,0 +1,37 @@ +What: /sys/class/power_supply/rt9759-*/watchdog_timer +Date: Nov 2022 +KernelVersion: 6.2 +Contact: ChiYuan Huang +Description: + This entry shows and sets the watchdog timer when rt9759 charger + operates in charging mode. When the timer expires, the device + will disable the charging. To prevent the timer expires, any + host communication can make the timer restarted. + + Access: Read, Write + + Valid values: + - 500, 1000, 5000 or 30000 (milliseconds), + - 0: disabled + +What: /sys/class/power_supply/rt9759-*/battery_voltage +Date: Nov 2022 +KernelVersion: 6.2 +Contact: ChiYuan Huang +Description: + Reports the current BAT voltage. + + Access: Read-Only + + Valid values: Represented in microvolts + +What: /sys/class/power_supply/rt9759-*/battery_current +Date: Nov 2022 +KernelVersion: 6.2 +Contact: ChiYuan Huang +Description: + Reports the current BAT current. + + Access: Read-Only + + Valid values: Represented in microamps