Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp5977743rwe; Tue, 18 Apr 2023 14:46:08 -0700 (PDT) X-Google-Smtp-Source: AKy350ZwbpL4/0flhL/rLW/chnANSIlCEsdSlDpc1xZKEvpZmLJXJsRLgBVxgVj53dZo5qL4iWEu X-Received: by 2002:a17:903:41cc:b0:1a4:fca9:7f44 with SMTP id u12-20020a17090341cc00b001a4fca97f44mr3915149ple.56.1681854368502; Tue, 18 Apr 2023 14:46:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681854368; cv=none; d=google.com; s=arc-20160816; b=xqnHQ1nMk7p6OfEPfR8G/GURbG6cvdEqMkspOaBKW5vnkfHp6Rfb4ucE6D9MnSgWLd JeZHHCJTmtjdtyDFCg5V2K6T5azq2kNqjpf2wIJeImyk3o2BjvOh7F7dhW2+ks8+Y2eX eXZXperBZUo6vbYk4TFDO2nw5AQXlu9EHgGzo7zGdxtSRfQ4sG10Y2T7l9w6+w3nPWms FhOas+hfZfzcXEgCjdfD2FxvApBsh2k1CJhGCHbsoGWv5u2MWlUSqtjOO8Iu665VkGRM N8A8UEO1FI8HGLDAVYqxBNnLLLt0BymHea7MduXCzffNoRRbpYW84tp5MvG0j5Lb7TlO tHEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=XzIfjNAQ6FWOx9wfnDuWL7QaL/nlgGrtEUaAu68jgNk=; b=KaHQnlH7OA8PrlQD9zEcSoEdYpa6Sp8FeCFNqZag289MePm9I7a1Ttoj4+0Rnyz5Y1 npN/Wu3Pd0OTTT1XUqN02SOapETiCOFikqkTSCp65sY5nI5HwnvqZdfjsjuv8Q5UpWvB KvoWYVDCZMYNxZvXdXl4jWLMnSeLtuE5FD+U6aa5iwyoydU3K8+U322cvV5XFuRzNEZH 8sqG1s14ZXlMTRpiyg2gGArynXgWYU6/NgogqDpt93PH8eje91+uuof5Na4LjgnAj/i1 pfP/MOIbJk+oEdBF4hoSi07IV2zCwBZRabryYycRrIWAzaVH8J8ie6QnwRpYG5HQcFs7 K9uA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rocketmail.com header.s=s2048 header.b=K10sEsAx; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=rocketmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kb14-20020a170903338e00b0019f73eb630fsi13500865plb.637.2023.04.18.14.45.55; Tue, 18 Apr 2023 14:46:08 -0700 (PDT) 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; dkim=pass header.i=@rocketmail.com header.s=s2048 header.b=K10sEsAx; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=rocketmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233029AbjDRVhn (ORCPT + 99 others); Tue, 18 Apr 2023 17:37:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233023AbjDRVhl (ORCPT ); Tue, 18 Apr 2023 17:37:41 -0400 Received: from sonic303-21.consmr.mail.ir2.yahoo.com (sonic303-21.consmr.mail.ir2.yahoo.com [77.238.178.202]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E68A9130 for ; Tue, 18 Apr 2023 14:37:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rocketmail.com; s=s2048; t=1681853858; bh=XzIfjNAQ6FWOx9wfnDuWL7QaL/nlgGrtEUaAu68jgNk=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From:Subject:Reply-To; b=K10sEsAxNOLuEzfPIXLMaXrEAff0CNh/gdrjTIzXuf1lhHnpqa/e3nEmvkjPCtguF8XVvlD0X2/O3jfdz/kl1lA2/H85zMTw7sUtRG22LJKh9jLA0vgWgKjvVW7lIJaTxCjNXiPcXuNc0cVBiXJMc+Cg8Rn/UFVlzv6Ys1Ln5jCrnOGRcVE2PS8z+HTNSKBv21SKNNq/RI8CULyDq5A9Jc/k/P7Gf3KfExpfzybUdWx4MAKW8VFeDl3ZXNLRFRuRZg/Rj/RQSGwPC7zIWC9Eq6sX91SFnGP7tFvqtMMFIYVxtVgRHBAT36RLYGLk2XCZF1je3HVXUCXHfDe4MDXq5w== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1681853858; bh=WV2DLFekiIbEc+LCArbaTU5I1VXksIPwPpKJhX5vxqk=; h=X-Sonic-MF:Date:Subject:To:From:From:Subject; b=uO3yPI2DWI0XuO638EV66MLlA224h/kPQAS1h6sEegzbKtNJnxLZ6JXhiYFOaLcUMohR/H7HiJoMwjuXWCX+VO2wavESHoa3zpUCZpzSbATTJ/EsTiNuU3wUotqtMuwtRmVeHImYz0XBlC9Sdnx++8FhVRKIykjvPMM+WBtQKJbwyhlyx1i+VMb4c3zgAr5XSjdEE9EzkIZOHU0j2lW1ETnof/rnpgL9Zw4cghqDVZPtYYrhgZg8+hix+lusatoZd0G4zLVP5nRrxJ1NQaj8JssYbhqopgm0g2m9Yzx6ekLKo1tDDzKiHWDR5OXLqqIOg3khlIKm8uvzO7lzfH+hNw== X-YMail-OSG: 48mMsVEVM1nWwYYoYYKD.71nu_WYVXCi2lhCa4lRmXgS9KqlTOKWEwy3epxrqPP bO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VD6R8VvftrB0zMYXYb70sGt.l7GTSd8 pCU6nTjydIL8A0NXoyQbLMwJT2sT7UPJhEYRuThDy3XHapEdBpg7GkU6naKo7uc6MrIZN0NOK6TQ .a5Oo47cJRuItgHH6Iz2.mfilKUEnETY- X-Sonic-MF: X-Sonic-ID: a23b155f-b731-427b-96a7-ab05bfc3913d Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.ir2.yahoo.com with HTTP; Tue, 18 Apr 2023 21:37:38 +0000 Received: by hermes--production-ir2-74cd8fc864-29g5c (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 796ce50f401174f98ec284de7688bf1b; Tue, 18 Apr 2023 21:37:35 +0000 (UTC) Message-ID: Date: Tue, 18 Apr 2023 23:37:33 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH v2 9/9] dt-bindings: Add documentation for rt5033 mfd, regulator and charger To: Krzysztof Kozlowski Cc: Sebastian Reichel , Lee Jones , Liam Girdwood , Mark Brown , Rob Herring , Beomho Seo , Chanwoo Choi , Stephan Gerhold , Raymond Hackley , Pavel Machek , Axel Lin , ChiYuan Huang , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht References: <9275af790e6e21b5cf661a2444effe4caf2be02e.1681646904.git.jahau@rocketmail.com> <5b41b54c-88d0-3666-9db2-9cbb90ba8183@linaro.org> Content-Language: en-US From: Jakob Hauser In-Reply-To: <5b41b54c-88d0-3666-9db2-9cbb90ba8183@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Mailer: WebService/1.1.21365 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Hi Krzysztof, On 16.04.23 20:39, Krzysztof Kozlowski wrote: > On 16/04/2023 14:44, Jakob Hauser wrote: >> Add device tree binding documentation for rt5033 multifunction device, voltage >> regulator and battery charger. > > Subject: drop second/last, redundant "documentation". The "dt-bindings" > prefix is already stating that these are documentation. If I understand correctly, the new subject would be: "dt-bindings: Add rt5033 mfd, regulator and charger" ... >> + i2c { >> + #address-cells = <1>; >> + #size-cells = <0>; >> + >> + pmic@34 { >> + compatible = "richtek,rt5033"; >> + reg = <0x34>; >> + >> + interrupt-parent = <&msmgpio>; >> + interrupts = <62 IRQ_TYPE_EDGE_FALLING>; >> + >> + pinctrl-names = "default"; >> + pinctrl-0 = <&pmic_int_default>; >> + >> + regulators { >> + safe_ldo_reg: safe_ldo { > > If you could change it: No underscores in node names... but you cannot. > This is old driver so you will break the users. As discussed on patch 5, I'll leave the regulator names unchanged. Thus, I'll reset them to the original uppercase spelling. >> + regulator-name = "safe_ldo"; >> + regulator-min-microvolt = <4900000>; >> + regulator-max-microvolt = <4900000>; >> + regulator-always-on; >> + }; >> + ldo_reg: ldo { >> + regulator-name = "ldo"; >> + regulator-min-microvolt = <2800000>; >> + regulator-max-microvolt = <2800000>; >> + }; >> + buck_reg: buck { >> + regulator-name = "buck"; >> + regulator-min-microvolt = <1200000>; >> + regulator-max-microvolt = <1200000>; >> + }; >> + }; ... >> diff --git a/Documentation/devicetree/bindings/power/supply/richtek,rt5033-charger.yaml b/Documentation/devicetree/bindings/power/supply/richtek,rt5033-charger.yaml >> new file mode 100644 >> index 000000000000..439e0b7962f3 >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/power/supply/richtek,rt5033-charger.yaml >> @@ -0,0 +1,76 @@ >> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) >> +%YAML 1.2 >> +--- >> +$id: http://devicetree.org/schemas/power/supply/richtek,rt5033-charger.yaml# >> +$schema: http://devicetree.org/meta-schemas/core.yaml# >> + >> +title: Richtek RT5033 PIMC Battery Charger >> + >> +maintainers: >> + - Jakob Hauser >> + >> +description: >> + The battery charger of the multifunction device RT5033 has to be instantiated >> + under sub-node named "charger" using the following format. >> + >> +properties: >> + compatible: >> + const: richtek,rt5033-charger >> + >> + richtek,pre-microamp: >> + description: >> + Current of pre-charge mode. The pre-charge current levels are 350 mA to >> + 650 mA programmed by I2C per 100 mA. > > minimum: > maximum: > multipleOf: 100 > > Same for other cases. The "multipleOf: 100" doesn't seen appropriate to me when the choice is 350, 450, 550, 650. Those are not multiples of 100. It's more of a step size. I didn't find a general property for step size. Listing them as "enum" would be another possibility, I guess, but not an elegant one. Especially for property "richtek,const-microvolt" there are 30 possibilities. Using "multipleOf" and unit microamp, the block would then look like this: richtek,pre-microamp: description: Current of pre-charge mode. The pre-charge current levels are 350 mA to 650 mA programmed by I2C per 100 mA. minimum: 350000 maximum: 650000 multipleOf: 100000 maxItems: 1 Or possibly better readable the following way: richtek,pre-microamp: description: Current of pre-charge mode. The pre-charge current levels are 350 mA to 650 mA programmed by I2C per 100 mA. maxItems: 1 items: minimum: 350000 maximum: 650000 multipleOf: 100000 >> + maxItems: 1 >> + >> + richtek,fast-microamp: >> + description: >> + Current of fast-charge mode. The fast-charge current levels are 700 mA >> + to 2000 mA programmed by I2C per 100 mA. >> + maxItems: 1 >> + >> + richtek,eoc-microamp: >> + description: >> + This property is end of charge current. Its level ranges from 150 mA to >> + 600 mA. Between 150 mA and 300 mA in 50 mA steps, between 300 mA and 600 mA >> + in 100 mA steps. >> + maxItems: 1 Here are two different step sizes. The first few are 50 mA steps (150, 200, 250, 300 mA) and then it changes to 100 mA steps (300, 400, 500, 600 mA). How to deal with that? Again I guess "enum" would be a possibility, but again not a nice one. >> + >> + richtek,pre-threshold-microvolt: >> + description: >> + Voltage of pre-charge mode. If the battery voltage is below the pre-charge >> + threshold voltage, the charger is in pre-charge mode with pre-charge current. >> + Its levels are 2.3 V to 3.8 V programmed by I2C per 0.1 V. >> + maxItems: 1 >> + >> + richtek,const-microvolt: >> + description: >> + Battery regulation voltage of constant voltage mode. This voltage levels from >> + 3.65 V to 4.4 V by I2C per 0.025 V. >> + maxItems: 1 >> + >> + extcon: >> + description: >> + Phandle to the extcon device. >> + maxItems: 1 ... >> diff --git a/Documentation/devicetree/bindings/regulator/richtek,rt5033-regulator.yaml b/Documentation/devicetree/bindings/regulator/richtek,rt5033-regulator.yaml >> new file mode 100644 >> index 000000000000..66c8a0692e10 >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/regulator/richtek,rt5033-regulator.yaml >> @@ -0,0 +1,24 @@ >> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) >> +%YAML 1.2 >> +--- >> +$id: http://devicetree.org/schemas/regulator/richtek,rt5033-regulator.yaml# >> +$schema: http://devicetree.org/meta-schemas/core.yaml# >> + >> +title: Richtek RT5033 PIMC Voltage Regulator > > You should explain in commit msg that you document existing driver in > the Linux kernel. We would not cut some slack, e.g. stricter rules > applied to new bindings. > >> + >> +maintainers: >> + - Jakob Hauser >> + >> +description: >> + The regulators of RT5033 have to be instantiated under a sub-node named >> + "regulators". For "safe_ldo" voltage there is only one value of 4.9 V. "ldo" >> + voltage ranges from 1.2 V to 3.0 V in 0.1 V steps. "buck" voltage ranges from >> + 1.0 V to 3.0 V in 0.1 V steps. >> + >> +patternProperties: >> + "^(safe_ldo|ldo|buck)$": >> + type: object >> + $ref: /schemas/regulator/regulator.yaml# > > Just squash it with parent schema. No real benefits of having regulators > separate - it's very small one. OK, I'll squash the regulator schema into the mfd schema. Kind regards, Jakob