Thread (11 messages) 11 messages, 3 authors, 2016-08-31
DORMANTno replies

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

From: Greg KH <hidden>
Date: 2016-08-31 14:00:36
Also in: linux-arm-kernel

On Mon, Jul 04, 2016 at 05:34:12PM +0200, Uwe Kleine-König wrote:
quoted hunk ↗ jump to hunk
Add support for two led triggers per UART instance that blink on
transmission and reception of data respectively.

Signed-off-by: Uwe Kleine-König <redacted>
---
 drivers/tty/serial/imx.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 621e488cbb12..2b6ba3b8bdd5 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -39,6 +39,7 @@
 #include <linux/of_device.h>
 #include <linux/io.h>
 #include <linux/dma-mapping.h>
+#include <linux/leds.h>
 
 #include <asm/irq.h>
 #include <linux/platform_data/serial-imx.h>
@@ -227,6 +228,8 @@ struct imx_port {
 	wait_queue_head_t	dma_wait;
 	unsigned int            saved_reg[10];
 	bool			context_saved;
+	struct led_trigger	led_trigger_rx;
+	struct led_trigger	led_trigger_tx;
 };
 
 struct imx_port_ucrs {
@@ -293,6 +296,10 @@ static inline int is_imx6q_uart(struct imx_port *sport)
 {
 	return sport->devdata->devtype == IMX6Q_UART;
 }
+
+static unsigned long led_delay = 50;
+module_param(led_delay, ulong, 0644);
I hate module parameters, and so should you, this isn't the 1990's
anymore :(

And I'm with Arnd, let's make this work for all tty drivers that want to
use it please.

thanks,

greg k-h
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help