From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DE66916F28D; Tue, 28 May 2024 13:54:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716904453; cv=none; b=kaI10S4bASOpcNgmgPhmj4h97luLzr0W5PC01TexXCfkHoL98E//fOiOmJwIwqtpXjBaF08zXzFbdlCzPG3aKwO2vNtuBUzqH4y3xo48BULUl7kMX8CahoLYfSZjxTDmeQy/sslrFym+BnzKKv7dqUtwMqgXZXy+F6eiEGBXMbU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716904453; c=relaxed/simple; bh=UtW80uEs+aWVSEa5xEsRYkywVYopLJrIjVEObYGzDgw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=PhSykQWNpxJLzsZ5zurAY4rUD3s3uhjW7NmoJHobuNKtYeSWK8wuxq7Pdotsz/k0mCgd+8aOtqukKViO6HPlz/SBUcrjr5Hbf0KTu7foIC9hJjxa+0pI3NdpBPaRLUeKJrPqvI0TZUh7ibzgmOdqQqp12kqCgzG5lU4so/RCNsY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RxtqWQYb; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RxtqWQYb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE38BC3277B; Tue, 28 May 2024 13:54:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716904452; bh=UtW80uEs+aWVSEa5xEsRYkywVYopLJrIjVEObYGzDgw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=RxtqWQYbWJDPqjds4o2wDNQrwyx5K3/6iGNFwIsyvcRrXcmeVYs+2c1pO5C6w5CA9 qiz/BA7QSwMr0ctptZui2bblTMWKc4KrTMHkkmFoTeNyYl6CfijIaKVszE9YF2oohX 6RVNDZFWOuMFasRmmmi/8GBNrwxMo+zN3Dc0js0FU8oKRD9GK+9wsTxble6Lzk1+ef wazA8+J1BNlBanmbIDHCJefQPHvkJovyNP3xx8bqVsaKpftdmUbKJmZl6gFzFaOAzS rfUxYWlzjYEbN8PaElRGBYr8denMZAl54KKNsu/pCNcsVhqDF8XmYLjcMbCFsGAEwm OC1vP32nVpB3A== Message-ID: <3a29c775-4131-4047-9777-4146e6c8eed0@kernel.org> Date: Tue, 28 May 2024 15:54:05 +0200 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH] dt-bindings: regulator: twl-regulator: convert to yaml To: Andreas Kemnade Cc: lee@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, lgirdwood@gmail.com, broonie@kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org References: <20240528065756.1962482-1-andreas@kemnade.info> <20240528131622.4b4f8d03@aktux> <20240528150647.40385d08@aktux> From: Krzysztof Kozlowski Content-Language: en-US Autocrypt: addr=krzk@kernel.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrm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tB YpsFAmA872oFCRRflLYACgkQG5NDfTtBYpvScw/9GrqBrVLuJoJ52qBBKUBDo4E+5fU1bjt0 Gv0nh/hNJuecuRY6aemU6HOPNc2t8QHMSvwbSF+Vp9ZkOvrM36yUOufctoqON+wXrliEY0J4 ksR89ZILRRAold9Mh0YDqEJc1HmuxYLJ7lnbLYH1oui8bLbMBM8S2Uo9RKqV2GROLi44enVt vdrDvo+CxKj2K+d4cleCNiz5qbTxPUW/cgkwG0lJc4I4sso7l4XMDKn95c7JtNsuzqKvhEVS oic5by3fbUnuI0cemeizF4QdtX2uQxrP7RwHFBd+YUia7zCcz0//rv6FZmAxWZGy5arNl6Vm lQqNo7/Poh8WWfRS+xegBxc6hBXahpyUKphAKYkah+m+I0QToCfnGKnPqyYIMDEHCS/RfqA5 t8F+O56+oyLBAeWX7XcmyM6TGeVfb+OZVMJnZzK0s2VYAuI0Rl87FBFYgULdgqKV7R7WHzwD uZwJCLykjad45hsWcOGk3OcaAGQS6NDlfhM6O9aYNwGL6tGt/6BkRikNOs7VDEa4/HlbaSJo 7FgndGw1kWmkeL6oQh7wBvYll2buKod4qYntmNKEicoHGU+x91Gcan8mCoqhJkbqrL7+nXG2 5Q/GS5M9RFWS+nYyJh+c3OcfKqVcZQNANItt7+ULzdNJuhvTRRdC3g9hmCEuNSr+CLMdnRBY fv0= In-Reply-To: <20240528150647.40385d08@aktux> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 28/05/2024 15:06, Andreas Kemnade wrote: > On Tue, 28 May 2024 13:25:29 +0200 > Krzysztof Kozlowski wrote: > >> On 28/05/2024 13:16, Andreas Kemnade wrote: >>> On Tue, 28 May 2024 12:04:22 +0200 >>> Krzysztof Kozlowski wrote: >>> >>>> On 28/05/2024 08:57, Andreas Kemnade wrote: >>>>> Convert the regulator bindings to yaml files. To allow only the regulator >>>>> compatible corresponding to the toplevel mfd compatible, split the file >>>>> into one per device. >>>>> >>>>> To not need to allow any subnode name, specify clearly node names >>>>> for all the regulators. >>>>> >>>>> Drop one twl5030 compatible due to no documentation on mfd side and no >>>>> users of the twl5030. >>>>> >>>>> Signed-off-by: Andreas Kemnade >>>>> --- >>>>> Reason for being RFC: >>>>> the integration into ti,twl.yaml seems not to work as expected >>>>> make dt_binding_check crashes without any clear error message >>>>> if used on the ti,twl.yaml >>>>> >>>>> .../devicetree/bindings/mfd/ti,twl.yaml | 4 +- >>>>> .../regulator/ti,twl4030-regulator.yaml | 402 ++++++++++++++++++ >>>>> .../regulator/ti,twl6030-regulator.yaml | 292 +++++++++++++ >>>>> .../regulator/ti,twl6032-regulator.yaml | 238 +++++++++++ >>>>> .../bindings/regulator/twl-regulator.txt | 80 ---- >>>>> 5 files changed, 935 insertions(+), 81 deletions(-) >>>>> create mode 100644 Documentation/devicetree/bindings/regulator/ti,twl4030-regulator.yaml >>>>> create mode 100644 Documentation/devicetree/bindings/regulator/ti,twl6030-regulator.yaml >>>>> create mode 100644 Documentation/devicetree/bindings/regulator/ti,twl6032-regulator.yaml >>>>> delete mode 100644 Documentation/devicetree/bindings/regulator/twl-regulator.txt >>>>> >>>>> diff --git a/Documentation/devicetree/bindings/mfd/ti,twl.yaml b/Documentation/devicetree/bindings/mfd/ti,twl.yaml >>>>> index c2357fecb56cc..4ced6e471d338 100644 >>>>> --- a/Documentation/devicetree/bindings/mfd/ti,twl.yaml >>>>> +++ b/Documentation/devicetree/bindings/mfd/ti,twl.yaml >>>>> @@ -50,7 +50,7 @@ allOf: >>>>> properties: >>>>> compatible: >>>>> const: ti,twl4030-wdt >>>>> - >>>>> + $ref: /schemas/regulator/ti,twl4030-regulator.yaml >>>> >>>> That's not needed, just like othehr refs below. >>>> >>> but how to prevent error messages like this: >>> >>> arch/arm/boot/dts/ti/omap/omap2430-sdp.dtb: twl@48: Unevaluated properties are not allowed ('gpio', 'keypad', 'pwm', 'pwmled', 'regulator-vaux1', 'regulator-vaux2', 'regulator-vaux3', 'regulator-vaux4', 'regulator-vdac', 'regulator-vdd1', 'regulator-vintana1', 'regulator-vintana2', 'regulator-vintdig', 'regulator-vio', 'regulator-vmmc1', 'regulator-vmmc2', 'regulator-vpll1', 'regulator-vpll2', 'regulator-vsim', 'regulator-vusb1v5', 'regulator-vusb1v8', 'regulator-vusb3v1 >>> >>> esp. the regulator parts without adding stuff to ti,twl.yaml? >> >> Eh? That's a watchdog, not regulator. Why do you add ref to regulator? >> > hmm, wrongly indented? At what level doet it belong? But as the regualor.yaml stuff can > be shortened, maybe just add it directly to ti,twl.yaml to avoid that trouble. I don't follow. The diff here and in other two places suggest you add twl-regulator reference to wdt/gpio/whatnot nodes, not to regulators. > >> ... >> >>>>> + >>>>> + regulator-vaux2: >>>>> + type: object >>>>> + $ref: regulator.yaml# >>>>> + unevaluatedProperties: false >>>>> + properties: >>>>> + compatible: >>>>> + const: "ti,twl4030-vaux2" >>>>> + >>>>> + regulator-initial-mode: >>>>> + items: >>>>> + - items: >>>>> + enum: >>>>> + - 0x08 # Sleep mode, the nominal output voltage is maintained >>>>> + # with low power consumption with low load current capability >>>>> + - 0x0e # Active mode, the regulator can deliver its nominal output >>>>> + # voltage with full-load current capability >>>> >>>> These entries are the same. Just use patternProperties and enum for >>>> compatible. >>>> >>> hmm, if I am using that, how do I prevent e.g. constructions like this to be >>> valid? >>> >>> regulator-vaux2 { >>> compatible = "ti,twl4030-vaux1"; >>> }; >>> >> >> Why would node name matter if you have compatible? The entire point of >> compatibles is to not to rely on node names. >> > Hmm, even if we rely on them, it should somehow match what is inside that node > usually. We have @xx and reg=; e.g. So relax the stuff to allowing I don't follow what reg has anything to do with it. There are no reg properties in regulator nodes. > any regulator-.* as node name independently of the contents? As I said: patternProperties+enum BTW, the example in MFD (so main node) is heavily incomplete. This should be full, complete, passing dt_binding_check example. > > And since that all is then shorter, maybe add stuff just directly to ti,twl.yaml? Sure. Best regards, Krzysztof