From patchwork Fri May 20 18:30:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Morgan X-Patchwork-Id: 12857212 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 339CEC433FE for ; Fri, 20 May 2022 18:35:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BVSauqVl4zyn9exVuqTh+e6QaoQoJAI1gH2fCdViVq4=; b=oiZ/hPpN4sCb5w ntEQb2hgJjTqjURRj/XDAU0QvTKqi9xL+boghPP484lxRBGM3Ih0yBbbUAvnNS3qA8hSEKtb7Wz4M +L5QnkI9M9eu5lun3P1RSUCBDW5nZkiQG+evyblM2XmOaFoKCTauTuLu+kmKy1yQxL5K4FkSIZiw9 4MpHDI1ByjTlcU3yP4P0kdW+8H/R1Fdh9RXSorFY+jiZj2+VSnOFzzCmBUB7/tNdRs/OXPOwSuqzY atGbCyjXZoZgXhj0nD/7oPWgWvflM8O7IYK48aoiWJiXaWWM2RpzgRFq+r0hygp6ETKeT0AKTvI4o V8gQ6iXkjTnFNcNsCnIw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ns7Ru-00EB3G-8H; Fri, 20 May 2022 18:34:07 +0000 Received: from mail-ot1-x336.google.com ([2607:f8b0:4864:20::336]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ns7Oo-00E9I4-Pw; Fri, 20 May 2022 18:30:58 +0000 Received: by mail-ot1-x336.google.com with SMTP id v22-20020a05683011d600b0060aeae0b599so2749453otq.0; Fri, 20 May 2022 11:30:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=za+JFS8UrUe1EXtSy/HN8YRbGNE25Vj78rAPO0Rkf/g=; b=o6Tx0LzPHIhCpfrRIsc95kozM8a+KwgIDkmt8N/jDxvtQZqIPGgXK164juK2RVXwOX GWDJHgXi5NGg9NBQJW4Vru8DxkxlfjWiG9WGUekie0LgziLRuvTIraofgJp/QlQk+s7V h9dX77Ndbojz45f3QR2S2ixdbc2LTL5klQ31FbQUslkFOl02mqZQD3zxQL+tQWPlObFn o3WlsJVSE0FCUWnJ2aSMjlh6UJPgZ9UaW3fF2i16LEz2UpqpjPc+aYq/o2hT1jDa43er Qk6DY93E1MLDMXPBjXpIaT1IEEnwp53xeXkDon5AfzFpxgegcPzcR+nTiSMDBsQipGpL vk3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=za+JFS8UrUe1EXtSy/HN8YRbGNE25Vj78rAPO0Rkf/g=; b=Y4sUU2Wpw6FP4JveyS/bCtMOE7XTRB3r/0g5apy4gJLOoiz7wdN3+WyPTBgCHPHzzf cF699E+sYBpYC0VPE//dbkVDfM821gbBBERhRVV+5dmduESAaFggUtkIGiMz33M6MiIH RUrAFYSKufcEBDEM3Jd+K5839TUC10fxik0N3dhdK8StXnQYDfiVIDHIIyzcgmTuF0oQ cufARA3nOWDftehXPbRPd9uW03cgCP83zafWcCwg2qxzP+Ayepek6UL6wHxiZb5Y6GeF UI2BO8OoohDw5nMT8/0YqecS3Oyk0eH6pDZYBsfaa1ZqXx+3LPWxn0urmMVYJb1Bt2Re WLbA== X-Gm-Message-State: AOAM5327OaT4Jrk62Cey1vIP8YgB3P1Zuhmhi8UM4BClMmQPbd6c1cFy w/mPAdye64wfc5Clpa6Mr7A= X-Google-Smtp-Source: ABdhPJyerJGQBYBXYu2NsSfmJk2S2dCsqe0iHzS308XxRXfoTAcER2mEziZSk7jviJ+AgOc+c/A+bw== X-Received: by 2002:a9d:7dc2:0:b0:606:1ad9:9956 with SMTP id k2-20020a9d7dc2000000b006061ad99956mr4502990otn.214.1653071452656; Fri, 20 May 2022 11:30:52 -0700 (PDT) Received: from wintermute.localdomain (cpe-76-183-134-35.tx.res.rr.com. [76.183.134.35]) by smtp.gmail.com with ESMTPSA id w12-20020a4ab6cc000000b0035eb4e5a6d0sm1339467ooo.38.2022.05.20.11.30.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 May 2022 11:30:52 -0700 (PDT) From: Chris Morgan To: linux-pm@vger.kernel.org Cc: linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, lee.jones@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, heiko@sntech.de, sre@kernel.org, jon.lin@rock-chips.com, zyw@rock-chips.com, zhangqing@rock-chips.com, Chris Morgan , Maya Matuszczyk , Krzysztof Kozlowski Subject: [RESEND 1/4 v7] dt-bindings: Add Rockchip rk817 battery charger support Date: Fri, 20 May 2022 13:30:34 -0500 Message-Id: <20220520183037.2566-2-macroalpha82@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220520183037.2566-1-macroalpha82@gmail.com> References: <20220520183037.2566-1-macroalpha82@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220520_113054_914938_673F53C2 X-CRM114-Status: GOOD ( 13.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Chris Morgan Create dt-binding documentation to document rk817 battery and charger usage. New device-tree properties have been added. - rockchip,resistor-sense-micro-ohms: The value in microohms of the sample resistor. - rockchip,sleep-enter-current-microamp: The value in microamps of the sleep enter current. - rockchip,sleep-filter-current: The value in microamps of the sleep filter current. Signed-off-by: Chris Morgan Signed-off-by: Maya Matuszczyk Reviewed-by: Krzysztof Kozlowski Acked-by: Rob Herring --- Note that this patch requires the following commit (still pending): https://lore.kernel.org/linux-rockchip/20220519161731.1168-1-macroalpha82@gmail.com/ .../bindings/mfd/rockchip,rk817.yaml | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/Documentation/devicetree/bindings/mfd/rockchip,rk817.yaml b/Documentation/devicetree/bindings/mfd/rockchip,rk817.yaml index bfc1720adc43..d0dccb1aaf4c 100644 --- a/Documentation/devicetree/bindings/mfd/rockchip,rk817.yaml +++ b/Documentation/devicetree/bindings/mfd/rockchip,rk817.yaml @@ -117,6 +117,47 @@ properties: description: Describes if the microphone uses differential mode. + charger: + description: | + The child node for the charger to hold additional properties. If a + battery is not in use, this node can be omitted. + type: object + properties: + monitored-battery: + description: | + A phandle to a monitored battery node that contains a valid + value for: + charge-full-design-microamp-hours, + charge-term-current-microamp, + constant-charge-current-max-microamp, + constant-charge-voltage-max-microvolt, + voltage-max-design-microvolt, + voltage-min-design-microvolt, + and a valid ocv-capacity table. + + rockchip,resistor-sense-micro-ohms: + description: | + Value in microohms of the battery sense resistor. This value is + used by the driver to set the correct divisor value to translate + ADC readings into the proper units of measure. + enum: [10000, 20000] + + rockchip,sleep-enter-current-microamp: + description: | + Value in microamps of the sleep enter current for the charger. + Value is used by the driver to calibrate the relax threshold. + + rockchip,sleep-filter-current-microamp: + description: + Value in microamps of the sleep filter current for the charger. + Value is used by the driver to derive the sleep sample current. + + required: + - monitored-battery + - rockchip,resistor-sense-micro-ohms + - rockchip,sleep-enter-current-microamp + - rockchip,sleep-filter-current-microamp + allOf: - if: properties: @@ -323,6 +364,13 @@ examples: }; }; + rk817_charger: charger { + monitored-battery = <&battery>; + rockchip,resistor-sense-micro-ohms = <10000>; + rockchip,sleep-enter-current-microamp = <300000>; + rockchip,sleep-filter-current-microamp = <100000>; + }; + rk817_codec: codec { rockchip,mic-in-differential; };