linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v6 01/16] OMAP2+: hwmod: Add API to enable IO ring wakeup.
@ 2011-09-30 11:01 Govindraj.R
  2011-09-30 11:01 ` [PATCH v6 02/16] OMAP2+: hwmod: Add API to check IO PAD wakeup status Govindraj.R
                   ` (8 more replies)
  0 siblings, 9 replies; 41+ messages in thread
From: Govindraj.R @ 2011-09-30 11:01 UTC (permalink / raw)
  To: linux-arm-kernel

Add API to enable IO pad wakeup capability based on mux dynamic pad and
wake_up enable flag available from hwmod_mux initialization.

Use the wakeup_enable flag and enable wakeup capability
for the given pads. Wakeup capability will be enabled/disabled
during hwmod idle transition based on whether wakeup_flag is
set or cleared.

Call the omap_hwmod_set_ioring_wakeup from hwmod_wakeup_enable/disable.

Signed-off-by: Govindraj.R <govindraj.raja@ti.com>
---
 arch/arm/mach-omap2/omap_hwmod.c |   59 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 59 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 84cc0bd..e751dd9 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -2062,6 +2062,34 @@ static int __init omap_hwmod_setup_all(void)
 core_initcall(omap_hwmod_setup_all);
 
 /**
+ * omap_hwmod_set_ioring_wakeup - enable io pad wakeup flag.
+ * @oh: struct omap_hwmod *
+ * @set: bool value indicating to set or clear wakeup status.
+ *
+ * Set or Clear wakeup flag for the io_pad.
+ */
+static int omap_hwmod_set_ioring_wakeup(struct omap_hwmod *oh, bool set_wake)
+{
+	struct omap_device_pad *pad;
+	int ret = -EINVAL, j;
+
+	if (oh->mux && oh->mux->enabled) {
+		for (j = 0; j < oh->mux->nr_pads_dynamic; j++) {
+			pad = oh->mux->pads_dynamic[j];
+			if (pad->flags & OMAP_DEVICE_PAD_WAKEUP) {
+				if (set_wake)
+					pad->idle |= OMAP_WAKEUP_EN;
+				else
+					pad->idle &= ~OMAP_WAKEUP_EN;
+				ret = 0;
+			}
+		}
+	}
+
+	return ret;
+}
+
+/**
  * omap_hwmod_enable - enable an omap_hwmod
  * @oh: struct omap_hwmod *
  *
@@ -2393,6 +2421,35 @@ int omap_hwmod_del_initiator_dep(struct omap_hwmod *oh,
 {
 	return _del_initiator_dep(oh, init_oh);
 }
+/**
+ * omap_hwmod_enable_ioring_wakeup - Set wakeup flag for iopad.
+ * @oh: struct omap_hwmod *
+ *
+ * Traverse through dynamic pads, if pad is enabled then
+ * set wakeup enable bit flag for the mux pin. Wakeup pad bit
+ * will be set during hwmod idle transistion.
+ * Return error if pads are not enabled or not available.
+ */
+int omap_hwmod_enable_ioring_wakeup(struct omap_hwmod *oh)
+{
+	/* Enable pad wake-up capability */
+	return omap_hwmod_set_ioring_wakeup(oh, true);
+}
+
+/**
+ * omap_hwmod_disable_ioring_wakeup - Clear wakeup flag for iopad.
+ * @oh: struct omap_hwmod *
+ *
+ * Traverse through dynamic pads, if pad is enabled then
+ * clear wakeup enable bit flag for the mux pin. Wakeup pad bit
+ * will be set during hwmod idle transistion.
+ * Return error if pads are not enabled or not available.
+ */
+int omap_hwmod_disable_ioring_wakeup(struct omap_hwmod *oh)
+{
+	/* Disable pad wakeup capability */
+	return omap_hwmod_set_ioring_wakeup(oh, false);
+}
 
 /**
  * omap_hwmod_enable_wakeup - allow device to wake up the system
@@ -2419,6 +2476,7 @@ int omap_hwmod_enable_wakeup(struct omap_hwmod *oh)
 	v = oh->_sysc_cache;
 	_enable_wakeup(oh, &v);
 	_write_sysconfig(v, oh);
+	omap_hwmod_enable_ioring_wakeup(oh);
 	spin_unlock_irqrestore(&oh->_lock, flags);
 
 	return 0;
@@ -2449,6 +2507,7 @@ int omap_hwmod_disable_wakeup(struct omap_hwmod *oh)
 	v = oh->_sysc_cache;
 	_disable_wakeup(oh, &v);
 	_write_sysconfig(v, oh);
+	omap_hwmod_disable_ioring_wakeup(oh);
 	spin_unlock_irqrestore(&oh->_lock, flags);
 
 	return 0;
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 41+ messages in thread

end of thread, other threads:[~2011-10-14 18:29 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-30 11:01 [PATCH v6 01/16] OMAP2+: hwmod: Add API to enable IO ring wakeup Govindraj.R
2011-09-30 11:01 ` [PATCH v6 02/16] OMAP2+: hwmod: Add API to check IO PAD wakeup status Govindraj.R
2011-10-01 14:33   ` Rajendra Nayak
2011-10-03  5:00     ` Govindraj
2011-10-03  5:23       ` Rajendra Nayak
2011-10-03  5:56         ` Govindraj
2011-10-10 22:24           ` Kevin Hilman
2011-10-11  6:17             ` Govindraj
2011-09-30 11:01 ` [PATCH v6 03/16] OMAP2+: UART: cleanup + remove uart pm specific API Govindraj.R
2011-09-30 11:01 ` [PATCH v6 04/16] OMAP2+: UART: cleanup 8250 console driver support Govindraj.R
2011-10-04 21:42   ` Kevin Hilman
2011-10-05  6:54     ` Govindraj
2011-10-05 18:42       ` Kevin Hilman
2011-10-06  8:16         ` Govindraj
2011-09-30 11:01 ` [PATCH v6 05/16] OMAP2+: UART: Cleanup part of clock gating mechanism for uart Govindraj.R
2011-10-10 22:30   ` Kevin Hilman
2011-10-11  6:45     ` Govindraj
2011-09-30 11:01 ` [PATCH v6 06/16] OMAP2+: UART: Remove certain feilds from omap_uart_state struct Govindraj.R
2011-10-10 23:31   ` Kevin Hilman
2011-10-12 10:25     ` Govindraj
2011-09-30 11:01 ` [PATCH v6 07/16] OMAP2+: UART: Add default mux for all uarts Govindraj.R
2011-10-05 19:04   ` Kevin Hilman
2011-10-06  8:21     ` Govindraj
2011-09-30 11:01 ` [PATCH v6 08/16] OMAP2+: UART: Store certain reg values to port structure Govindraj.R
2011-10-10 23:58   ` Kevin Hilman
2011-10-11 13:21     ` Govindraj
2011-09-30 11:01 ` [PATCH v6 09/16] OMAP2+: UART: Add runtime pm support for omap-serial driver Govindraj.R
2011-10-10 23:42   ` Kevin Hilman
2011-10-12 10:37     ` Govindraj
2011-10-10 23:56   ` Kevin Hilman
2011-10-12 10:35     ` Govindraj
2011-10-13  0:06   ` Kevin Hilman
2011-10-13  1:28     ` Govindraj
2011-10-13 21:22       ` Kevin Hilman
2011-10-14 12:32         ` Govindraj
2011-10-14 17:04           ` Kevin Hilman
2011-10-14 18:29             ` Govindraj
2011-10-01 13:41 ` [PATCH v6 01/16] OMAP2+: hwmod: Add API to enable IO ring wakeup Rajendra Nayak
2011-10-03 15:10   ` Vishwanath Sripathy
2011-10-04 21:03   ` Kevin Hilman
2011-10-05 11:57     ` Rajendra Nayak

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).