[net-next,v5,10/15] dt-bindings: net: ethernet-controller: Document support for LEDs node
Message ID | 20230319191814.22067-11-ansuelsmth@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp843101wrt; Sun, 19 Mar 2023 12:20:44 -0700 (PDT) X-Google-Smtp-Source: AK7set9Yl7nEPhYnZV4WIsiOdyspDwsf6H7pvC2YGPVrGw91OuJjzzdFZDXEWQZ78RcXDWLd4pwd X-Received: by 2002:a05:6a20:8c10:b0:d9:b0b5:fdaf with SMTP id j16-20020a056a208c1000b000d9b0b5fdafmr417067pzh.48.1679253644650; Sun, 19 Mar 2023 12:20:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679253644; cv=none; d=google.com; s=arc-20160816; b=O0xR5awxJoTsAbWX7FtSyar8UQCcW7O/gBZx3DCcP+L4sjNpQmNaT9FJuLw2yAIixm 6TzA5IE7ZNP1qaNteye7++33Jj7uJJHZBjeDIlcoMO3nCLpj0Ukb9PA5c73UX8QKcGCz TbAfRqM295exLxUeoNJuVRukF8ptADM+hlkhgYGueG7E1ojVj1QpxyVUVtIt4Q0Vu1zr ndDUZmfJ7rXapA2gekkSYYAGWgrX5AEaVxtPohGc0TixBFXCIbGGrsjSsce025QoREtt lfzQmnmdmPX2Ou7chc1oVRz85GCLBZUi0lI22QRmAqSpjm8Jgs4siFM4kwZWppv406ps BB0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=mZv5FnCiudZKDVGAnq53ZSH02fIH+isgRk91M2T3n+E=; b=Nd4mAvqJBXDP9oeHiN2T0LuzaDGplVEypXCSSLmVY5fr1vFKoB25pqsTCZFrAPBona oD6a0hxsYtJdfBa5gkNdihtZEqFVrZLckLMuTG8GCNyEptooJPMX28oI4jooqjpOsTZo FqeQM8Wqn55u2iElf6rGoU20PGppkH9sHvHrtBWvSYX3bMg72FMHIvVwYPJjUiDdHFaS ytpwQ5rRSvAE0qp1pzKw44FmqK/crBr+4zO49I15FD6iGYJtlOGJLIa9FaALM3j1+m0P 1jhliJCjnLJduKX5aIQDGC03OmGJEhSbjYDzbtPm/EA/Ni5zXJ1rQctbHCABGu98s3lt 3pdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="PQ9TvN/Z"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e11-20020a056a001a8b00b005a8bc2293c3si8452542pfv.263.2023.03.19.12.20.32; Sun, 19 Mar 2023 12:20:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="PQ9TvN/Z"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230120AbjCSTTm (ORCPT <rfc822;pusanteemu@gmail.com> + 99 others); Sun, 19 Mar 2023 15:19:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229992AbjCSTTH (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 19 Mar 2023 15:19:07 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17CFEC65C; Sun, 19 Mar 2023 12:18:50 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id l12so8513626wrm.10; Sun, 19 Mar 2023 12:18:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679253529; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=mZv5FnCiudZKDVGAnq53ZSH02fIH+isgRk91M2T3n+E=; b=PQ9TvN/Z+J6tBc9SVmvrVyMVKxr14rqIr+WZCNIqp4FMAgO+aHt/E+eieG2kqZ3ZZZ 3l/hHKAmrcOpCyIoGf4d7AuZTce+GKMQH9GMzRKXfX5wlnTWKbhuy/w5DRZAlJzl3mcs 2bwc8cjqIq1cpyJzJfETO45WMp6xo0AjXpQdOxcL4f2SGP3YBtOvd2T/duTrwZq+Cq6E vK7174vdHd0cp5NCPOPVItVRDxr8eKA72h4cc5rY7zv3+4jl9SKbS3E7WG3YgU5gLM8r sOuu+RlWU/9fKa6lxeQUff2eyAjtfOZShDY2MWNYubaC63tHHFCwpByd/ZhxY7I1yWJ5 m/ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679253529; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mZv5FnCiudZKDVGAnq53ZSH02fIH+isgRk91M2T3n+E=; b=jswy1lVreDNCnoKNbt/c/XiCfV96tfAl9MHwdSbTJfE1X53bP7l/OIyV438D3kcCKH 8CvX2vdMyAu3hOTbPkHMu/D0Uw6YQ4jqna8KYVGOcB8TzDpWhLwKmCwSJq3qvPkNNn67 6DrQh/tADwGGWXX8iuvqw5pX6InxUZVVuej/frFjnjHqoeJSRjz36Nb1hkZulQ9uHrVM lWHb1Ke9ONv2eef+stpaCOZ/DGhXrhcbJaQ0ASiHAVTcuMTrb8ELpqfE4ErTbBPS5YtG aSqbUgetN+Dh2n/smBSMvVcH/7zwgIZ+6ucV9crANJy2OsbUEV/YeNR3acJVzRbxdvuD n+2A== X-Gm-Message-State: AO0yUKWXoyrc21WgY+pNgIXxCtJrz6y4ICcAYyVcwMVXDwMKNsEDFiXc KA/clFrinprejDfqDqVrMfM= X-Received: by 2002:adf:dd83:0:b0:2cf:e517:c138 with SMTP id x3-20020adfdd83000000b002cfe517c138mr12463230wrl.66.1679253528712; Sun, 19 Mar 2023 12:18:48 -0700 (PDT) Received: from localhost.localdomain (93-34-89-197.ip49.fastwebnet.it. [93.34.89.197]) by smtp.googlemail.com with ESMTPSA id b7-20020a5d4b87000000b002cfe0ab1246sm7165167wrt.20.2023.03.19.12.18.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Mar 2023 12:18:48 -0700 (PDT) From: Christian Marangi <ansuelsmth@gmail.com> To: 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>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Heiner Kallweit <hkallweit1@gmail.com>, Russell King <linux@armlinux.org.uk>, Gregory Clement <gregory.clement@bootlin.com>, Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>, Andy Gross <agross@kernel.org>, Bjorn Andersson <andersson@kernel.org>, Konrad Dybcio <konrad.dybcio@linaro.org>, Pavel Machek <pavel@ucw.cz>, Lee Jones <lee@kernel.org>, Christian Marangi <ansuelsmth@gmail.com>, John Crispin <john@phrozen.org>, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-leds@vger.kernel.org Subject: [net-next PATCH v5 10/15] dt-bindings: net: ethernet-controller: Document support for LEDs node Date: Sun, 19 Mar 2023 20:18:09 +0100 Message-Id: <20230319191814.22067-11-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230319191814.22067-1-ansuelsmth@gmail.com> References: <20230319191814.22067-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760825069653109380?= X-GMAIL-MSGID: =?utf-8?q?1760825069653109380?= |
Series |
net: Add basic LED support for switch/phy
|
|
Commit Message
Christian Marangi
March 19, 2023, 7:18 p.m. UTC
Document support for LEDs node in ethernet-controller.
Ethernet Controller may support different LEDs that can be configured
for different operation like blinking on traffic event or port link.
Also add some Documentation to describe the difference of these nodes
compared to PHY LEDs, since ethernet-controller LEDs are controllable
by the ethernet controller regs and the possible intergated PHY doesn't
have control on them.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
.../bindings/net/ethernet-controller.yaml | 21 +++++++++++++++++++
1 file changed, 21 insertions(+)
Comments
On Sun, Mar 19, 2023 at 08:18:09PM +0100, Christian Marangi wrote: > Document support for LEDs node in ethernet-controller. > Ethernet Controller may support different LEDs that can be configured > for different operation like blinking on traffic event or port link. > > Also add some Documentation to describe the difference of these nodes > compared to PHY LEDs, since ethernet-controller LEDs are controllable > by the ethernet controller regs and the possible intergated PHY doesn't > have control on them. > > Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> > --- > .../bindings/net/ethernet-controller.yaml | 21 +++++++++++++++++++ > 1 file changed, 21 insertions(+) > > diff --git a/Documentation/devicetree/bindings/net/ethernet-controller.yaml b/Documentation/devicetree/bindings/net/ethernet-controller.yaml > index 00be387984ac..a93673592314 100644 > --- a/Documentation/devicetree/bindings/net/ethernet-controller.yaml > +++ b/Documentation/devicetree/bindings/net/ethernet-controller.yaml > @@ -222,6 +222,27 @@ properties: > required: > - speed > > + leds: > + type: object > + 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. > + > + properties: > + '#address-cells': > + const: 1 > + > + '#size-cells': > + const: 0 > + > + patternProperties: > + '^led(@[a-f0-9]+)?$': > + $ref: /schemas/leds/common.yaml# Are specific ethernet controllers allowed to add their own properties in led nodes? If so, this doesn't work. As-is, this allows any other properties. You need 'unevaluatedProperties: false' here to prevent that. But then no one can add properties. If you want to support that, then you need this to be a separate schema that devices can optionally include if they don't extend the properties, and then devices that extend the binding would essentially have the above with: $ref: /schemas/leds/common.yaml# unevaluatedProperties: false properties: a-custom-device-prop: ... If you wanted to define both common ethernet LED properties and device specific properties, then you'd need to replace leds/common.yaml above with the ethernet one. This is all the same reasons the DSA/switch stuff and graph bindings are structured the way they are. Rob
On Tue, Mar 21, 2023 at 04:19:53PM -0500, Rob Herring wrote: > On Sun, Mar 19, 2023 at 08:18:09PM +0100, Christian Marangi wrote: > > Document support for LEDs node in ethernet-controller. > > Ethernet Controller may support different LEDs that can be configured > > for different operation like blinking on traffic event or port link. > > > > Also add some Documentation to describe the difference of these nodes > > compared to PHY LEDs, since ethernet-controller LEDs are controllable > > by the ethernet controller regs and the possible intergated PHY doesn't > > have control on them. > > > > Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> > > --- > > .../bindings/net/ethernet-controller.yaml | 21 +++++++++++++++++++ > > 1 file changed, 21 insertions(+) > > > > diff --git a/Documentation/devicetree/bindings/net/ethernet-controller.yaml b/Documentation/devicetree/bindings/net/ethernet-controller.yaml > > index 00be387984ac..a93673592314 100644 > > --- a/Documentation/devicetree/bindings/net/ethernet-controller.yaml > > +++ b/Documentation/devicetree/bindings/net/ethernet-controller.yaml > > @@ -222,6 +222,27 @@ properties: > > required: > > - speed > > > > + leds: > > + type: object > > + 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. > > + > > + properties: > > + '#address-cells': > > + const: 1 > > + > > + '#size-cells': > > + const: 0 > > + > > + patternProperties: > > + '^led(@[a-f0-9]+)?$': > > + $ref: /schemas/leds/common.yaml# > > Are specific ethernet controllers allowed to add their own properties in > led nodes? If so, this doesn't work. As-is, this allows any other > properties. You need 'unevaluatedProperties: false' here to prevent > that. But then no one can add properties. If you want to support that, > then you need this to be a separate schema that devices can optionally > include if they don't extend the properties, and then devices that > extend the binding would essentially have the above with: > > $ref: /schemas/leds/common.yaml# > unevaluatedProperties: false > properties: > a-custom-device-prop: ... > > > If you wanted to define both common ethernet LED properties and > device specific properties, then you'd need to replace leds/common.yaml > above with the ethernet one. > > This is all the same reasons the DSA/switch stuff and graph bindings are > structured the way they are. > Hi Rob, thanks for the review/questions. The idea of all of this is to keep leds node as standard as possible. It was asked to add unevaluatedProperties: False but I didn't understood it was needed also for the led nodes. leds/common.yaml have additionalProperties set to true but I guess that is not OK for the final schema and we need something more specific. Looking at the common.yaml schema reg binding is missing so an additional schema is needed. Reg is needed for ethernet LEDs and PHY but I think we should also permit to skip that if the device actually have just one LED. (if this wouldn't complicate the implementation. Maybe some hints from Andrew about this decision?) If we decide that reg is a must, if I understood it correctly we should create something like leds-ethernet.yaml that would reference common and add reg binding? Is it correct? This schema should be laded in leds directory and not in the net/ethernet. Also with setting reg mandatory I will have to fix the regex to require @ in the node name. Also also if we decide for a more specific schema, I guess I can reference that directly in ethernet-phy.yaml and ethernet-controller.yaml with something like: leds: $ref: /schemas/leds/leds-ethernet.yaml# Again thanks for the review and hope you can give some hint/clarification if I got everything right.
> > Are specific ethernet controllers allowed to add their own properties in > > led nodes? If so, this doesn't work. As-is, this allows any other > > properties. You need 'unevaluatedProperties: false' here to prevent > > that. But then no one can add properties. If you want to support that, > > then you need this to be a separate schema that devices can optionally > > include if they don't extend the properties, and then devices that > > extend the binding would essentially have the above with: > > > > $ref: /schemas/leds/common.yaml# > > unevaluatedProperties: false > > properties: > > a-custom-device-prop: ... > > > > > > If you wanted to define both common ethernet LED properties and > > device specific properties, then you'd need to replace leds/common.yaml > > above with the ethernet one. > > > > This is all the same reasons the DSA/switch stuff and graph bindings are > > structured the way they are. > > > > Hi Rob, thanks for the review/questions. > > The idea of all of this is to keep leds node as standard as possible. > It was asked to add unevaluatedProperties: False but I didn't understood > it was needed also for the led nodes. > > leds/common.yaml have additionalProperties set to true but I guess that > is not OK for the final schema and we need something more specific. > > Looking at the common.yaml schema reg binding is missing so an > additional schema is needed. > > Reg is needed for ethernet LEDs and PHY but I think we should also permit > to skip that if the device actually have just one LED. (if this wouldn't > complicate the implementation. Maybe some hints from Andrew about this > decision?) I would make reg mandatory. We should not encourage additional properties, but i also think we cannot block it. The problem we have is that there is absolutely no standardisation here. Vendors are free to do whatever they want, and they do. So i would not be too surprised if some vendor properties are needed eventually. Andrew
On Wed, Mar 22, 2023 at 12:23:59AM +0100, Andrew Lunn wrote: > > > Are specific ethernet controllers allowed to add their own properties in > > > led nodes? If so, this doesn't work. As-is, this allows any other > > > properties. You need 'unevaluatedProperties: false' here to prevent > > > that. But then no one can add properties. If you want to support that, > > > then you need this to be a separate schema that devices can optionally > > > include if they don't extend the properties, and then devices that > > > extend the binding would essentially have the above with: > > > > > > $ref: /schemas/leds/common.yaml# > > > unevaluatedProperties: false > > > properties: > > > a-custom-device-prop: ... > > > > > > > > > If you wanted to define both common ethernet LED properties and > > > device specific properties, then you'd need to replace leds/common.yaml > > > above with the ethernet one. > > > > > > This is all the same reasons the DSA/switch stuff and graph bindings are > > > structured the way they are. > > > > > > > Hi Rob, thanks for the review/questions. > > > > The idea of all of this is to keep leds node as standard as possible. > > It was asked to add unevaluatedProperties: False but I didn't understood > > it was needed also for the led nodes. > > > > leds/common.yaml have additionalProperties set to true but I guess that > > is not OK for the final schema and we need something more specific. > > > > Looking at the common.yaml schema reg binding is missing so an > > additional schema is needed. > > > > Reg is needed for ethernet LEDs and PHY but I think we should also permit > > to skip that if the device actually have just one LED. (if this wouldn't > > complicate the implementation. Maybe some hints from Andrew about this > > decision?) > > I would make reg mandatory. > Ok will add a new schema and change the regex. > We should not encourage additional properties, but i also think we > cannot block it. > > The problem we have is that there is absolutely no standardisation > here. Vendors are free to do whatever they want, and they do. So i > would not be too surprised if some vendor properties are needed > eventually. > Think that will come later with defining a more specific schema. But I honestly think most of the special implementation will be handled to the driver internally and not with special binding in DT.
On Wed, Mar 22, 2023 at 12:39:48AM +0100, Christian Marangi wrote: > On Wed, Mar 22, 2023 at 12:23:59AM +0100, Andrew Lunn wrote: > > > > Are specific ethernet controllers allowed to add their own properties in > > > > led nodes? If so, this doesn't work. As-is, this allows any other > > > > properties. You need 'unevaluatedProperties: false' here to prevent > > > > that. But then no one can add properties. If you want to support that, > > > > then you need this to be a separate schema that devices can optionally > > > > include if they don't extend the properties, and then devices that > > > > extend the binding would essentially have the above with: > > > > > > > > $ref: /schemas/leds/common.yaml# > > > > unevaluatedProperties: false > > > > properties: > > > > a-custom-device-prop: ... > > > > > > > > > > > > If you wanted to define both common ethernet LED properties and > > > > device specific properties, then you'd need to replace leds/common.yaml > > > > above with the ethernet one. > > > > > > > > This is all the same reasons the DSA/switch stuff and graph bindings are > > > > structured the way they are. > > > > > > > > > > Hi Rob, thanks for the review/questions. > > > > > > The idea of all of this is to keep leds node as standard as possible. > > > It was asked to add unevaluatedProperties: False but I didn't understood > > > it was needed also for the led nodes. > > > > > > leds/common.yaml have additionalProperties set to true but I guess that > > > is not OK for the final schema and we need something more specific. > > > > > > Looking at the common.yaml schema reg binding is missing so an > > > additional schema is needed. > > > > > > Reg is needed for ethernet LEDs and PHY but I think we should also permit > > > to skip that if the device actually have just one LED. (if this wouldn't > > > complicate the implementation. Maybe some hints from Andrew about this > > > decision?) > > > > I would make reg mandatory. > > > > Ok will add a new schema and change the regex. > > > We should not encourage additional properties, but i also think we > > cannot block it. > > > > The problem we have is that there is absolutely no standardisation > > here. Vendors are free to do whatever they want, and they do. So i > > would not be too surprised if some vendor properties are needed > > eventually. > > > > Think that will come later with defining a more specific schema. But I > honestly think most of the special implementation will be handled to the > driver internally and not with special binding in DT. Then encourage no additional properties by letting whomever wants to add them to restructure the schema. ;) Rob
On Tue, Mar 21, 2023 at 11:54:46PM +0100, Christian Marangi wrote: > On Tue, Mar 21, 2023 at 04:19:53PM -0500, Rob Herring wrote: > > On Sun, Mar 19, 2023 at 08:18:09PM +0100, Christian Marangi wrote: > > > Document support for LEDs node in ethernet-controller. > > > Ethernet Controller may support different LEDs that can be configured > > > for different operation like blinking on traffic event or port link. > > > > > > Also add some Documentation to describe the difference of these nodes > > > compared to PHY LEDs, since ethernet-controller LEDs are controllable > > > by the ethernet controller regs and the possible intergated PHY doesn't > > > have control on them. > > > > > > Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> > > > --- > > > .../bindings/net/ethernet-controller.yaml | 21 +++++++++++++++++++ > > > 1 file changed, 21 insertions(+) > > > > > > diff --git a/Documentation/devicetree/bindings/net/ethernet-controller.yaml b/Documentation/devicetree/bindings/net/ethernet-controller.yaml > > > index 00be387984ac..a93673592314 100644 > > > --- a/Documentation/devicetree/bindings/net/ethernet-controller.yaml > > > +++ b/Documentation/devicetree/bindings/net/ethernet-controller.yaml > > > @@ -222,6 +222,27 @@ properties: > > > required: > > > - speed > > > > > > + leds: > > > + type: object > > > + 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. > > > + > > > + properties: > > > + '#address-cells': > > > + const: 1 > > > + > > > + '#size-cells': > > > + const: 0 > > > + > > > + patternProperties: > > > + '^led(@[a-f0-9]+)?$': > > > + $ref: /schemas/leds/common.yaml# > > > > Are specific ethernet controllers allowed to add their own properties in > > led nodes? If so, this doesn't work. As-is, this allows any other > > properties. You need 'unevaluatedProperties: false' here to prevent > > that. But then no one can add properties. If you want to support that, > > then you need this to be a separate schema that devices can optionally > > include if they don't extend the properties, and then devices that > > extend the binding would essentially have the above with: > > > > $ref: /schemas/leds/common.yaml# > > unevaluatedProperties: false > > properties: > > a-custom-device-prop: ... > > > > > > If you wanted to define both common ethernet LED properties and > > device specific properties, then you'd need to replace leds/common.yaml > > above with the ethernet one. > > > > This is all the same reasons the DSA/switch stuff and graph bindings are > > structured the way they are. > > > > Hi Rob, thanks for the review/questions. > > The idea of all of this is to keep leds node as standard as possible. > It was asked to add unevaluatedProperties: False but I didn't understood > it was needed also for the led nodes. > > leds/common.yaml have additionalProperties set to true but I guess that > is not OK for the final schema and we need something more specific. Yes, every node needs a schema with all possible properties and then 'unevaluatedProperties: false' to not allow any other properties. > Looking at the common.yaml schema reg binding is missing so an > additional schema is needed. > > Reg is needed for ethernet LEDs and PHY but I think we should also permit > to skip that if the device actually have just one LED. (if this wouldn't > complicate the implementation. Maybe some hints from Andrew about this > decision?) > > If we decide that reg is a must, if I understood it correctly we should > create something like leds-ethernet.yaml that would reference common and > add reg binding? Is it correct? This schema should be laded in leds > directory and not in the net/ethernet. You need 'reg' in properties, but whether it is required or not just depends on putting it in 'required'. I don't have a strong opinion on that, but generally it's only use 'reg' when there's more than 1. Rob
diff --git a/Documentation/devicetree/bindings/net/ethernet-controller.yaml b/Documentation/devicetree/bindings/net/ethernet-controller.yaml index 00be387984ac..a93673592314 100644 --- a/Documentation/devicetree/bindings/net/ethernet-controller.yaml +++ b/Documentation/devicetree/bindings/net/ethernet-controller.yaml @@ -222,6 +222,27 @@ properties: required: - speed + leds: + type: object + 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. + + properties: + '#address-cells': + const: 1 + + '#size-cells': + const: 0 + + patternProperties: + '^led(@[a-f0-9]+)?$': + $ref: /schemas/leds/common.yaml# + + additionalProperties: false + dependencies: pcs-handle-names: [pcs-handle]