lkml.org 
[lkml]   [2023]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [net-next PATCH v6 12/16] dt-bindings: net: dsa: qca8k: add LEDs definition example
    > > >  examples:
    > > > - |
    > > > #include <dt-bindings/gpio/gpio.h>
    > > > + #include <dt-bindings/leds/common.h>
    > > >
    > > > mdio {
    > > > #address-cells = <1>;
    > > > @@ -226,6 +229,27 @@ examples:
    > > > label = "lan1";
    > > > phy-mode = "internal";
    > > > phy-handle = <&internal_phy_port1>;
    > > > +
    > > > + leds {
    > > > + #address-cells = <1>;
    > > > + #size-cells = <0>;
    > > > +
    > > > + led@0 {
    > > > + reg = <0>;
    > > > + color = <LED_COLOR_ID_WHITE>;
    > > > + function = LED_FUNCTION_LAN;
    > > > + function-enumerator = <1>;
    > > > + default-state = "keep";
    > > > + };
    > > > +
    > > > + led@1 {
    > > > + reg = <1>;
    > > > + color = <LED_COLOR_ID_AMBER>;
    > > > + function = LED_FUNCTION_LAN;
    > > > + function-enumerator = <1>;
    > >
    > > Isn't function-enumerator supposed to be unique within a given
    > > 'function'?
    > >
    >
    > In the following example the output would be:
    > - amber:lan-1
    > - white:lan-1
    >
    > So in theory it's unique for the same color and function. Is it
    > acceptable? Seems sane that there may be multiple color for the same
    > function (and enum)

    But what does the -1 actually mean?

    At Pavel's request, i documented 'good' names for these LEDs. I
    suggested that if there are multiple LEDs for one MAC/PHY, you use
    something like 'left' or 'right' to indicate their position on the
    RJ45 socket. That has a clear meaning.

    Andrew

    \
     
     \ /
      Last update: 2023-04-13 19:07    [W:2.980 / U:0.028 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site