From: "Govindraj.R" <govindraj.raja@ti.com>
To: linux-serial@vger.kernel.org
Cc: linux-omap@vger.kernel.org, "Govindraj.R" <govindraj.raja@ti.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Alan Cox <alan@linux.intel.com>
Subject: [PATCH] tty: serial_core: Utilise/Enable the set_wake uart ops
Date: Mon, 23 Apr 2012 18:30:07 +0530 [thread overview]
Message-ID: <1335186007-24452-1-git-send-email-govindraj.raja@ti.com> (raw)
From: "Govindraj.R" <govindraj.raja@ti.com>
Currently all low level uart driver register to serial_core layer
this core layer exposes various serial uart ops.
Whenever port is opened the low level platform specific wakeup
capability can be enabled use the already available set_wakeup uart ops
to configure wakeup capability.
When port is opened the wakeup can be enabled and when port is shutdown
the wakeups can be disabled.
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Govindraj.R <govindraj.raja@ti.com>
---
drivers/tty/serial/serial_core.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index 9c4c05b..44b81aa 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -185,6 +185,13 @@ static int uart_port_startup(struct tty_struct *tty, struct uart_state *state,
}
/*
+ * Now with port open enable any platform specific wakeup
+ * capability for the port if available.
+ */
+ if (uport->ops->set_wake)
+ uport->ops->set_wake(uport, true);
+
+ /*
* This is to allow setserial on this port. People may want to set
* port/irq/type and then reconfigure the port properly if it failed
* now.
@@ -1427,6 +1434,13 @@ static void uart_port_shutdown(struct tty_port *port)
uport->ops->shutdown(uport);
/*
+ * now port is closed disable any platform
+ * specific wakeup capability that might be enabled.
+ */
+ if (uport->ops->set_wake)
+ uport->ops->set_wake(uport, false);
+
+ /*
* Ensure that the IRQ handler isn't running on another CPU.
*/
synchronize_irq(uport->irq);
--
1.7.9
reply other threads:[~2012-04-23 13:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1335186007-24452-1-git-send-email-govindraj.raja@ti.com \
--to=govindraj.raja@ti.com \
--cc=alan@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-omap@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).