Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2660042lqb; Tue, 28 May 2024 06:55:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX8KKr2tpaKWMTPx57ka3Mm3IE6iHpwQV5u+wJl3W7E2zjP/+3EcTGZ3mgR6xsb6n1tjjhwI/MEjYsB1JEwOoBPakmmylpmGPl4smvQtA== X-Google-Smtp-Source: AGHT+IH/HsuuxxleugiSGk+DFIBs/4qHhbLzcNrONcF/6BZsWWk1vMCcXdvt43yPj+Cg8AepNlOQ X-Received: by 2002:a19:8c58:0:b0:51f:53e0:1bc3 with SMTP id 2adb3069b0e04-529646df12bmr7057815e87.25.1716904502278; Tue, 28 May 2024 06:55:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716904502; cv=pass; d=google.com; s=arc-20160816; b=EXtbMN7W0Muaf3qYzI0TJ0jkUxg95vEAZPLJhD/Lr6oob4IkeRi2RbjiHMMqXaN4iT x0oz/vqwo450PSUO4IPplNC6qZ/F/Yj8MiiKCgJ2lJRIDUCJnSnTrb1yVLQDV0vbMNk3 sH7ieqc3spd0YCn2/S9rfJWdeGunsVH2C5/UQXSiUu/x1MV3SZr8vzZHdEZuC79oPNf8 oW5+b1Rkh1GbeEtd7vHCipnzDQWsjn0/xI+sth4n4Wh4hP8qULJxRN13iqJPMGQDLLDE HoCVHHM8UQSxQRWpSwWQUjM1qJh9fjkL7FgWnG65dlXluPPz4DbRldDmZHsZncyqKKkq 0peQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=mLMWVRTaOLRAB8IdVDtqL4iSxDwELmfOysGbKcxCMsg=; fh=S/XYhFYNA4zpWYua2bvsddqzbz1oTo2ets80xPGd0i0=; b=OMqm3bTVSR+lpHYFru4vcomZ/H/DTqGf4sc1aqxHBtjTwVmikYTj6k7eufgPXb82N7 fldmRwqK9B4942R+FSjEjOfE5oAOmghZyTCjRvFXcBJ0QBB5VjQegSJLNOk1cDQL9K7n xx/T6ZLjH5LwIYSqwRQP/zZrrrFXFhq2HZMclaNqjgqMEk/25iC0hMgKyh9ywY9ujDdg mgd5pyNxQyTWn+vvP4sK9sA3P7RFng/qYVvpC3V0oo4jC3X5aatHcXzJ0Z1lsnzDHcdt Z9D4r0Exfmjkq+cgtOqRSzfSYP6hYTchIV8tri+ayUgeTH5qQYyReiQ1PCkIchKTPu4q uhRA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RxtqWQYb; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-192469-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192469-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5786225c18asi4455329a12.158.2024.05.28.06.55.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 06:55:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-192469-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RxtqWQYb; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-192469-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192469-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C5EAA1F23CB4 for ; Tue, 28 May 2024 13:55:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1162516F84B; Tue, 28 May 2024 13:54:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RxtqWQYb" 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 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: linux-kernel@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 JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM Pd8/6CBVjEWqD06/RjI2AnjIq5fSEH/BIfXXfC68nMp9BZoy3So4ZsbOlBmtAPvMYX6U8VwD TNeBxJu5Ex0Izf1NV9CzC3nNaFUYOY8KfN01X5SExAoVTr09ewARAQABzSVLcnp5c3p0b2Yg S296bG93c2tpIDxrcnprQGtlcm5lbC5vcmc+wsGVBBMBCgA/AhsDBgsJCAcDAgYVCAIJCgsE FgIDAQIeAQIXgBYhBJvQfg4MUfjVlne3VBuTQ307QWKbBQJgPO8PBQkUX63hAAoJEBuTQ307 QWKbBn8P+QFxwl7pDsAKR1InemMAmuykCHl+XgC0LDqrsWhAH5TYeTVXGSyDsuZjHvj+FRP+ g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TF-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