From mboxrd@z Thu Jan 1 00:00:00 1970 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 039B2C433EF for ; Tue, 19 Apr 2022 06:45:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348999AbiDSGrn (ORCPT ); Tue, 19 Apr 2022 02:47:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349030AbiDSGrf (ORCPT ); Tue, 19 Apr 2022 02:47:35 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45A8EB854 for ; Mon, 18 Apr 2022 23:44:51 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id t11so30817603eju.13 for ; Mon, 18 Apr 2022 23:44:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=WDQdMsSQtFeONfrPWRQrEMWsmK9TYCXo9oQyKgCX1d4=; b=W+DEw3OjhbAorYeQvkZAGbdpHDkjISIw2sWe7zSQRBSDh3kasiZwD3BvHX9g6DsaeF Z1zeOIp/nCjpP4LNqhDwh2Bl39liGxKTC2D2N1TbhkAOpaEsRLf6zRK+OAfWbHawGpVb dDc1ONAw+G1uVAm4MZnn/jw7CWyH7TD/VjyM9sfIHDdI+ENh9f2zRasrOFLafKxDS1h5 47lMDtfkJGU/nuspJfIvREbR+WZYQM6sy8m0HMbdeOjVLvGYLAcFsTJpMqz4qaYpbj6C dwjMD3EC04lWTJeBRG1AqBD4X/cUvQ6+LjCk4SyMnRfaXQ0CEKvVtcRE2Ns0E+U1I3+k ZeXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=WDQdMsSQtFeONfrPWRQrEMWsmK9TYCXo9oQyKgCX1d4=; b=Y0mYfrZOkWwjv2A3ldnCqP7RYKvsnizCwJhaPz61bmkh6ZNKw4B8ZSHZmWi13mbDeG ix9OydVscfgkY9EU9AMmmFW3t3oogjGF4tNHqycMIaa0+3DMOEhE8c9wkXSv1FiohKqG tbNXOYVgGVqTYzmja7erlfUgjVk3kGw/vTe+00vI7TNbLoJWBmL0qkg3KaMiHGExtzvy HtBDMSci1Wp/TZMlGFqaq3+54bL+m1dCR+UE45tmfgDPoj+di7y6FjzcGqtXR8UjF99A 7DYjD06VD4OKO2fXB+buwdqM+tMZLhLM99V0ZgelbxEgQzzs9KgD7dgAaadJoQh8vDLg W1Ng== X-Gm-Message-State: AOAM533w0bZrSD3+5UyXz3LsTltEe9MaEFL42qh1Jt4PWH5UaLI4Oko3 1BmUwPf1IgvEqvjjhyHHK+lkfw== X-Google-Smtp-Source: ABdhPJxZvaWhIZoWqA8l9E3QzXXqm8pjAwVmspK/s+lgWoyTFUJy55XOrlYTGTP6SvstEVOAaHiuEQ== X-Received: by 2002:a17:907:6095:b0:6e7:cc3f:c33d with SMTP id ht21-20020a170907609500b006e7cc3fc33dmr12375812ejc.570.1650350689890; Mon, 18 Apr 2022 23:44:49 -0700 (PDT) Received: from [192.168.0.217] (xdsl-188-155-176-92.adslplus.ch. [188.155.176.92]) by smtp.gmail.com with ESMTPSA id eq7-20020a056402298700b00419d8d46a8asm7693260edb.39.2022.04.18.23.44.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Apr 2022 23:44:49 -0700 (PDT) Message-ID: <39b68e91-93cc-ad74-d064-a29ff01d60a6@linaro.org> Date: Tue, 19 Apr 2022 08:44:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH v2 1/2] regulator: dt-bindings: qcom,rpmh: document supplies per variant Content-Language: en-US To: Rob Herring Cc: Andy Gross , Bjorn Andersson , Liam Girdwood , Mark Brown , Krzysztof Kozlowski , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org References: <20220412073123.27229-1-krzysztof.kozlowski@linaro.org> <20220412073123.27229-2-krzysztof.kozlowski@linaro.org> From: Krzysztof Kozlowski In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On 14/04/2022 17:51, Rob Herring wrote: > On Tue, Apr 12, 2022 at 09:31:22AM +0200, Krzysztof Kozlowski wrote: >> The RPMH regulator binding covers several devices with different >> regulator supplies, so it uses patterns matching broad range of these >> supplies. This works fine but is not specific and might miss actual >> mistakes when a wrong supply property is used for given variant. >> >> Describe the supplies depending on the compatible, using a defs-allOf >> method. >> >> Signed-off-by: Krzysztof Kozlowski >> --- >> .../regulator/qcom,rpmh-regulator.yaml | 290 +++++++++++++++++- >> 1 file changed, 276 insertions(+), 14 deletions(-) >> >> diff --git a/Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.yaml b/Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.yaml >> index 842ccef691b8..773536fe37c7 100644 >> --- a/Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.yaml >> +++ b/Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.yaml >> @@ -95,35 +95,297 @@ properties: >> vdd-rgb-supply: >> description: Input supply phandle of rgb. >> >> - vin-lvs-1-2-supply: >> - description: Input supply phandle of one or more regulators. >> - >> - vdd-bob-supply: >> - description: BOB regulator parent supply phandle. >> - >> bob: >> type: object >> $ref: "regulator.yaml#" >> description: BOB regulator node. >> >> patternProperties: >> - "^vdd-s([0-9]+)-supply$": >> - description: Input supply phandle(s) of one or more regulators. >> - >> - "^vdd-(l[0-9]+[-]){1,5}supply$": >> - description: Input supply phandle(s) of one or more regulators. >> - >> "^(smps|ldo|lvs)[0-9]+$": >> type: object >> $ref: "regulator.yaml#" >> description: smps/ldo regulator nodes(s). >> >> -additionalProperties: false >> - >> required: >> - compatible >> - qcom,pmic-id >> >> +allOf: >> + - $ref: "#/$defs/pm6150" >> + - $ref: "#/$defs/pm6150l" >> + - $ref: "#/$defs/pm7325" >> + - $ref: "#/$defs/pm8005" >> + - $ref: "#/$defs/pm8009" >> + - $ref: "#/$defs/pm8150" >> + - $ref: "#/$defs/pm8150l" >> + - $ref: "#/$defs/pm8350" >> + - $ref: "#/$defs/pm8350c" >> + - $ref: "#/$defs/pm8450" >> + - $ref: "#/$defs/pm8998" >> + - $ref: "#/$defs/pmg1110" >> + - $ref: "#/$defs/pmi8998" >> + - $ref: "#/$defs/pmr735a" >> + - $ref: "#/$defs/pmx55" >> + - $ref: "#/$defs/pmx65" >> + >> +unevaluatedProperties: false >> + >> +$defs: > > I'm not following on why you need $defs here rather than putting the > if/then schemas under the 'allOf'. $defs should primarily only be used > where it saves duplicating a schema 2 or more times. That could be the > case here if there's a case that's a subset of another case. The allOf+defs is a workaround for schema behavior. The entire approach if defining properties in "if:then:" works only with unevaluatedProperties, not with additionalProperties. However unevaluatedProperties require to reference other schema, which I do not do here. I don't have other schema. allOf+def has references tricking schema to accept unevaluatedProperties. Best regards, Krzysztof