[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190311144227.GA4404@amd>
Date: Mon, 11 Mar 2019 15:42:28 +0100
From: Pavel Machek <pavel@....cz>
To: Rasmus Villemoes <rasmus.villemoes@...vas.dk>
Cc: Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>,
Jacek Anaszewski <jacek.anaszewski@...il.com>,
LKML <linux-kernel@...r.kernel.org>,
"Per N. Christensen" <pnc@...f.com>, Thomas Winding <twi@...f.com>
Subject: Re: replacement for CAN_LEDS
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.
Seems like something to be improved.
> 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?
Sounds like good idea. Patch would be welcome...
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)
Powered by blists - more mailing lists