All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Eckert <fe@dev.tdt.de>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: gregkh@linuxfoundation.org, jirislaby@kernel.org, pavel@ucw.cz,
	lee@kernel.org, linux-kernel@vger.kernel.org,
	linux-leds@vger.kernel.org, Eckert.Florian@googlemail.com
Subject: Re: [PATCH v7 2/2] trigger: ledtrig-tty: add additional modes
Date: Mon, 06 Mar 2023 11:12:31 +0100	[thread overview]
Message-ID: <706dcb23af15223489dd7d0d34f5a64c@dev.tdt.de> (raw)
In-Reply-To: <20230306093524.amm7o4ppa7gon4ew@pengutronix.de>

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

      reply	other threads:[~2023-03-06 10:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-22  8:33 [PATCH v7 0/2] leds: ledtrig-tty: add tty_led_mode xtension Florian Eckert
2023-02-22  8:33 ` [PATCH v7 1/2] tty: new helper function tty_get_mget Florian Eckert
2023-02-22  8:33 ` [PATCH v7 2/2] trigger: ledtrig-tty: add additional modes Florian Eckert
2023-03-03 14:11   ` Lee Jones
2023-03-06  6:57     ` Jiri Slaby
2023-03-06  7:13       ` Florian Eckert
2023-03-06  9:04       ` Lee Jones
2023-03-06  9:23         ` Uwe Kleine-König
2023-03-06  9:35         ` Jiri Slaby
2023-03-06 10:04           ` Lee Jones
2023-03-06  9:35   ` Uwe Kleine-König
2023-03-06 10:12     ` Florian Eckert [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=706dcb23af15223489dd7d0d34f5a64c@dev.tdt.de \
    --to=fe@dev.tdt.de \
    --cc=Eckert.Florian@googlemail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=u.kleine-koenig@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.