Message ID | 20250113002346.297481-1-marex@denx.de |
---|---|
State | New |
Headers | show |
Series | [1/2] dt-bindings: leds: Document netdev trigger netdev-trigger-mode property | expand |
On Mon, Jan 13, 2025 at 01:23:37AM +0100, Marek Vasut wrote: > Document netdev trigger specific netdev-trigger-mode property which > is used to configure the netdev trigger mode flags. Those mode flags > define events on which the LED acts upon when the hardware offload is > enabled. This is traditionally configured via sysfs, but that depends > on udev rules which are available either too late or never in case of > non-Linux systems. > > For each LED with linux,default-trigger = "netdev" described in DT, this > optional netdev-trigger-mode property supplies the default configuration > of the PHY LED mode via DT. This property should be set to a subset of > TRIGGER_NETDEV_* flags. > > Signed-off-by: Marek Vasut <marex@denx.de> > --- > Cc: Andrew Lunn <andrew@lunn.ch> > Cc: Christian Marangi <ansuelsmth@gmail.com> > Cc: Conor Dooley <conor+dt@kernel.org> > Cc: Heiner Kallweit <hkallweit1@gmail.com> > Cc: Jacek Anaszewski <jacek.anaszewski@gmail.com> > Cc: Krzysztof Kozlowski <krzk+dt@kernel.org> > Cc: Lee Jones <lee@kernel.org> > Cc: Lukasz Majewski <lukma@denx.de> > Cc: Pavel Machek <pavel@ucw.cz> > Cc: Rob Herring <robh@kernel.org> > Cc: devicetree@vger.kernel.org > Cc: linux-leds@vger.kernel.org > --- > Documentation/devicetree/bindings/leds/common.yaml | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/Documentation/devicetree/bindings/leds/common.yaml b/Documentation/devicetree/bindings/leds/common.yaml > index 3e8319e443392..1f1148fdf20c0 100644 > --- a/Documentation/devicetree/bindings/leds/common.yaml > +++ b/Documentation/devicetree/bindings/leds/common.yaml > @@ -233,6 +233,12 @@ properties: > Maximum timeout in microseconds after which the flash LED is turned off. > Required for flash LED nodes with configurable timeout. > > + # Requires netdev trigger > + netdev-trigger-mode: > + description: > + The netdev LED trigger default mode flags, use TRIGGER_NETDEV_ * flags. > + $ref: /schemas/types.yaml#/definitions/uint32-array > + > allOf: > - if: > required: > -- An example would be good. In order to be able to use TRIGGER_NETDEV_* i assume you are doing an include which is outside of the usual dt-bindings directory. I don't know of the DT Maintainers opinion on that. Andrew
On Thu, Jan 16, 2025 at 02:32:13PM +0100, Andrew Lunn wrote: > On Mon, Jan 13, 2025 at 01:23:37AM +0100, Marek Vasut wrote: > > Document netdev trigger specific netdev-trigger-mode property which > > is used to configure the netdev trigger mode flags. Those mode flags > > define events on which the LED acts upon when the hardware offload is > > enabled. This is traditionally configured via sysfs, but that depends > > on udev rules which are available either too late or never in case of > > non-Linux systems. > > > > For each LED with linux,default-trigger = "netdev" described in DT, this > > optional netdev-trigger-mode property supplies the default configuration > > of the PHY LED mode via DT. This property should be set to a subset of > > TRIGGER_NETDEV_* flags. > > > > Signed-off-by: Marek Vasut <marex@denx.de> > > --- > > Cc: Andrew Lunn <andrew@lunn.ch> > > Cc: Christian Marangi <ansuelsmth@gmail.com> > > Cc: Conor Dooley <conor+dt@kernel.org> > > Cc: Heiner Kallweit <hkallweit1@gmail.com> > > Cc: Jacek Anaszewski <jacek.anaszewski@gmail.com> > > Cc: Krzysztof Kozlowski <krzk+dt@kernel.org> > > Cc: Lee Jones <lee@kernel.org> > > Cc: Lukasz Majewski <lukma@denx.de> > > Cc: Pavel Machek <pavel@ucw.cz> > > Cc: Rob Herring <robh@kernel.org> > > Cc: devicetree@vger.kernel.org > > Cc: linux-leds@vger.kernel.org > > --- > > Documentation/devicetree/bindings/leds/common.yaml | 6 ++++++ > > 1 file changed, 6 insertions(+) > > > > diff --git a/Documentation/devicetree/bindings/leds/common.yaml b/Documentation/devicetree/bindings/leds/common.yaml > > index 3e8319e443392..1f1148fdf20c0 100644 > > --- a/Documentation/devicetree/bindings/leds/common.yaml > > +++ b/Documentation/devicetree/bindings/leds/common.yaml > > @@ -233,6 +233,12 @@ properties: > > Maximum timeout in microseconds after which the flash LED is turned off. > > Required for flash LED nodes with configurable timeout. > > > > + # Requires netdev trigger > > + netdev-trigger-mode: > > + description: > > + The netdev LED trigger default mode flags, use TRIGGER_NETDEV_ * flags. > > + $ref: /schemas/types.yaml#/definitions/uint32-array > > + > > allOf: > > - if: > > required: > > -- > > An example would be good. > > In order to be able to use TRIGGER_NETDEV_* i assume you are doing an > include which is outside of the usual dt-bindings directory. I don't > know of the DT Maintainers opinion on that. > Well I think we can just move those include to dt-bindings or at worst define new one (maybe less driver specific) and reference the internal one... Should not be a problem in theory.
diff --git a/Documentation/devicetree/bindings/leds/common.yaml b/Documentation/devicetree/bindings/leds/common.yaml index 3e8319e443392..1f1148fdf20c0 100644 --- a/Documentation/devicetree/bindings/leds/common.yaml +++ b/Documentation/devicetree/bindings/leds/common.yaml @@ -233,6 +233,12 @@ properties: Maximum timeout in microseconds after which the flash LED is turned off. Required for flash LED nodes with configurable timeout. + # Requires netdev trigger + netdev-trigger-mode: + description: + The netdev LED trigger default mode flags, use TRIGGER_NETDEV_ * flags. + $ref: /schemas/types.yaml#/definitions/uint32-array + allOf: - if: required:
Document netdev trigger specific netdev-trigger-mode property which is used to configure the netdev trigger mode flags. Those mode flags define events on which the LED acts upon when the hardware offload is enabled. This is traditionally configured via sysfs, but that depends on udev rules which are available either too late or never in case of non-Linux systems. For each LED with linux,default-trigger = "netdev" described in DT, this optional netdev-trigger-mode property supplies the default configuration of the PHY LED mode via DT. This property should be set to a subset of TRIGGER_NETDEV_* flags. Signed-off-by: Marek Vasut <marex@denx.de> --- Cc: Andrew Lunn <andrew@lunn.ch> Cc: Christian Marangi <ansuelsmth@gmail.com> Cc: Conor Dooley <conor+dt@kernel.org> Cc: Heiner Kallweit <hkallweit1@gmail.com> Cc: Jacek Anaszewski <jacek.anaszewski@gmail.com> Cc: Krzysztof Kozlowski <krzk+dt@kernel.org> Cc: Lee Jones <lee@kernel.org> Cc: Lukasz Majewski <lukma@denx.de> Cc: Pavel Machek <pavel@ucw.cz> Cc: Rob Herring <robh@kernel.org> Cc: devicetree@vger.kernel.org Cc: linux-leds@vger.kernel.org --- Documentation/devicetree/bindings/leds/common.yaml | 6 ++++++ 1 file changed, 6 insertions(+)