linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Ronak Jain <ronak.jain@amd.com>
Cc: krzk+dt@kernel.org, conor+dt@kernel.org, michal.simek@amd.com,
	nava.kishore.manne@amd.com, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] dt-bindings: firmware: xilinx: Add conditional pinctrl schema
Date: Tue, 11 Feb 2025 15:53:54 -0600	[thread overview]
Message-ID: <20250211215354.GA1244436-robh@kernel.org> (raw)
In-Reply-To: <20250206142244.2553237-3-ronak.jain@amd.com>

On Thu, Feb 06, 2025 at 06:22:43AM -0800, Ronak Jain wrote:
> Updates the Device Tree bindings for Xilinx firmware by introducing
> conditional schema references for the pinctrl node.
> 
> Previously, the pinctrl node directly referenced
> xlnx,zynqmp-pinctrl.yaml. However, this patch modifies the schema to
> conditionally apply the correct pinctrl schema based on the compatible
> property. Specifically:
> - If compatible contains "xlnx,zynqmp-pinctrl", reference
>   xlnx,zynqmp-pinctrl.yaml.
> - If compatible contains "xlnx,versal-pinctrl", reference
>   xlnx,versal-pinctrl.yaml.
> 
> Additionally, an example entry for "xlnx,versal-pinctrl" has been
> added under the examples section.
> 
> Signed-off-by: Ronak Jain <ronak.jain@amd.com>
> ---
>  .../firmware/xilinx/xlnx,zynqmp-firmware.yaml | 20 ++++++++++++++++++-
>  1 file changed, 19 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml b/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml
> index 2b72fb9d3c22..d50438b0fca8 100644
> --- a/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml
> +++ b/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml
> @@ -76,7 +76,6 @@ properties:
>      type: object
>  
>    pinctrl:
> -    $ref: /schemas/pinctrl/xlnx,zynqmp-pinctrl.yaml#
>      description: The pinctrl node provides access to pinconfig and pincontrol
>        functionality available in firmware.
>      type: object
> @@ -106,6 +105,21 @@ properties:
>      type: object
>      deprecated: true
>  
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: xlnx,zynqmp-firmware
> +    then:
> +      properties:
> +        pinctrl:
> +          $ref: /schemas/pinctrl/xlnx,zynqmp-pinctrl.yaml#
> +    else:
> +      properties:
> +        pinctrl:
> +          $ref: /schemas/pinctrl/xlnx,versal-pinctrl.yaml#

The somewhat preferred way to do this would be to do this in the top 
level:

pinctrl:
  type: object
  additionalProperties: true
  properties:
    compatible:
      contains:
        enum:
          - xlnx,zynqmp-pinctrl
          - xlnx,versal-pinctrl
  required:
    - compatible

Otherwise, the pinctrl schema ends up being applied twice.
 
> +
>  required:
>    - compatible
>  
> @@ -164,6 +178,10 @@ examples:
>          compatible = "xlnx,versal-fpga";
>        };
>  
> +      pinctrl {
> +        compatible = "xlnx,versal-pinctrl";
> +      };
> +
>        xlnx_aes: zynqmp-aes {
>          compatible = "xlnx,zynqmp-aes";
>        };
> -- 
> 2.34.1
> 


  reply	other threads:[~2025-02-11 21:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-06 14:22 [PATCH 0/3] Update firmware dt-bindings Ronak Jain
2025-02-06 14:22 ` [PATCH 1/3] dt-bindings: firmware: xilinx: Add xlnx,zynqmp-firmware compatible Ronak Jain
2025-02-11 22:04   ` Rob Herring (Arm)
2025-02-06 14:22 ` [PATCH 2/3] dt-bindings: firmware: xilinx: Add conditional pinctrl schema Ronak Jain
2025-02-11 21:53   ` Rob Herring [this message]
2025-02-13 11:16     ` Jain, Ronak
2025-02-20 12:18       ` Jain, Ronak
2025-03-04  6:15         ` Jain, Ronak
2025-09-17  7:28           ` Jain, Ronak
2025-02-06 14:22 ` [PATCH 3/3] dt-bindings: firmware: xilinx: Move FPGA schema references under allOf Ronak Jain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250211215354.GA1244436-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@amd.com \
    --cc=nava.kishore.manne@amd.com \
    --cc=ronak.jain@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).