From patchwork Thu Oct 20 07:14:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: cy_huang X-Patchwork-Id: 616949 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 2CD79C43217 for ; Thu, 20 Oct 2022 07:16:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230259AbiJTHQH (ORCPT ); Thu, 20 Oct 2022 03:16:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230345AbiJTHPx (ORCPT ); Thu, 20 Oct 2022 03:15:53 -0400 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FC86157F56; Thu, 20 Oct 2022 00:15:19 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id u71so18462204pgd.2; Thu, 20 Oct 2022 00:15:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=DJg3vkvL6mAQwIfI1Is4t7HAoGmIXrff5qn+0C2h0VA=; b=F3cXE7TKYCnQ4DYQVQ0V/K/TdvmV20wqnacqxzWZgxKePp+eBisnW/DmerLNdp6B0T fMfIwGr3wTiSBNQb50oZ42ko4YQrNIbHObY3gqQVhpWrhvdd6snGNewe38R9mj+4ZE1h 2HHYAmT2bXNKQJ3ASTfEadCah9/jVN3aw8DtxsTGORXRG7fP2pLHApxgbwuzqN+Op9VE +jDQQbhIzvcb0iMxUV5/POjCaRwkKrhp0/t3kel9pfE6p66PwwTkQyDOnLWRoGT/Xu0w R9TLvOJH3brmuIsmle8/XLmYyGZMluF43irYuKRshiBspsvKln9t9SplVt94xpyqgTud Mc8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=DJg3vkvL6mAQwIfI1Is4t7HAoGmIXrff5qn+0C2h0VA=; b=5ivlmVdYn5ooDOap17PL4w2yWzvXDWiEcnAGdtgim8rc8QNvp8PVN7d6F0OP5LbmAO aQul6vlDknAx4TAQIauh7nPHgwa3Vz/rRS5qwfobwusCM2Gxefxs+Y2ZHKUuBs6prkOX YcYItelLOFyFIEzv6tmOiJwQ+p+simzi9TTqHTOzSNGBcjrKAx3d6XJtE7FI4AUXTB6j r093kbCkGZ0Uk2rvZiOlCuwKYwSJsvMu0oe4ikyBHlLTqqhY56e/pX4O0cb2jO3nZOsB VqCl089p7F85AlDaDpeUt1wE8paPBrb9BwC9FZz7oRGIQIRlE49wrPB4Sp3wwNUcNvza QKvg== X-Gm-Message-State: ACrzQf2SjhyJDOq+tl2X/6E80S4Sou+Zk1ETHMzgIaFe8KKvI9qHjd4V yOr/DAjXWHvfQBZnlp6fmJc= X-Google-Smtp-Source: AMsMyM5ElIpVUnHkz/uiWTk0lecz039cAGsTQCkBc/IuyCFG0wBH3RELVlCJb2MHTjrC5HSptcJzKg== X-Received: by 2002:a65:6b8e:0:b0:44f:ec0f:f684 with SMTP id d14-20020a656b8e000000b0044fec0ff684mr10248386pgw.25.1666250072043; Thu, 20 Oct 2022 00:14:32 -0700 (PDT) Received: from localhost.localdomain ([2402:7500:569:a12c:444a:ed28:4831:fc95]) by smtp.gmail.com with ESMTPSA id m8-20020a170902db0800b0018157b415dbsm12094679plx.63.2022.10.20.00.14.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Oct 2022 00:14:31 -0700 (PDT) From: cy_huang To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, sre@kernel.org Cc: cy_huang@richtek.com, allen_chiang@richtek.com, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/3] dt-bindings: power: supply: Add Richtek RT9759 smart cap divider charger Date: Thu, 20 Oct 2022 15:14:19 +0800 Message-Id: <1666250061-18686-2-git-send-email-u0084500@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1666250061-18686-1-git-send-email-u0084500@gmail.com> References: <1666250061-18686-1-git-send-email-u0084500@gmail.com> 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 --- .../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 Thu Oct 20 07:14:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: cy_huang X-Patchwork-Id: 616948 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 828A2C4332F for ; Thu, 20 Oct 2022 07:16:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230383AbiJTHQa (ORCPT ); Thu, 20 Oct 2022 03:16:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230377AbiJTHP7 (ORCPT ); Thu, 20 Oct 2022 03:15:59 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BB311645D7; Thu, 20 Oct 2022 00:15:32 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id a6-20020a17090abe0600b0020d7c0c6650so2605424pjs.0; Thu, 20 Oct 2022 00:15:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=DmfdEJpNjjO+x1iePOhK0E+t1GpP7iYAwgO5IBrcKHc=; b=OE/GWaHtdBtupArnXxMRTPndWJWm9LKKuWmPpgTC9rb8de3se5I197W/Nx3hwg9ioK D4VBhqPyfePM9VAI7qWpWY8/j7K6mrOdZAwjtFT/yGneaLf+aiaJSdF7gV1Jcl3i7xWu uYbGCY38Tnq4Jr8KLiw5I0eGaTe9prvtxCp8CGBQ+v0nzpF9N6x5+6jdJ7pqS0JLAACp qVWUhN3FAqfxISoHEXAPi7hVaNeaIjzGGhla0x/hL7707esi23ZKQN4MG+eHA5c67RG0 8Sz6AdGFEIklNE1APzyac24ZQEFkJTM1xW8SQbUnNJzz5u2Jvk5YobAfIv8UfFR4AvwE jdkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=DmfdEJpNjjO+x1iePOhK0E+t1GpP7iYAwgO5IBrcKHc=; b=srZ9iVKVmcgfOhyfvOFjCRbIdCqW7FLus39rTjqdxCLc/QwznqaednB46hLO82Y06d bfFcNgHs0aA/W5EXFHfcjQ0wkEr7AeSr/WQeyPepPUQ5XGJVljWY2YYE+mxQf8a1tjXN i1ECYW2IBoxL+/emu5xva5/nR4Fzu7wwMPXQDhYlTfE1ta42RIirFaVOE1NunHJMaiSo LYW8WmXzBLqEEZ80ChG+Kv/MLcSFVehQlRwfb0Eh3u1fTOHU03WrrIU6Rt1UfBF3J7nQ xnpRGYrbPaoKxhRHTjkgOFjS5RhVVP9PGurDIL72bNLHXH5cW7pWDQFH7fEFW7nomS+J otIw== X-Gm-Message-State: ACrzQf1FdnUfftKBpyX/tCx/FjWBpNdI1XlYMM4/c6Vw5Xtj+9BecTKs PVp32DW8sEaCrd9tvCXfRY8= X-Google-Smtp-Source: AMsMyM6q7YeswKtR1nzftzrgrtTg0PTmQ4VTdLcJq0Q2ohGeXjSdMty9zwalFPzc5a1KE50Kc9pFew== X-Received: by 2002:a17:902:6bcc:b0:182:df88:e6c8 with SMTP id m12-20020a1709026bcc00b00182df88e6c8mr12645555plt.117.1666250083595; Thu, 20 Oct 2022 00:14:43 -0700 (PDT) Received: from localhost.localdomain ([2402:7500:569:a12c:444a:ed28:4831:fc95]) by smtp.gmail.com with ESMTPSA id m8-20020a170902db0800b0018157b415dbsm12094679plx.63.2022.10.20.00.14.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Oct 2022 00:14:43 -0700 (PDT) From: cy_huang To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, sre@kernel.org Cc: cy_huang@richtek.com, allen_chiang@richtek.com, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/3] Documentation: power: rt9759: Document exported sysfs entries Date: Thu, 20 Oct 2022 15:14:21 +0800 Message-Id: <1666250061-18686-4-git-send-email-u0084500@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1666250061-18686-1-git-send-email-u0084500@gmail.com> References: <1666250061-18686-1-git-send-email-u0084500@gmail.com> 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 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