lkml.org 
[lkml]   [2019]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subjectreplacement for CAN_LEDS
Date
Hi

I'm in the process of upgrading an old BSP to a 4.19 kernel, and noticed
that CAN_LEDS has been marked broken. The comments say that the netdev
trigger can do everything, but doesn't provide much guidance on how to
actually do the transition.

In my case, I used to have a device tree node

canb {
label = "canb:green:activity";
gpios = <&gpio0 5 0>;
default-state = "off";
linux,default-trigger = "can1-rxtx";
};

and if I change the default-trigger to netdev, I get sysfs files in
/sys/class/leds/canb:green:activity ; if I then echo can1 to device_name
and 1 to rx,tx, and link, I get the behaviour I used to have.

Questions: must this setup be done in userspace like this? Is there some
udev rule template I could copy? I can also just hardcode the above
dance in some init script.

I'd actually prefer keeping the entire setup in device tree. So would it
be possible to have netdev_trig_activate() look for some properties in
the DT node for the led_classdev and populate ->device_name and ->mode
based on them?

Rasmus
\
 
 \ /
  Last update: 2019-03-11 12:01    [W:0.178 / U:0.456 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site