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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9762DC433ED for ; Fri, 7 May 2021 09:46:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6F61161004 for ; Fri, 7 May 2021 09:46:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236802AbhEGJrt (ORCPT ); Fri, 7 May 2021 05:47:49 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:28712 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234506AbhEGJrs (ORCPT ); Fri, 7 May 2021 05:47:48 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1620380809; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=NDnAzeydRGMYjrqIWykUo4zSO+l0CqzR1v62gJWLZJQ=; b=S/Urf+IWg8wimpOvG6jLPPHq+WCFGKNJ5JaYDRczFezoAlWVMhLHRMkI6Y2DFDiTKuOBZ0O+ UCHRdQxCO823p32s4kB89aszCAmrOSX3KGb9DiD4n8TYKtKeEqYU4BwJfKjtMnsjA3VBq4T2 Anv++Prc8BDlLUFt0x0PrSmYa1M= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI5ZDFmMiIsICJsaW51eC1wbUB2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n07.prod.us-west-2.postgun.com with SMTP id 60950c5455b14811b4ef0400 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 07 May 2021 09:45:56 GMT Sender: skakit=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 03C67C43147; Fri, 7 May 2021 09:45:56 +0000 (UTC) Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: skakit) by smtp.codeaurora.org (Postfix) with ESMTPSA id 48001C4338A; Fri, 7 May 2021 09:45:55 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 07 May 2021 15:15:55 +0530 From: skakit@codeaurora.org To: Sebastian Reichel Cc: Dmitry Torokhov , Rob Herring , Andy Gross , Bjorn Andersson , David Collins , kgunda@codeaurora.org, Vinod Koul , Courtney Cavin , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org Subject: Re: [PATCH V2 3/4] dt-bindings: power: reset: qcom-pon: Convert qcom PON binding to yaml In-Reply-To: References: <1617881469-31965-1-git-send-email-skakit@codeaurora.org> <1617881469-31965-4-git-send-email-skakit@codeaurora.org> <20210408130001.k3qbq3vvwkiyykzv@earth.universe> <0cb9b3503000ac7206f4a3ef5fd16c17@codeaurora.org> <322cbdbb022fec3f43c1cbe13c532dd3@codeaurora.org> <20210427083721.heavcdadeb4ajkk2@earth.universe> Message-ID: X-Sender: skakit@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Hi, [...] >>> > > > + >>> > > > +required: >>> > > > + - compatible >>> > > > + - reg >>> > > > + >>> > > > +additionalProperties: true >>> > > >>> > > Instead of allowing arbitrary properties, only valid modes >>> > > should be allowed. So drop additionalProperties and do this >>> > > instead: >>> > > >>> > > allOf: >>> > > - $ref: reboot-mode.yaml# >>> > > >>> > > unevaluatedProperties: false >>> > > >>> > >>> > Okay. >>> >>> I am not able to use 'allOf' to refer reboot-mode.yaml as some of the >>> properties do not match with reboot-mode.yaml properties. Can we use >>> oneOf >>> like below? >>> >>> oneOf: >>> - $ref: "reboot-mode.yaml#" >>> - $ref: "../../input/qcom,pm8941-pwrkey.yaml#" >> >> That does not make sense. >> >> The reference to reboot-mode.yaml is needed because it adds valid >> mode properties, so that you can set unevaluatedProperties to false. >> You need it at the root of the PON binding. They are not added to >> the required list, so it's fine if not all of them are used. Also >> there can (and usually is) more than one mode, so using oneOf is not >> ok. >> > > Okay, but I am getting errors like below during make dtbs_check. > > kernel/arch/arm64/boot/dts/qcom/sdm630-sony-xperia-ganges-kirin.dt.yaml: > pon@800: 'compatible', 'pwrkey', 'reg' do not match any of the > regexes: '^mode-.*$', 'pinctrl-[0-9]+' > Seems like I have to make 'additionalProperties' as true in reboot-mode.yaml I have checked other yaml binding docs where allOf is used, and they have 'additionalProperties' as true in the file which is being referred. Please let me know if this is not correct way to do it. > As suggested I have added > > allOf: > - $ref: reboot-mode.yaml# > > at the root of binding and also added unevaluatedProperties: false > >> Last but not least the pwrkey reference is needed to describe >> specific nodes (resin, pwrkey) and should not appear at the root >> of the PON binding. >> >>> Also, If I drop additionalProperties I am getting below error. >>> >>> kernel/Documentation/devicetree/bindings/power/reset/qcom,pon.yaml: >>> 'additionalProperties' is a required property >> >> You need to add 'unevaluatedProperties: false'. It is basically >> the same as 'additionalProperties: false', but also accepts >> properties from the referenced bindings. >> >> Thanks, >> >> -- Sebastian Thanks, Satya Priya