From patchwork Tue Nov 8 05:48:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ChiaEn Wu X-Patchwork-Id: 622862 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 97527C433FE for ; Tue, 8 Nov 2022 05:49:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232548AbiKHFtV (ORCPT ); Tue, 8 Nov 2022 00:49:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233092AbiKHFtQ (ORCPT ); Tue, 8 Nov 2022 00:49:16 -0500 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B6262CE35; Mon, 7 Nov 2022 21:49:15 -0800 (PST) Received: by mail-pf1-x433.google.com with SMTP id b185so12868907pfb.9; Mon, 07 Nov 2022 21:49:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=W+TEMXtlD8IfIyObCOJOIDxMSfmiP50ZU+lxr4CNSac=; b=CcQIEsSxAgnaDV9YBaCU1fDGSrUS6pW2uZRJ3AD00icgA++4VKFKINOLqavdCpCABB L4nTKwO/HCbVxn3WT1SyJqdiOsdcPHaVxeIOi3DqkK+5EYFqjm/BAbmGb2RSyQVDuoIb 9BOT28yijRefEvTQjer9WvbzwPHnHcfiMgT6/TgQn9gOQFJ8UjUv1S8wVjoYdXs2ZMvd RSL6VJX+qKcsP7pjXHjeQ5OuU6kFBBEQrodWF6XC/RVz42MCt4zCTmyA8seRv6/0oBov Mzw9wDOuTTZGUlAMKruN6cNvBrAUSj/Wniel7maA253nj84vr8HuQDJ7s5OU7kk9ub98 nE/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version: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=W+TEMXtlD8IfIyObCOJOIDxMSfmiP50ZU+lxr4CNSac=; b=dMZXey/6ZgJVymZb0eGTaXgssPDmNA7JnuW2q8wuZA+1yxvlfxTJYAszdS8HfGMhq7 UlVCJrEELnAlVqvmUzT9z4ZyRm/nIMdeZ/WV9aPLWJNXRSn/2oM2dv2O6IJkr5ozJKay NAq1e83FFDRIKmus1MwNrmeT37yyhWkTgV+OWKMoySlyRNAm6gh5hPr+Y/Vw3u1ixM/G FJyjSBMLnQB0WnS3+OKeszMBxckMY396DEVc7tDfETeGIHzjm+R/chwBZ/en/wa0uqg8 pmuaK6a3I65Y8P5AR7mcpynCtoQJepqRzKx5fFBA/AM8Uq0g7FghT/tUdYRSB4IaZE7x e1Zw== X-Gm-Message-State: ACrzQf1MiB+lQiT2VaAMlLrXUu/5DDMl63oTaSGw2LJucM2PwOUxSO+h mV/u9RTqZuNz3gC2B5CufGM8htVEZQ6syw== X-Google-Smtp-Source: AMsMyM5wwYDaJS0QuGOlY/cl92Sc1KQDTLcZLhFoDIpjzqmj8d3NoKSZeaMwjwf6S9MRqr4Xlcs6wA== X-Received: by 2002:a63:ce0f:0:b0:46f:868f:291 with SMTP id y15-20020a63ce0f000000b0046f868f0291mr43886877pgf.23.1667886554725; Mon, 07 Nov 2022 21:49:14 -0800 (PST) Received: from RD-3580-24288.rt.l (42-72-183-173.emome-ip.hinet.net. [42.72.183.173]) by smtp.gmail.com with ESMTPSA id q10-20020aa7982a000000b005618189b0ffsm5482163pfl.104.2022.11.07.21.49.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Nov 2022 21:49:14 -0800 (PST) From: ChiaEn Wu To: sre@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org Cc: chiaen_wu@richtek.com, cy_huang@richtek.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Krzysztof Kozlowski Subject: [PATCH v3 RESEND 1/3] dt-bindings: power: supply: Add Richtek RT9467 battery charger Date: Tue, 8 Nov 2022 13:48:52 +0800 Message-Id: <9015389176cd56328256511106bae0060c63b809.1667886055.git.chiaen_wu@richtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: ChiaEn Wu Add bindings for the Richtek RT9467 battery charger. Reviewed-by: Krzysztof Kozlowski Co-developed-by: ChiYuan Huang Signed-off-by: ChiYuan Huang Signed-off-by: ChiaEn Wu --- .../power/supply/richtek,rt9467-charger.yaml | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 Documentation/devicetree/bindings/power/supply/richtek,rt9467-charger.yaml diff --git a/Documentation/devicetree/bindings/power/supply/richtek,rt9467-charger.yaml b/Documentation/devicetree/bindings/power/supply/richtek,rt9467-charger.yaml new file mode 100644 index 000000000000..92c570643d2c --- /dev/null +++ b/Documentation/devicetree/bindings/power/supply/richtek,rt9467-charger.yaml @@ -0,0 +1,82 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/power/supply/richtek,rt9467-charger.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Richtek RT9467 Switching Battery Charger with Power Path Management + +maintainers: + - ChiYuan Huang + - ChiaEn Wu + +description: | + RT9467 is a switch-mode single cell Li-Ion/Li-Polymer battery charger for + portable applications. It integrates a synchronous PWM controller, power + MOSFETs, input current sensing and regulation, high-accuracy voltage + regulation, and charge termination. The charge current is regulated through + integrated sensing resistors. + + The RT9467 also features USB On-The-Go (OTG) support. It also integrates + D+/D- pin for USB host/charging port detection. + + Datasheet is available at + https://www.richtek.com/assets/product_file/RT9467/DS9467-01.pdf + +properties: + compatible: + const: richtek,rt9467-charger + + reg: + maxItems: 1 + + wakeup-source: true + + interrupts: + maxItems: 1 + + charge-enable-gpios: + description: GPIO is used to turn on and off charging. + maxItems: 1 + + usb-otg-vbus-regulator: + type: object + description: OTG boost regulator. + unevaluatedProperties: false + $ref: /schemas/regulator/regulator.yaml# + + properties: + enable-gpios: true + +required: + - compatible + - reg + - wakeup-source + - interrupts + +additionalProperties: false + +examples: + - | + #include + #include + i2c { + #address-cells = <1>; + #size-cells = <0>; + + charger@5b { + compatible = "richtek,rt9467-charger"; + reg = <0x5b>; + wakeup-source; + interrupts-extended = <&gpio_intc 32 IRQ_TYPE_LEVEL_LOW>; + charge-enable-gpios = <&gpio26 1 GPIO_ACTIVE_LOW>; + + rt9467_otg_vbus: usb-otg-vbus-regulator { + regulator-name = "rt9467-usb-otg-vbus"; + regulator-min-microvolt = <4425000>; + regulator-max-microvolt = <5825000>; + regulator-min-microamp = <500000>; + regulator-max-microamp = <3000000>; + }; + }; + }; From patchwork Tue Nov 8 05:48:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ChiaEn Wu X-Patchwork-Id: 622861 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 27B6DC4332F for ; Tue, 8 Nov 2022 05:49:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233072AbiKHFtt (ORCPT ); Tue, 8 Nov 2022 00:49:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233297AbiKHFtn (ORCPT ); Tue, 8 Nov 2022 00:49:43 -0500 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB62F2E9CD; Mon, 7 Nov 2022 21:49:36 -0800 (PST) Received: by mail-pg1-x52e.google.com with SMTP id 136so8639117pga.1; Mon, 07 Nov 2022 21:49:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MgJSdtU2k5DHs16MCkmtC7fasexNDJAPB3/Jh9qcLJg=; b=O1WXNYXCeEv11oFl6wIZZZ2CfjeZzVTv7ojV+HM4+LbUW7uYiHRmAH3LvXHHmjAwof 7fokGGn27suaU4Vxmk/khPxN5qjLva7maF103xU9SC3l8dLVaX1Wt/WXIGfwy6gVZIaw 7NKY7opDTR8F1Do3bWWPk53El4G5AaJQk21jRVAUxE//2sqnYCT/zZ7CPAU40+wNf4Uj Z3XpmkONp/CoX2IIg8jAJIZ5Uz51E2ESybP3mau7yjDmOaqIz8aWMyb0VHN1A8svaq3T DOjthhm1tBfcMH0RRHC7FZ4Cfwf0p4gIok42r5XZxRQf4QoSbi0fv18bdfCDUYNiYakJ E51w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version: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=MgJSdtU2k5DHs16MCkmtC7fasexNDJAPB3/Jh9qcLJg=; b=o6yqSrg7bZaj/csEuDx72IeGGrRF9JYRenkNPEF5S+k6A5ZXac3T+a/q9aaMMrLuh6 SuKq6RtNFLn1JGinQXgmhPB3im8g8EMoW/QTO+yPt6Sp0AhGQNCIvXzvuulEHYvIL+Qg Ly5tgRdtNp1l0GFmx6mVyCR+nRgXe7WZF3s3+spYQwCuDy/AgMj4/8XlXpKigEhCUOOD uyzzSwh5G2e2+Co5IMicfKg0gik742JHlnDifbCHC7uWKioZi1tJaks8Kcuep7ZCsdfj 3KgxJ3aEnlmejV+2+xbYelLvE3GIRGCpf5oVQsjwX4SfDB6pbNb1EQxZOI/m28YeBIlC 2Trg== X-Gm-Message-State: ACrzQf298NQvg8vPiOb6y9wrNLTmNb8wJkKq+ZUJdiiGyGLhb2cSZFrU riUfTtahn0G5uFf+smVA8xQ= X-Google-Smtp-Source: AMsMyM6DJ/t8gVDmyoGQbU9iX/WuaAVtDMwQihMbaK87v5/uOFTU5EuTfc/6T+QpN+Gckj72BNFHMg== X-Received: by 2002:a63:224f:0:b0:438:cdf9:ef63 with SMTP id t15-20020a63224f000000b00438cdf9ef63mr941336pgm.345.1667886576519; Mon, 07 Nov 2022 21:49:36 -0800 (PST) Received: from RD-3580-24288.rt.l (42-72-183-173.emome-ip.hinet.net. [42.72.183.173]) by smtp.gmail.com with ESMTPSA id q10-20020aa7982a000000b005618189b0ffsm5482163pfl.104.2022.11.07.21.49.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Nov 2022 21:49:36 -0800 (PST) From: ChiaEn Wu To: sre@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org Cc: chiaen_wu@richtek.com, cy_huang@richtek.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH v3 RESEND 3/3] Documentation: power: rt9467: Document exported sysfs entries Date: Tue, 8 Nov 2022 13:48:56 +0800 Message-Id: <3e22d5b2f59134e7c4a2d3c32db2132cc30b76dd.1667886055.git.chiaen_wu@richtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: ChiaEn Wu Document the settings exported by rt9467 charger driver through sysfs entries: - sysoff_enable Signed-off-by: ChiaEn Wu --- .../ABI/testing/sysfs-class-power-rt9467 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-class-power-rt9467 diff --git a/Documentation/ABI/testing/sysfs-class-power-rt9467 b/Documentation/ABI/testing/sysfs-class-power-rt9467 new file mode 100644 index 000000000000..dd0b962f6fd4 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-class-power-rt9467 @@ -0,0 +1,19 @@ +What: /sys/class/power_supply/rt9467-*/sysoff_enable +Date: Oct 2022 +KernelVersion: 6.0 +Contact: ChiaEn Wu +Description: + This entry allows enabling the sysoff mode of rt9467 charger + devices. + If enabled and the input is removed, the internal battery FET + is turned off to reduce the leakage from the BAT pin. See + device datasheet for details. It's commonly used when the + product enter shipping stage. After entering shipping mode, + only 'VBUS' or 'Power key" pressed can make it leave this mode. + 'Disable' also can help to leave it, but it's more like to + abort the action before the device really enter shipping mode. + + Access: Read, Write + Valid values: + - 1: enabled + - 0: disabled