From: Krzysztof Kozlowski <krzk@kernel.org>
To: Sean Nyekjaer <sean@geanix.com>,
Marc Kleine-Budde <mkl@pengutronix.de>,
Vincent Mailhol <mailhol.vincent@wanadoo.fr>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>
Cc: linux-can@vger.kernel.org, netdev@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] dt-bindings: can: convert tcan4x5x.txt to DT schema
Date: Mon, 4 Nov 2024 10:27:04 +0100 [thread overview]
Message-ID: <ee47c6d7-4197-4f5d-b39e-aab70a9337d6@kernel.org> (raw)
In-Reply-To: <20241104085616.469862-1-sean@geanix.com>
On 04/11/2024 09:56, Sean Nyekjaer wrote:
> Convert binding doc tcan4x5x.txt to yaml.
>
> Signed-off-by: Sean Nyekjaer <sean@geanix.com>
> ---
>
> Can we somehow reference bosch,mram-cfg from the bosch,m_can.yaml?
> I have searched for yaml files that tries the same, but it's usually
> includes a whole node.
>
> I have also tried:
> $ref: /schema/bosch,m_can.yaml#/properties/bosch,mram-cfg
Yes, this would work just with full path, so /schemas/net/can/...
See:
Documentation/devicetree/bindings/pinctrl/starfive,jh7100-pinctrl.yaml
But you can also just copy it. Ideally this should be moved to common
schema or replaced with more generic property, but these do not have to
be part of this conversion.
>
> Any hints to share a property?
>
> .../devicetree/bindings/net/can/tcan4x5x.txt | 48 ---------
> .../bindings/net/can/ti,tcan4x5x.yaml | 97 +++++++++++++++++++
> 2 files changed, 97 insertions(+), 48 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/net/can/tcan4x5x.txt
> create mode 100644 Documentation/devicetree/bindings/net/can/ti,tcan4x5x.yaml
>
...
> diff --git a/Documentation/devicetree/bindings/net/can/ti,tcan4x5x.yaml b/Documentation/devicetree/bindings/net/can/ti,tcan4x5x.yaml
> new file mode 100644
> index 000000000000..62c108fac6b3
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/can/ti,tcan4x5x.yaml
> @@ -0,0 +1,97 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/can/ti,tcan4x5x.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Texas Instruments TCAN4x5x CAN Controller
> +
> +maintainers:
> + - Marc Kleine-Budde <mkl@pengutronix.de>
> +
> +allOf:
> + - $ref: can-controller.yaml#
> +
> +properties:
> + compatible:
> + oneOf:
> + - enum:
> + - ti,tcan4552
> + - ti,tcan4553
> + - ti,tcan4x5x
That's not really what old binding said.
It said for example:
"ti,tcan4552", "ti,tcan4x5x"
Which is not allowed above. You need list. Considering there are no
in-tree users of ti,tcan4x5x alone, I would allow only lists followed by
ti,tcan4x5x. IOW: disallow ti,tcan4x5x alone.
Mention this change to the binding in the commit message.
> +
> + reg:
> + maxItems: 1
> +
> + interrupts:
> + maxItems: 1
> +
> + clocks:
> + maxItems: 1
> +
> + vdd-supply:
> + description: Regulator that powers the CAN controller.
> +
> + xceiver-supply:
> + description: Regulator that powers the CAN transceiver.
You need to mention all changes done to the binding in the commit msg.
> +
> + reset-gpios:
> + description: Hardwired output GPIO. If not defined then software reset.
> + maxItems: 1
> +
> + device-state-gpios:
> + description: Input GPIO that indicates if the device is in a sleep state or if the device is active.
> + Not available with tcan4552/4553.
> + maxItems: 1
> +
> + device-wake-gpios:
> + description: Wake up GPIO to wake up the TCAN device. Not available with tcan4552/4553.
> + maxItems: 1
> +
> + bosch,mram-cfg:
> + $ref: bosch,m_can.yaml#
> +
> + spi-max-frequency:
> + description:
> + Must be half or less of "clocks" frequency.
> + maximum: 10000000
Old binding said 18 MHz?
> +
> + wakeup-source:
> + $ref: /schemas/types.yaml#/definitions/flag
> + description:
> + Enable CAN remote wakeup.
> +
> +required:
> + - compatible
> + - reg
> + - interrupts
> + - clocks
> + - bosch,mram-cfg
> +
Missing allOf: with $ref to spi-peripheral-props. See other SPI devices.
> +additionalProperties: false
And this becomes unevaluatedProperties: false
Best regards,
Krzysztof
next prev parent reply other threads:[~2024-11-04 9:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-04 8:56 Sean Nyekjaer
2024-11-04 9:27 ` Krzysztof Kozlowski [this message]
2024-11-04 10:31 ` Marc Kleine-Budde
2024-11-04 10:40 ` Krzysztof Kozlowski
2024-11-04 10:54 ` Sean Nyekjaer
2024-11-04 11:37 ` Krzysztof Kozlowski
2024-11-04 10:22 ` Rob Herring (Arm)
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=ee47c6d7-4197-4f5d-b39e-aab70a9337d6@kernel.org \
--to=krzk@kernel.org \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-can@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mailhol.vincent@wanadoo.fr \
--cc=mkl@pengutronix.de \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=robh@kernel.org \
--cc=sean@geanix.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
all inboxes | Powered by JetHome®