From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934948AbcKWKIu (ORCPT ); Wed, 23 Nov 2016 05:08:50 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:42806 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934244AbcKWKIL (ORCPT ); Wed, 23 Nov 2016 05:08:11 -0500 Date: Wed, 23 Nov 2016 11:08:19 +0100 From: Greg Kroah-Hartman To: Sascha Hauer Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: Re: [PATCH 1/4] serial: core: Add LED trigger support Message-ID: <20161123100819.GA20137@kroah.com> References: <20161123100106.15969-1-s.hauer@pengutronix.de> <20161123100106.15969-2-s.hauer@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161123100106.15969-2-s.hauer@pengutronix.de> User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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 > #include > #include > +#include > > #include > #include > @@ -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? thanks, greg k-h