From: govindraj.raja@ti.com (Govindraj.R)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 01/11] OMAP2+: hwmod: Add API to enable IO ring wakeup.
Date: Wed, 7 Sep 2011 18:23:23 +0530 [thread overview]
Message-ID: <1315400013-4849-2-git-send-email-govindraj.raja@ti.com> (raw)
In-Reply-To: <1315400013-4849-1-git-send-email-govindraj.raja@ti.com>
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.
Map the enable/disable pad wakeup API's to 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
next prev parent reply other threads:[~2011-09-07 12:53 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-07 12:53 [PATCH v4 00/11] OMAP2+: Serial: Runtime adaptation + cleanup Govindraj.R
2011-09-07 12:53 ` Govindraj.R [this message]
2011-09-07 12:53 ` [PATCH v4 02/11] OMAP2+: hwmod: Add API to check IO PAD wakeup status Govindraj.R
2011-09-07 12:53 ` [PATCH v4 03/11] OMAP2+: UART: cleanup + remove certain uart calls from pm code Govindraj.R
2011-09-07 12:53 ` [PATCH v4 04/11] OMAP2+: UART: Remove uart clock handling code from serial.c Govindraj.R
2011-09-08 23:39 ` Kevin Hilman
2011-09-09 5:22 ` Govindraj
2011-09-07 12:53 ` [PATCH v4 05/11] OMAP2+: Serial: Add default mux for all uarts Govindraj.R
2011-09-07 12:53 ` [PATCH v4 06/11] Serial: OMAP: Store certain reg values to port structure Govindraj.R
2011-09-07 12:53 ` [PATCH v4 07/11] Serial: OMAP: Add runtime pm support for omap-serial driver Govindraj.R
2011-09-09 0:24 ` Kevin Hilman
2011-09-09 6:32 ` Govindraj
2011-09-09 18:14 ` Kevin Hilman
2011-09-12 6:55 ` Govindraj
2011-09-12 6:58 ` Govindraj
2011-09-12 17:01 ` Kevin Hilman
2011-09-07 12:53 ` [PATCH v4 08/11] Serial: OMAP2+: Move erratum handling from serial.c Govindraj.R
2011-09-07 12:53 ` [PATCH v4 09/11] OMAP2+: Serial: Use prepare and resume calls to gate uart clocks Govindraj.R
2011-09-09 18:59 ` Kevin Hilman
2011-09-12 6:37 ` Govindraj
2011-09-07 12:53 ` [PATCH v4 10/11] OMAP: Serial: Allow UART parameters to be configured from board file Govindraj.R
2011-09-09 19:11 ` Kevin Hilman
2011-09-12 6:34 ` Govindraj
2011-09-07 12:53 ` [PATCH v4 11/11] Serial: OMAP2+: Make the RX_TIMEOUT for DMA configurable for each UART Govindraj.R
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=1315400013-4849-2-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).