[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <706dcb23af15223489dd7d0d34f5a64c@dev.tdt.de>
Date: Mon, 06 Mar 2023 11:12:31 +0100
From: Florian Eckert <fe@....tdt.de>
To: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
Cc: gregkh@...uxfoundation.org, jirislaby@...nel.org, pavel@....cz,
lee@...nel.org, linux-kernel@...r.kernel.org,
linux-leds@...r.kernel.org, Eckert.Florian@...glemail.com
Subject: Re: [PATCH v7 2/2] trigger: ledtrig-tty: add additional modes
Hello Uwe,
>> + LED on if line is high.
>> + * RNG: DCE has detected an incoming ring signal.
>> + LED on if line is high.
>
> Something I (still) don't like about this approach is that you cannot
> make the LED flash on TX only (or CAR and DSR). Something like:
>
> led=/sys/class/leds/<led>/
> echo 1 > $led/TX
> echo 0 > $led/RX
> echo 1 > $led/CAR
>
> would be a more flexible and IMHO nicer interface. (Maybe with improved
> file names.)
The question is whether it makes sense to combine several states on one
LED. We can add TTY_LED_RX or TTY_LED_TX to meet your requirements.
The only led trigger I know that combines multiple states is
ledtrig-netdev.
If so, I can only imagine that we handle it the same way as with
ledtrig-netdev. For the states CTS/DSR/CAR/RNG, the LED goes on or off
and when data is transmitted (rx/tx), the LED flashes.
I have personally have a usecase where I need to indicate whether
I am getting CTS from the mode or not.
If that's how we want to do it, then I can only imagine that:
led=/sys/class/leds/<led>/
echo 1 > $led/rx
echo 0 > $led/tx
echo <CTS|DSR|CAR|RNG> > $led/tty_led_mode
I think it only makes sense to always display only one mode
This are "CTS|DSR|CAR|RNG".
Personally, I think
it complicates things because the LED shows several states.
Best regards
Florian
Powered by blists - more mailing lists