From: s.hauer@pengutronix.de (Sascha Hauer)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/4] serial: cpm_uart: Add LED trigger support
Date: Wed, 23 Nov 2016 11:01:05 +0100 [thread overview]
Message-ID: <20161123100106.15969-4-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20161123100106.15969-1-s.hauer@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/tty/serial/cpm_uart/cpm_uart_core.c | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/cpm_uart/cpm_uart_core.c b/drivers/tty/serial/cpm_uart/cpm_uart_core.c
index d3e3d42..5d5633d 100644
--- a/drivers/tty/serial/cpm_uart/cpm_uart_core.c
+++ b/drivers/tty/serial/cpm_uart/cpm_uart_core.c
@@ -255,6 +255,8 @@ static void cpm_uart_int_rx(struct uart_port *port)
pr_debug("CPM uart[%d]:RX INT\n", port->line);
+ uart_led_trigger_rx(port);
+
/* Just loop through the closed BDs and copy the characters into
* the buffer.
*/
@@ -721,6 +723,8 @@ static int cpm_uart_tx_pump(struct uart_port *port)
/* Pick next descriptor and fill from buffer */
bdp = pinfo->tx_cur;
+ uart_led_trigger_tx(port);
+
while (!(in_be16(&bdp->cbd_sc) & BD_SC_READY) &&
xmit->tail != xmit->head) {
count = 0;
@@ -1426,13 +1430,27 @@ static int cpm_uart_probe(struct platform_device *ofdev)
if (ret)
return ret;
- return uart_add_one_port(&cpm_reg, &pinfo->port);
+ ret = uart_add_one_port(&cpm_reg, &pinfo->port);
+ if (ret)
+ return ret;
+
+ uart_add_led_triggers(&cpm_reg, &pinfo->port);
+
+ return 0;
}
static int cpm_uart_remove(struct platform_device *ofdev)
{
struct uart_cpm_port *pinfo = platform_get_drvdata(ofdev);
- return uart_remove_one_port(&cpm_reg, &pinfo->port);
+ int ret;
+
+ ret = uart_remove_one_port(&cpm_reg, &pinfo->port);
+ if (ret)
+ return ret;
+
+ uart_remove_led_triggers(&pinfo->port);
+
+ return 0;
}
static const struct of_device_id cpm_uart_match[] = {
--
2.10.2
next prev parent reply other threads:[~2016-11-23 10:01 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-23 10:01 serial: Add LED trigger support Sascha Hauer
2016-11-23 10:01 ` [PATCH 1/4] serial: core: " Sascha Hauer
2016-11-23 10:08 ` Greg Kroah-Hartman
2016-11-23 10:18 ` Sascha Hauer
2016-11-24 8:26 ` Sascha Hauer
2016-11-24 9:59 ` Greg Kroah-Hartman
2016-11-23 17:13 ` Mathieu Poirier
2016-11-24 6:41 ` Sascha Hauer
2016-11-24 15:45 ` Mathieu Poirier
2016-11-25 12:49 ` Sascha Hauer
2016-11-23 18:57 ` Florian Fainelli
2016-11-24 8:17 ` Sascha Hauer
2016-11-28 4:39 ` Florian Fainelli
2016-12-06 16:54 ` One Thousand Gnomes
2016-12-25 21:20 ` Pavel Machek
2016-11-23 20:07 ` kbuild test robot
2016-12-25 21:20 ` Pavel Machek
2016-11-23 10:01 ` [PATCH 2/4] serial: 8250: " Sascha Hauer
2016-11-23 19:40 ` kbuild test robot
2016-11-23 10:01 ` Sascha Hauer [this message]
2016-11-23 10:01 ` [PATCH 4/4] serial: imx: " Sascha Hauer
2016-11-24 4:46 ` kbuild test robot
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=20161123100106.15969-4-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).