lkml.org 
[lkml]   [2020]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH RFC leds + net-next v4 1/2] net: phy: add API for LEDs controlled by PHY HW
    > +static int of_phy_register_led(struct phy_device *phydev, struct device_node *np)
    > +{
    > + struct led_init_data init_data = {};
    > + struct phy_device_led *led;
    > + u32 reg;
    > + int ret;
    > +
    > + ret = of_property_read_u32(np, "reg", &reg);
    > + if (ret < 0)
    > + return ret;
    > +
    > + led = devm_kzalloc(&phydev->mdio.dev, sizeof(struct phy_device_led), GFP_KERNEL);
    > + if (!led)
    > + return -ENOMEM;
    > +
    > + led->cdev.brightness_set_blocking = phy_led_brightness_set;
    > + led->cdev.trigger_type = &phy_hw_led_trig_type;
    > + led->addr = reg;
    > +
    > + of_property_read_string(np, "linux,default-trigger", &led->cdev.default_trigger);

    Hi Marek

    I think we need one more optional property. If the trigger has been
    set to the PHY hardware trigger, we then should be able to set which
    of the different blink patterns we want the LED to use. I guess most
    users will never actually make use of the sys/class/led interface, if
    the default in device tree is sensible. But that requires DT can fully
    configure the LED.

    Andrew

    \
     
     \ /
      Last update: 2020-07-28 18:19    [W:2.849 / U:0.504 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site