linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Greg Kroah-Hartman <gregkh@suse.de>,
	linux-serial@vger.kernel.org, Simon Glass <sjg@chromium.org>
Subject: [PATCH 3/3] serial: 8250: Add a wakeup_capable module param
Date: Tue, 17 Jan 2012 10:56:03 -0800	[thread overview]
Message-ID: <1326826563-32215-3-git-send-email-sjg@chromium.org> (raw)
In-Reply-To: <1326826563-32215-1-git-send-email-sjg@chromium.org>

Since serial_core now does not make serial ports wake-up capable by
default, add a parameter to support this feature in the 8250 UART.
This is the only UART where I think this feature is useful.

Signed-off-by: Simon Glass <sjg@chromium.org>
---
 drivers/tty/serial/8250.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
index 54f8920..78feee4 100644
--- a/drivers/tty/serial/8250.c
+++ b/drivers/tty/serial/8250.c
@@ -65,6 +65,7 @@ static int serial_index(struct uart_port *port)
 }
 
 static unsigned int skip_txen_test; /* force skip of txen test at init time */
+static unsigned int wakeup_capable; /* device can wake up system */
 
 /*
  * Debugging.
@@ -2786,6 +2787,7 @@ serial8250_register_ports(struct uart_driver *drv, struct device *dev)
 
 		if (up->port.flags & UPF_FIXED_TYPE)
 			serial8250_init_fixed_type_port(up, up->port.type);
+		up->port.wakeup_capable = wakeup_capable;
 
 		uart_add_one_port(drv, &up->port);
 	}
@@ -3219,6 +3221,7 @@ int serial8250_register_port(struct uart_port *port)
 			uart->port.set_termios = port->set_termios;
 		if (port->pm)
 			uart->port.pm = port->pm;
+		uart->port.wakeup_capable = wakeup_capable;
 
 		if (serial8250_isa_config != NULL)
 			serial8250_isa_config(0, &uart->port,
@@ -3252,6 +3255,7 @@ void serial8250_unregister_port(int line)
 		uart->port.type = PORT_UNKNOWN;
 		uart->port.dev = &serial8250_isa_devs->dev;
 		uart->capabilities = uart_config[uart->port.type].flags;
+		uart->port.wakeup_capable = wakeup_capable;
 		uart_add_one_port(&serial8250_reg, &uart->port);
 	} else {
 		uart->port.dev = NULL;
@@ -3355,3 +3359,6 @@ module_param_array(probe_rsa, ulong, &probe_rsa_count, 0444);
 MODULE_PARM_DESC(probe_rsa, "Probe I/O ports for RSA");
 #endif
 MODULE_ALIAS_CHARDEV_MAJOR(TTY_MAJOR);
+
+module_param(wakeup_capable, uint, 0644);
+MODULE_PARM_DESC(wakeup_capable, "Allow driver to wake up the system");
-- 
1.7.7.3


  parent reply	other threads:[~2012-01-17 18:56 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-17 18:56 [PATCH 1/3] serial: 8250: Remove trailing space in 8250 driver Simon Glass
2012-01-17 18:56 ` [PATCH 2/3] serial: Make wakeup_capable a flag to reduce boot time Simon Glass
2012-01-17 20:09   ` Alan Cox
2012-01-17 18:56 ` Simon Glass [this message]
2012-01-17 20:10   ` [PATCH 3/3] serial: 8250: Add a wakeup_capable module param Alan Cox
2012-01-18  4:17     ` Paul E. McKenney
2012-01-18 21:08       ` Simon Glass
2012-01-18 21:42         ` Paul E. McKenney
2012-01-18 22:15           ` Simon Glass
2012-01-18 22:43             ` Paul E. McKenney
2012-01-18 22:51               ` Simon Glass
2012-01-19  0:02               ` Rafael J. Wysocki
2012-01-19  1:37                 ` Paul E. McKenney
2012-01-19  2:35                   ` Simon Glass
2012-01-19 19:13                     ` Paul E. McKenney
2012-01-20  0:03                   ` Rafael J. Wysocki
2012-01-20  6:12                     ` Paul E. McKenney
2012-01-20 23:49                       ` Rafael J. Wysocki
2012-01-23 16:45                         ` Paul E. McKenney
2012-01-23 21:04                           ` Rafael J. Wysocki
2012-01-18 22:12         ` Alan Cox
2012-01-18 22:19           ` Simon Glass
2012-01-19  0:08         ` Rafael J. Wysocki
2012-01-19  0:58           ` Simon Glass
2012-01-18 23:07   ` [PATCH 1/2] power: Add function to init wakeup capability without enabling Simon Glass
2012-01-18 23:07     ` [PATCH 2/2] serial: Use device_init_wakeup_flag() to make device wakeup-capable Simon Glass
2012-01-19  0:10     ` [PATCH 1/2] power: Add function to init wakeup capability without enabling Rafael J. Wysocki

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=1326826563-32215-3-git-send-email-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.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).