From: Linus Walleij <linus.walleij@linaro.org>
To: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Cc: "Alvin Šipraga" <alsi@bang-olufsen.dk>,
"Andrew Lunn" <andrew@lunn.ch>,
"Florian Fainelli" <f.fainelli@gmail.com>,
"Vladimir Oltean" <olteanv@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org
Subject: Re: [PATCH net-next 1/4] dt-bindings: net: dsa: realtek: describe LED usage
Date: Sun, 10 Mar 2024 19:31:32 +0100 [thread overview]
Message-ID: <CACRpkdasa4VBZUk2gwFjwCQyHkFyozokXqeOJqM8hq3BqmCJzQ@mail.gmail.com> (raw)
In-Reply-To: <20240310-realtek-led-v1-1-4d9813ce938e@gmail.com>
On Sun, Mar 10, 2024 at 5:52 AM Luiz Angelo Daros de Luca
<luizluca@gmail.com> wrote:
> Each port can have up to 4 LEDs (3 for current rtl8365mb devices). The
> LED reg property will indicate its LED group.
>
> An example of LED usage was included in an existing switch example.
>
> Cc: devicetree@vger.kernel.org
> Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
But... is this patch even needed at all?
On the top of Documentation/devicetree/bindings/net/dsa/realtek.yaml:
allOf:
- $ref: dsa.yaml#/$defs/ethernet-ports
In Documentation/devicetree/bindings/net/dsa/dsa.yaml:
$defs:
ethernet-ports:
description: A DSA switch without any extra port properties
$ref: '#'
patternProperties:
"^(ethernet-)?ports$":
patternProperties:
"^(ethernet-)?port@[0-9a-f]+$":
description: Ethernet switch ports
$ref: dsa-port.yaml#
unevaluatedProperties: false
(NB, just "ports" is fine.)
In Documentation/devicetree/bindings/net/dsa/dsa-port.yaml:
$ref: /schemas/net/ethernet-switch-port.yaml#
In Documentation/devicetree/bindings/net/ethernet-switch-port.yaml:
$ref: ethernet-controller.yaml#
In Documentation/devicetree/bindings/net/ethernet-controller.yaml:
leds:
description:
Describes the LEDs associated by Ethernet Controller.
These LEDs are not integrated in the PHY and PHY doesn't have any
control on them. Ethernet Controller regs are used to control
these defined LEDs.
type: object
properties:
'#address-cells':
const: 1
'#size-cells':
const: 0
patternProperties:
'^led@[a-f0-9]+$':
$ref: /schemas/leds/common.yaml#
properties:
reg:
maxItems: 1
description:
This define the LED index in the PHY or the MAC. It's really
driver dependent and required for ports that define multiple
LED for the same port.
required:
- reg
unevaluatedProperties: false
additionalProperties: false
Try to introduce small errors in your DTS leds node and it should warn!
I'm not claiming that above include chain is "easy to read"... It makes
perfect sense to machines but maybe is a bit to construed for human
readers.
What you should do instead (IMO) is to just keep the last part that
adds a leds node example.
Yours,
Linus Walleij
next prev parent reply other threads:[~2024-03-10 18:31 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-10 4:51 [PATCH net-next 0/4] net: dsa: realtek: fix LED support for rtl8366 Luiz Angelo Daros de Luca
2024-03-10 4:51 ` [PATCH net-next 1/4] dt-bindings: net: dsa: realtek: describe LED usage Luiz Angelo Daros de Luca
2024-03-10 8:34 ` Krzysztof Kozlowski
2024-03-21 11:56 ` Luiz Angelo Daros de Luca
2024-03-21 12:18 ` Krzysztof Kozlowski
2024-03-24 2:10 ` Luiz Angelo Daros de Luca
2024-03-25 7:41 ` Krzysztof Kozlowski
2024-03-10 18:02 ` Andrew Lunn
2024-03-21 12:03 ` Luiz Angelo Daros de Luca
2024-03-10 18:31 ` Linus Walleij [this message]
2024-03-21 11:57 ` Luiz Angelo Daros de Luca
2024-03-10 18:52 ` Andrew Lunn
2024-03-21 11:58 ` Luiz Angelo Daros de Luca
2024-03-10 23:08 ` Rob Herring
2024-03-21 12:00 ` Luiz Angelo Daros de Luca
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=CACRpkdasa4VBZUk2gwFjwCQyHkFyozokXqeOJqM8hq3BqmCJzQ@mail.gmail.com \
--to=linus.walleij@linaro.org \
--cc=alsi@bang-olufsen.dk \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luizluca@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.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).