[PATCH] serial: imx: add rx and tx led trigger

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Wed Jul 6 23:28:00 PDT 2016


Hello Arnd,

[adding Rob Herring to Cc]

On Wed, Jul 06, 2016 at 10:09:39PM +0200, Arnd Bergmann wrote:
> On Wednesday, July 6, 2016 7:30:57 PM CEST Uwe Kleine-König wrote:
> > On Wed, Jul 06, 2016 at 05:22:40PM +0200, Arnd Bergmann wrote:
> > > On Monday, July 4, 2016 5:50:09 PM CEST Uwe Kleine-König wrote:
> > > > On Mon, Jul 04, 2016 at 05:43:03PM +0200, Arnd Bergmann wrote:
> > > > > On Monday, July 4, 2016 5:34:12 PM CEST Uwe Kleine-König wrote:
> > > > > > Add support for two led triggers per UART instance that blink on
> > > > > > transmission and reception of data respectively.
> > > > > > 
> > > If this is something we may want to do on other platforms as well,
> > > we should perhaps not hardwire the name of the imx tty device in
> > > the led trigger name.
> > 
> > I cannot follow. If we have several serial lines and a trigger for each
> > of them, they must get different names. Using the device's name to
> > distinguish them seems like a good and obvious idea.
> 
> The main problem I see is if someone puts the name of the trigger into
> a dtb file, as this hardcodes the connection between the Linux driver
> name and numbering system with the device tree binding, which are normally
> separate.
> 
> If we could derive the trigger name from the "/aliases/serial%d" property
> in DT instead, it would get a little more portable.

Alternatively we could invent a more dtish way as aliases seem to be
frowned upon [1], something like:

	led#0 {
		label = "userled";
		linux,default-trigger = &uart1, "tx";
	};

	uart1: serial at 43f90000 {
		...
		#trigger-cells = <1>;
	};

Having said that, I don't think it's a big problem if the value of
"linux,default-trigger" is Linux-specific. Moreover, is a default
trigger considered a hardware description?

Best regards
Uwe

[1] http://mid.gmane.org/20160705140546.GA10601@rob-hp-laptop
    Not sure this is a general objection to aliases, though.

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |



More information about the linux-arm-kernel mailing list