Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1528288
| From | Sascha Hauer <s.hauer@pengutronix.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/4] serial: core: Add LED trigger support |
| Date | 2016-11-23 11:30 +0100 |
| Message-ID | <sGCYp-3DP-9@gated-at.bofh.it> (permalink) |
| References | <sGCF3-3u2-9@gated-at.bofh.it> <sGCF3-3u2-7@gated-at.bofh.it> <sGCF4-3u2-39@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed, Nov 23, 2016 at 11:08:19AM +0100, Greg Kroah-Hartman wrote:
> On Wed, Nov 23, 2016 at 11:01:03AM +0100, Sascha Hauer wrote:
> > With this patch the serial core provides LED triggers for RX and TX.
> >
> > As the serial core layer does not know when the hardware actually sends
> > or receives characters, this needs help from the UART drivers. The
> > LED triggers are registered in uart_add_led_triggers() called from
> > the UART drivers which want to support LED triggers. All the driver
> > has to do then is to call uart_led_trigger_[tx|rx] to indicate
> > activity.
> >
> > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > ---
> > drivers/tty/serial/serial_core.c | 73 ++++++++++++++++++++++++++++++++++++++++
> > include/linux/serial_core.h | 10 ++++++
> > 2 files changed, 83 insertions(+)
> >
> > diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
> > index f2303f3..3e8afb7 100644
> > --- a/drivers/tty/serial/serial_core.c
> > +++ b/drivers/tty/serial/serial_core.c
> > @@ -34,6 +34,7 @@
> > #include <linux/serial_core.h>
> > #include <linux/delay.h>
> > #include <linux/mutex.h>
> > +#include <linux/leds.h>
> >
> > #include <asm/irq.h>
> > #include <asm/uaccess.h>
> > @@ -2703,6 +2704,77 @@ static const struct attribute_group tty_dev_attr_group = {
> > .attrs = tty_dev_attrs,
> > };
> >
> > +void uart_led_trigger_tx(struct uart_port *uport)
> > +{
> > + unsigned long delay = 50;
> > +
> > + led_trigger_blink_oneshot(uport->led_trigger_tx, &delay, &delay, 0);
> > +}
> > +
> > +void uart_led_trigger_rx(struct uart_port *uport)
> > +{
> > + unsigned long delay = 50;
> > +
> > + led_trigger_blink_oneshot(uport->led_trigger_rx, &delay, &delay, 0);
> > +}
>
> Don't these functions need an EXPORT_SYMBOL_GPL() to work properly with
> uart drivers being built as a module?
Yes, for sure. Will fix in next version.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 1/4] serial: core: Add LED trigger support Sascha Hauer <s.hauer@pengutronix.de> - 2016-11-23 11:10 +0100
Re: [PATCH 1/4] serial: core: Add LED trigger support Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-11-23 11:10 +0100
Re: [PATCH 1/4] serial: core: Add LED trigger support Sascha Hauer <s.hauer@pengutronix.de> - 2016-11-23 11:30 +0100
Re: [PATCH 1/4] serial: core: Add LED trigger support Sascha Hauer <s.hauer@pengutronix.de> - 2016-11-24 09:30 +0100
Re: [PATCH 1/4] serial: core: Add LED trigger support Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-11-24 11:00 +0100
Re: [PATCH 1/4] serial: core: Add LED trigger support Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-11-23 18:20 +0100
Re: [PATCH 1/4] serial: core: Add LED trigger support Sascha Hauer <s.hauer@pengutronix.de> - 2016-11-24 07:50 +0100
Re: [PATCH 1/4] serial: core: Add LED trigger support Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-11-24 17:00 +0100
Re: [PATCH 1/4] serial: core: Add LED trigger support Florian Fainelli <f.fainelli@gmail.com> - 2016-11-23 20:00 +0100
Re: [PATCH 1/4] serial: core: Add LED trigger support Sascha Hauer <s.hauer@pengutronix.de> - 2016-11-24 09:20 +0100
Re: [PATCH 1/4] serial: core: Add LED trigger support kbuild test robot <lkp@intel.com> - 2016-11-23 21:10 +0100
csiph-web