linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: govindraj.raja@ti.com (Govindraj.R)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] OMAP2+: UART: enable tx wakeup bit for wer reg
Date: Wed, 21 Mar 2012 15:55:00 +0530	[thread overview]
Message-ID: <1332325501-10467-3-git-send-email-govindraj.raja@ti.com> (raw)
In-Reply-To: <1332325501-10467-1-git-send-email-govindraj.raja@ti.com>

From: "Govindraj.R" <govindraj.raja@ti.com>

>From omap36xx onwards the module wakeup enable reg
wer has TX wakeup bit available enable the same
by populating the necessary tx wakeup flag for the
applicable module ip blocks and use the same
while configuaring wer reg.

Also wer is not context restored, restore wer when
context is lost.

Cc: Paul Walmsley <paul@pwsan.com>
Cc: Felipe Balbi <balbi at ti.com
Cc: Kevin Hilman <khilman@ti.com>
Signed-off-by: Govindraj.R <govindraj.raja@ti.com>
---
 arch/arm/plat-omap/include/plat/omap-serial.h |    7 +++++++
 drivers/tty/serial/omap-serial.c              |    9 ++++++++-
 2 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-omap/include/plat/omap-serial.h b/arch/arm/plat-omap/include/plat/omap-serial.h
index 1a52725..8a4ca5c 100644
--- a/arch/arm/plat-omap/include/plat/omap-serial.h
+++ b/arch/arm/plat-omap/include/plat/omap-serial.h
@@ -61,6 +61,11 @@
 #define UART_ERRATA_i202_MDR1_ACCESS	BIT(0)
 #define UART_ERRATA_i291_DMA_FORCEIDLE	BIT(1)
 
+#define OMAP_UART_TX_WAKEUP_EN	BIT(7)
+
+/* Feature flags */
+#define OMAP_UART_WER_HAS_TX_WAKEUP	BIT(0)
+
 struct omap_uart_port_info {
 	bool			dma_enabled;	/* To specify DMA Mode */
 	unsigned int		uartclk;	/* UART clock rate */
@@ -116,6 +121,7 @@ struct uart_omap_port {
 	unsigned char		dlh;
 	unsigned char		mdr1;
 	unsigned char		scr;
+	unsigned char		wer;
 
 	int			use_dma;
 	/*
@@ -129,6 +135,7 @@ struct uart_omap_port {
 	unsigned long		port_activity;
 	u32			context_loss_cnt;
 	u32			errata;
+	u32			features;
 	u8			wakeups_enabled;
 
 	struct pm_qos_request	pm_qos_request;
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index c7666d6..20d568d 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -585,7 +585,11 @@ static int serial_omap_startup(struct uart_port *port)
 	serial_out(up, UART_IER, up->ier);
 
 	/* Enable module level wake up */
-	serial_out(up, UART_OMAP_WER, OMAP_UART_WER_MOD_WKUP);
+	up->wer = OMAP_UART_WER_MOD_WKUP;
+	if (up->features & OMAP_UART_WER_HAS_TX_WAKEUP)
+		up->wer |= OMAP_UART_TX_WAKEUP_EN;
+
+	serial_out(up, UART_OMAP_WER, up->wer);
 
 	pm_runtime_mark_last_busy(&up->pdev->dev);
 	pm_runtime_put_autosuspend(&up->pdev->dev);
@@ -1396,9 +1400,11 @@ static void omap_serial_fill_features_erratas(struct uart_omap_port *up)
 	case OMAP_UART_REV_52:
 		up->errata |= (UART_ERRATA_i202_MDR1_ACCESS |
 				UART_ERRATA_i291_DMA_FORCEIDLE);
+		up->features |= OMAP_UART_WER_HAS_TX_WAKEUP;
 		break;
 	case OMAP_UART_REV_63:
 		up->errata |= UART_ERRATA_i202_MDR1_ACCESS;
+		up->features |= OMAP_UART_WER_HAS_TX_WAKEUP;
 		break;
 	default:
 		break;
@@ -1629,6 +1635,7 @@ static void serial_omap_restore_context(struct uart_omap_port *up)
 		serial_omap_mdr1_errataset(up, up->mdr1);
 	else
 		serial_out(up, UART_OMAP_MDR1, up->mdr1);
+	serial_out(up, UART_OMAP_WER, up->wer);
 }
 
 static int serial_omap_runtime_suspend(struct device *dev)
-- 
1.7.5.4

  parent reply	other threads:[~2012-03-21 10:25 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-21 10:24 [PATCH 0/3] OMAP2+: UART: Enable tx wakeup + remove cpu checks Govindraj.R
2012-03-21 10:24 ` [PATCH 1/3] OMAP2+: UART: Remove cpu checks for populating errata flags Govindraj.R
2012-03-27 21:03   ` Jon Hunter
2012-03-27 21:08   ` Jon Hunter
2012-03-28 11:09     ` Raja, Govindraj
2012-03-28 16:43       ` Jon Hunter
2012-03-29  7:35         ` Raja, Govindraj
2012-04-02  8:48   ` [PATCH v2] " Govindraj.R
2012-04-02 15:44     ` Jon Hunter
2012-04-03 13:42     ` [PATCH v3] " Govindraj.R
2012-04-04 14:10       ` Jon Hunter
2012-04-05 11:12       ` Shubhrajyoti
2012-03-21 10:25 ` Govindraj.R [this message]
2012-03-21 10:25 ` [PATCH 3/3] OMAP2+: UART: replace omap34xx/omap4xx cpu checks with not omap24xx Govindraj.R
2012-03-21 14:28 ` [PATCH 0/3] OMAP2+: UART: Enable tx wakeup + remove cpu checks Kevin Hilman
2012-03-22  6:59   ` Raja, Govindraj
2012-03-22 23:40     ` Paul Walmsley
2012-03-23  7:47       ` Raja, Govindraj
2012-04-05 11:24 ` Raja, Govindraj
2012-04-05 12:26   ` Alan Cox
2012-04-05 16:47     ` Greg KH

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=1332325501-10467-3-git-send-email-govindraj.raja@ti.com \
    --to=govindraj.raja@ti.com \
    --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).