* [PATCH 0/2 v4] OMAP2+: hwmod: Add hwmod's API's for pad wakeup
@ 2011-07-02 10:52 Govindraj.R
2011-07-02 10:52 ` [PATCH 1/2 v4] OMAP2+: hwmod: Add API to enable IO ring wakeup Govindraj.R
2011-07-02 10:52 ` [PATCH 2/2 v4] OMAP2+: hwmod: Add API to check IO PAD wakeup status Govindraj.R
0 siblings, 2 replies; 10+ messages in thread
From: Govindraj.R @ 2011-07-02 10:52 UTC (permalink / raw)
To: linux-arm-kernel
Add two API's to set IO Pad wakeup capability based on hwmod
mux pins available and also to check the status of IO Pad wakeup
event.
This two patches are separated from uart_runtime patches posted
earlier and uart_runtime adaptation relies on these two API's.
Rebased on 3.0-rc5
Changes from v3:
---------------
Hooked up enable/disable io-ring to hwmod enable/disable
Changes from v2:
---------------
http://www.mail-archive.com/linux-omap at vger.kernel.org/msg49194.html
Changes from v1:
---------------
http://www.mail-archive.com/linux-omap at vger.kernel.org/msg49141.html
Reference to Discussion:
------------------------
http://www.mail-archive.com/linux-omap at vger.kernel.org/msg49000.html
http://www.mail-archive.com/linux-omap at vger.kernel.org/msg49001.html
Govindraj.R (2):
OMAP2+: hwmod: Add API to enable IO ring wakeup.
OMAP2+: hwmod: Add API to check IO PAD wakeup status
arch/arm/mach-omap2/mux.c | 30 ++++++++++++
arch/arm/mach-omap2/mux.h | 13 +++++
arch/arm/mach-omap2/omap_hwmod.c | 66 ++++++++++++++++++++++++++
arch/arm/plat-omap/include/plat/omap_hwmod.h | 1 +
4 files changed, 110 insertions(+), 0 deletions(-)
--
1.7.4.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/2 v4] OMAP2+: hwmod: Add API to enable IO ring wakeup.
2011-07-02 10:52 [PATCH 0/2 v4] OMAP2+: hwmod: Add hwmod's API's for pad wakeup Govindraj.R
@ 2011-07-02 10:52 ` Govindraj.R
2011-07-04 4:55 ` [REPOST PATCH " Govindraj.R
2011-07-02 10:52 ` [PATCH 2/2 v4] OMAP2+: hwmod: Add API to check IO PAD wakeup status Govindraj.R
1 sibling, 1 reply; 10+ messages in thread
From: Govindraj.R @ 2011-07-02 10:52 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 hmwod 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 293fa6c..3b28e0a 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -1770,6 +1770,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 *
*
@@ -2097,6 +2125,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
@@ -2123,6 +2180,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;
@@ -2153,6 +2211,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] 10+ messages in thread
* [PATCH 2/2 v4] OMAP2+: hwmod: Add API to check IO PAD wakeup status
2011-07-02 10:52 [PATCH 0/2 v4] OMAP2+: hwmod: Add hwmod's API's for pad wakeup Govindraj.R
2011-07-02 10:52 ` [PATCH 1/2 v4] OMAP2+: hwmod: Add API to enable IO ring wakeup Govindraj.R
@ 2011-07-02 10:52 ` Govindraj.R
2011-07-02 16:37 ` Paul Walmsley
` (2 more replies)
1 sibling, 3 replies; 10+ messages in thread
From: Govindraj.R @ 2011-07-02 10:52 UTC (permalink / raw)
To: linux-arm-kernel
Add API to determine IO-PAD wakeup event status for a given
hwmod dynamic_mux pad.
Signed-off-by: Govindraj.R <govindraj.raja@ti.com>
---
arch/arm/mach-omap2/mux.c | 30 ++++++++++++++++++++++++++
arch/arm/mach-omap2/mux.h | 13 +++++++++++
arch/arm/mach-omap2/omap_hwmod.c | 7 ++++++
arch/arm/plat-omap/include/plat/omap_hwmod.h | 1 +
4 files changed, 51 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
index c7fb22a..50ee806 100644
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -351,6 +351,36 @@ err1:
return NULL;
}
+/**
+ * omap_hwmod_mux_get_wake_status - omap hwmod check pad wakeup
+ * @hmux: Pads for a hwmod
+ *
+ * Gets the wakeup status of given pad from omap-hwmod.
+ * Returns true if wakeup event is set for pad else false
+ * if wakeup is not occured or pads are not avialable.
+ */
+bool omap_hwmod_mux_get_wake_status(struct omap_hwmod_mux_info *hmux)
+{
+ int i;
+ unsigned int val;
+ u8 ret = false;
+
+ for (i = 0; i < hmux->nr_pads; i++) {
+ struct omap_device_pad *pad = &hmux->pads[i];
+
+ if (pad->flags & OMAP_DEVICE_PAD_WAKEUP) {
+ val = omap_mux_read(pad->partition,
+ pad->mux->reg_offset);
+ if (val & OMAP_WAKEUP_EVENT) {
+ ret = true;
+ break;
+ }
+ }
+ }
+
+ return ret;
+}
+
/* Assumes the calling function takes care of locking */
void omap_hwmod_mux(struct omap_hwmod_mux_info *hmux, u8 state)
{
diff --git a/arch/arm/mach-omap2/mux.h b/arch/arm/mach-omap2/mux.h
index 2132308..8b2150a 100644
--- a/arch/arm/mach-omap2/mux.h
+++ b/arch/arm/mach-omap2/mux.h
@@ -225,8 +225,21 @@ omap_hwmod_mux_init(struct omap_device_pad *bpads, int nr_pads);
*/
void omap_hwmod_mux(struct omap_hwmod_mux_info *hmux, u8 state);
+/**
+ * omap_hwmod_mux_get_wake_status - omap hwmod check pad wakeup
+ * @hmux: Pads for a hwmod
+ *
+ * Called only from omap_hwmod.c, do not use.
+ */
+bool omap_hwmod_mux_get_wake_status(struct omap_hwmod_mux_info *hmux);
#else
+static inline bool
+omap_hwmod_mux_get_wake_status(struct omap_hwmod_mux_info *hmux)
+{
+ return 0;
+}
+
static inline int omap_mux_init_gpio(int gpio, int val)
{
return 0;
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 3b28e0a..f9495fe 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -2428,3 +2428,10 @@ int omap_hwmod_no_setup_reset(struct omap_hwmod *oh)
return 0;
}
+
+int omap_hmwod_pad_get_wakeup_status(struct omap_hwmod *oh)
+{
+ if (oh && oh->mux)
+ return omap_hwmod_mux_get_wake_status(oh->mux);
+ return -EINVAL;
+}
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h
index 1adea9c..da6ab5c 100644
--- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -602,6 +602,7 @@ u32 omap_hwmod_get_context_loss_count(struct omap_hwmod *oh);
int omap_hwmod_no_setup_reset(struct omap_hwmod *oh);
+int omap_hmwod_pad_get_wakeup_status(struct omap_hwmod *oh);
/*
* Chip variant-specific hwmod init routines - XXX should be converted
* to use initcalls once the initial boot ordering is straightened out
--
1.7.4.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/2 v4] OMAP2+: hwmod: Add API to check IO PAD wakeup status
2011-07-02 10:52 ` [PATCH 2/2 v4] OMAP2+: hwmod: Add API to check IO PAD wakeup status Govindraj.R
@ 2011-07-02 16:37 ` Paul Walmsley
2011-07-04 5:08 ` Govindraj
2011-07-04 4:58 ` [REPOST PATCH " Govindraj.R
2011-07-04 5:02 ` Govindraj.R
2 siblings, 1 reply; 10+ messages in thread
From: Paul Walmsley @ 2011-07-02 16:37 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, 2 Jul 2011, Govindraj.R wrote:
> +int omap_hmwod_pad_get_wakeup_status(struct omap_hwmod *oh)
^^^^^
should be "hwmod"
- Paul
^ permalink raw reply [flat|nested] 10+ messages in thread
* [REPOST PATCH 1/2 v4] OMAP2+: hwmod: Add API to enable IO ring wakeup.
2011-07-02 10:52 ` [PATCH 1/2 v4] OMAP2+: hwmod: Add API to enable IO ring wakeup Govindraj.R
@ 2011-07-04 4:55 ` Govindraj.R
2011-11-14 11:44 ` Shubhrajyoti
0 siblings, 1 reply; 10+ messages in thread
From: Govindraj.R @ 2011-07-04 4:55 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.
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 293fa6c..3b28e0a 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -1770,6 +1770,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 *
*
@@ -2097,6 +2125,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
@@ -2123,6 +2180,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;
@@ -2153,6 +2211,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] 10+ messages in thread
* [REPOST PATCH 2/2 v4] OMAP2+: hwmod: Add API to check IO PAD wakeup status
2011-07-02 10:52 ` [PATCH 2/2 v4] OMAP2+: hwmod: Add API to check IO PAD wakeup status Govindraj.R
2011-07-02 16:37 ` Paul Walmsley
@ 2011-07-04 4:58 ` Govindraj.R
2011-07-04 5:02 ` Govindraj.R
2 siblings, 0 replies; 10+ messages in thread
From: Govindraj.R @ 2011-07-04 4:58 UTC (permalink / raw)
To: linux-arm-kernel
Add API to determine IO-PAD wakeup event status for a given
hwmod dynamic_mux pad.
Signed-off-by: Govindraj.R <govindraj.raja@ti.com>
---
arch/arm/mach-omap2/mux.c | 30 ++++++++++++++++++++++++++
arch/arm/mach-omap2/mux.h | 13 +++++++++++
arch/arm/mach-omap2/omap_hwmod.c | 7 ++++++
arch/arm/plat-omap/include/plat/omap_hwmod.h | 1 +
4 files changed, 51 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
index c7fb22a..50ee806 100644
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -351,6 +351,36 @@ err1:
return NULL;
}
+/**
+ * omap_hwmod_mux_get_wake_status - omap hwmod check pad wakeup
+ * @hmux: Pads for a hwmod
+ *
+ * Gets the wakeup status of given pad from omap-hwmod.
+ * Returns true if wakeup event is set for pad else false
+ * if wakeup is not occured or pads are not avialable.
+ */
+bool omap_hwmod_mux_get_wake_status(struct omap_hwmod_mux_info *hmux)
+{
+ int i;
+ unsigned int val;
+ u8 ret = false;
+
+ for (i = 0; i < hmux->nr_pads; i++) {
+ struct omap_device_pad *pad = &hmux->pads[i];
+
+ if (pad->flags & OMAP_DEVICE_PAD_WAKEUP) {
+ val = omap_mux_read(pad->partition,
+ pad->mux->reg_offset);
+ if (val & OMAP_WAKEUP_EVENT) {
+ ret = true;
+ break;
+ }
+ }
+ }
+
+ return ret;
+}
+
/* Assumes the calling function takes care of locking */
void omap_hwmod_mux(struct omap_hwmod_mux_info *hmux, u8 state)
{
diff --git a/arch/arm/mach-omap2/mux.h b/arch/arm/mach-omap2/mux.h
index 2132308..8b2150a 100644
--- a/arch/arm/mach-omap2/mux.h
+++ b/arch/arm/mach-omap2/mux.h
@@ -225,8 +225,21 @@ omap_hwmod_mux_init(struct omap_device_pad *bpads, int nr_pads);
*/
void omap_hwmod_mux(struct omap_hwmod_mux_info *hmux, u8 state);
+/**
+ * omap_hwmod_mux_get_wake_status - omap hwmod check pad wakeup
+ * @hmux: Pads for a hwmod
+ *
+ * Called only from omap_hwmod.c, do not use.
+ */
+bool omap_hwmod_mux_get_wake_status(struct omap_hwmod_mux_info *hmux);
#else
+static inline bool
+omap_hwmod_mux_get_wake_status(struct omap_hwmod_mux_info *hmux)
+{
+ return 0;
+}
+
static inline int omap_mux_init_gpio(int gpio, int val)
{
return 0;
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 3b28e0a..f9495fe 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -2428,3 +2428,10 @@ int omap_hwmod_no_setup_reset(struct omap_hwmod *oh)
return 0;
}
+
+int omap_hwwod_pad_get_wakeup_status(struct omap_hwmod *oh)
+{
+ if (oh && oh->mux)
+ return omap_hwmod_mux_get_wake_status(oh->mux);
+ return -EINVAL;
+}
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h
index 1adea9c..da6ab5c 100644
--- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -602,6 +602,7 @@ u32 omap_hwmod_get_context_loss_count(struct omap_hwmod *oh);
int omap_hwmod_no_setup_reset(struct omap_hwmod *oh);
+int omap_hwwod_pad_get_wakeup_status(struct omap_hwmod *oh);
/*
* Chip variant-specific hwmod init routines - XXX should be converted
* to use initcalls once the initial boot ordering is straightened out
--
1.7.4.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [REPOST PATCH 2/2 v4] OMAP2+: hwmod: Add API to check IO PAD wakeup status
2011-07-02 10:52 ` [PATCH 2/2 v4] OMAP2+: hwmod: Add API to check IO PAD wakeup status Govindraj.R
2011-07-02 16:37 ` Paul Walmsley
2011-07-04 4:58 ` [REPOST PATCH " Govindraj.R
@ 2011-07-04 5:02 ` Govindraj.R
2 siblings, 0 replies; 10+ messages in thread
From: Govindraj.R @ 2011-07-04 5:02 UTC (permalink / raw)
To: linux-arm-kernel
Add API to determine IO-PAD wakeup event status for a given
hwmod dynamic_mux pad.
Signed-off-by: Govindraj.R <govindraj.raja@ti.com>
---
arch/arm/mach-omap2/mux.c | 30 ++++++++++++++++++++++++++
arch/arm/mach-omap2/mux.h | 13 +++++++++++
arch/arm/mach-omap2/omap_hwmod.c | 7 ++++++
arch/arm/plat-omap/include/plat/omap_hwmod.h | 1 +
4 files changed, 51 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
index c7fb22a..50ee806 100644
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -351,6 +351,36 @@ err1:
return NULL;
}
+/**
+ * omap_hwmod_mux_get_wake_status - omap hwmod check pad wakeup
+ * @hmux: Pads for a hwmod
+ *
+ * Gets the wakeup status of given pad from omap-hwmod.
+ * Returns true if wakeup event is set for pad else false
+ * if wakeup is not occured or pads are not avialable.
+ */
+bool omap_hwmod_mux_get_wake_status(struct omap_hwmod_mux_info *hmux)
+{
+ int i;
+ unsigned int val;
+ u8 ret = false;
+
+ for (i = 0; i < hmux->nr_pads; i++) {
+ struct omap_device_pad *pad = &hmux->pads[i];
+
+ if (pad->flags & OMAP_DEVICE_PAD_WAKEUP) {
+ val = omap_mux_read(pad->partition,
+ pad->mux->reg_offset);
+ if (val & OMAP_WAKEUP_EVENT) {
+ ret = true;
+ break;
+ }
+ }
+ }
+
+ return ret;
+}
+
/* Assumes the calling function takes care of locking */
void omap_hwmod_mux(struct omap_hwmod_mux_info *hmux, u8 state)
{
diff --git a/arch/arm/mach-omap2/mux.h b/arch/arm/mach-omap2/mux.h
index 2132308..8b2150a 100644
--- a/arch/arm/mach-omap2/mux.h
+++ b/arch/arm/mach-omap2/mux.h
@@ -225,8 +225,21 @@ omap_hwmod_mux_init(struct omap_device_pad *bpads, int nr_pads);
*/
void omap_hwmod_mux(struct omap_hwmod_mux_info *hmux, u8 state);
+/**
+ * omap_hwmod_mux_get_wake_status - omap hwmod check pad wakeup
+ * @hmux: Pads for a hwmod
+ *
+ * Called only from omap_hwmod.c, do not use.
+ */
+bool omap_hwmod_mux_get_wake_status(struct omap_hwmod_mux_info *hmux);
#else
+static inline bool
+omap_hwmod_mux_get_wake_status(struct omap_hwmod_mux_info *hmux)
+{
+ return 0;
+}
+
static inline int omap_mux_init_gpio(int gpio, int val)
{
return 0;
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 3b28e0a..f9495fe 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -2428,3 +2428,10 @@ int omap_hwmod_no_setup_reset(struct omap_hwmod *oh)
return 0;
}
+
+int omap_hwmod_pad_get_wakeup_status(struct omap_hwmod *oh)
+{
+ if (oh && oh->mux)
+ return omap_hwmod_mux_get_wake_status(oh->mux);
+ return -EINVAL;
+}
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h
index 1adea9c..da6ab5c 100644
--- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -602,6 +602,7 @@ u32 omap_hwmod_get_context_loss_count(struct omap_hwmod *oh);
int omap_hwmod_no_setup_reset(struct omap_hwmod *oh);
+int omap_hwmod_pad_get_wakeup_status(struct omap_hwmod *oh);
/*
* Chip variant-specific hwmod init routines - XXX should be converted
* to use initcalls once the initial boot ordering is straightened out
--
1.7.4.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/2 v4] OMAP2+: hwmod: Add API to check IO PAD wakeup status
2011-07-02 16:37 ` Paul Walmsley
@ 2011-07-04 5:08 ` Govindraj
0 siblings, 0 replies; 10+ messages in thread
From: Govindraj @ 2011-07-04 5:08 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, Jul 2, 2011 at 10:07 PM, Paul Walmsley <paul@pwsan.com> wrote:
> On Sat, 2 Jul 2011, Govindraj.R wrote:
>
>> +int omap_hmwod_pad_get_wakeup_status(struct omap_hwmod *oh)
> ? ? ? ? ? ?^^^^^
>
> should be "hwmod"
corrected and re-posted both patches.
http://permalink.gmane.org/gmane.linux.ports.arm.omap/60250
http://permalink.gmane.org/gmane.linux.ports.arm.omap/60252
--
Thanks,
Govindraj.R
>
>
> - Paul
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at ?http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [REPOST PATCH 1/2 v4] OMAP2+: hwmod: Add API to enable IO ring wakeup.
2011-07-04 4:55 ` [REPOST PATCH " Govindraj.R
@ 2011-11-14 11:44 ` Shubhrajyoti
2011-11-14 12:54 ` Shubhrajyoti
0 siblings, 1 reply; 10+ messages in thread
From: Shubhrajyoti @ 2011-11-14 11:44 UTC (permalink / raw)
To: linux-arm-kernel
On Monday 04 July 2011 10:25 AM, Govindraj.R wrote:
> 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 293fa6c..3b28e0a 100644
> --- a/arch/arm/mach-omap2/omap_hwmod.c
> +++ b/arch/arm/mach-omap2/omap_hwmod.c
> @@ -1770,6 +1770,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;
Will this not erase the other bits ?
Should we read and erase only the wakeup bits.
Am I missing something ?
> + ret = 0;
> + }
> + }
> + }
> +
> + return ret;
> +}
> +
> +/**
> * omap_hwmod_enable - enable an omap_hwmod
> * @oh: struct omap_hwmod *
> *
> @@ -2097,6 +2125,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
> @@ -2123,6 +2180,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;
> @@ -2153,6 +2211,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;
^ permalink raw reply [flat|nested] 10+ messages in thread
* [REPOST PATCH 1/2 v4] OMAP2+: hwmod: Add API to enable IO ring wakeup.
2011-11-14 11:44 ` Shubhrajyoti
@ 2011-11-14 12:54 ` Shubhrajyoti
0 siblings, 0 replies; 10+ messages in thread
From: Shubhrajyoti @ 2011-11-14 12:54 UTC (permalink / raw)
To: linux-arm-kernel
On Monday 14 November 2011 05:14 PM, Shubhrajyoti wrote:
> On Monday 04 July 2011 10:25 AM, Govindraj.R wrote:
>> 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 293fa6c..3b28e0a 100644
>> --- a/arch/arm/mach-omap2/omap_hwmod.c
>> +++ b/arch/arm/mach-omap2/omap_hwmod.c
>> @@ -1770,6 +1770,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;
> Will this not erase the other bits ?
> Should we read and erase only the wakeup bits.
> Am I missing something ?
My bad please ignore
>> + ret = 0;
>> + }
>> + }
>> + }
>> +
>> + return ret;
>> +}
>> +
>> +/**
>> * omap_hwmod_enable - enable an omap_hwmod
>> * @oh: struct omap_hwmod *
>> *
>> @@ -2097,6 +2125,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
>> @@ -2123,6 +2180,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;
>> @@ -2153,6 +2211,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;
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2011-11-14 12:54 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-02 10:52 [PATCH 0/2 v4] OMAP2+: hwmod: Add hwmod's API's for pad wakeup Govindraj.R
2011-07-02 10:52 ` [PATCH 1/2 v4] OMAP2+: hwmod: Add API to enable IO ring wakeup Govindraj.R
2011-07-04 4:55 ` [REPOST PATCH " Govindraj.R
2011-11-14 11:44 ` Shubhrajyoti
2011-11-14 12:54 ` Shubhrajyoti
2011-07-02 10:52 ` [PATCH 2/2 v4] OMAP2+: hwmod: Add API to check IO PAD wakeup status Govindraj.R
2011-07-02 16:37 ` Paul Walmsley
2011-07-04 5:08 ` Govindraj
2011-07-04 4:58 ` [REPOST PATCH " Govindraj.R
2011-07-04 5:02 ` Govindraj.R
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).