aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorAxel Haslam <axelhaslam@ti.com>2011-10-10 12:15:37 -0500
committerZiyann <jaraidaniel@gmail.com>2014-10-01 12:59:51 +0200
commitd1f8cd42b759a61719f2954f256d24c418313bb5 (patch)
tree07d5788c19daf031cdc88cc62478ac2ca864b6d2 /arch/arm/mach-omap2
parent21f1104b4fa3c9b72d40468d0761f722930bb886 (diff)
downloadkernel_samsung_tuna-d1f8cd42b759a61719f2954f256d24c418313bb5.zip
kernel_samsung_tuna-d1f8cd42b759a61719f2954f256d24c418313bb5.tar.gz
kernel_samsung_tuna-d1f8cd42b759a61719f2954f256d24c418313bb5.tar.bz2
ARM: omap2+: mux: allow PAD_WKUP bit to be changed
Some modules need PAD_WKUP only for OFF mode, and this needs to be set on suspend and cleared on resume to prevent unnecessary PRCM interrupts. Change-Id: Ie1cc9280a30dec9cbfecb7b81580e9b61fd8a990 Signed-off-by: Axel Haslam <axelhaslam@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/mux.c39
-rw-r--r--arch/arm/mach-omap2/mux.h17
2 files changed, 54 insertions, 2 deletions
diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
index 6fb9324..2b1c799 100644
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -156,7 +156,7 @@ int __init omap_mux_init_gpio(int gpio, int val)
return -ENODEV;
}
-static int __init _omap_mux_get_by_name(struct omap_mux_partition *partition,
+static int _omap_mux_get_by_name(struct omap_mux_partition *partition,
const char *muxname,
struct omap_mux **found_mux)
{
@@ -213,7 +213,7 @@ static int __init _omap_mux_get_by_name(struct omap_mux_partition *partition,
return -ENODEV;
}
-static int __init
+static int
omap_mux_get_by_name(const char *muxname,
struct omap_mux_partition **found_partition,
struct omap_mux **found_mux)
@@ -253,6 +253,41 @@ int __init omap_mux_init_signal(const char *muxname, int val)
pr_debug("%s: Setting signal %s 0x%04x -> 0x%04x\n",
__func__, muxname, old_mode, mux_mode);
omap_mux_write(partition, mux_mode, mux->reg_offset);
+ return 0;
+}
+
+int omap_mux_enable_wkup(const char *muxname)
+{
+ struct omap_mux_partition *partition = NULL;
+ struct omap_mux *mux = NULL;
+ u16 old_mode;
+ int mux_mode;
+
+ mux_mode = omap_mux_get_by_name(muxname, &partition, &mux);
+ if (mux_mode < 0)
+ return mux_mode;
+ old_mode = omap_mux_read(partition, mux->reg_offset);
+ old_mode |= OMAP_WAKEUP_EN;
+ pr_debug("%s: Setting signal %s 0x%04x -> 0x%04x\n",
+ __func__, muxname, old_mode, mux_mode);
+ omap_mux_write(partition, old_mode, mux->reg_offset);
+ return 0;
+}
+
+int omap_mux_disable_wkup(const char *muxname)
+{
+ struct omap_mux_partition *partition = NULL;
+ struct omap_mux *mux = NULL;
+ u16 old_mode;
+ int mux_mode;
+ mux_mode = omap_mux_get_by_name(muxname, &partition, &mux);
+ if (mux_mode < 0)
+ return mux_mode;
+ old_mode = omap_mux_read(partition, mux->reg_offset);
+ old_mode &= ~OMAP_WAKEUP_EN;
+ pr_debug("%s: Setting signal %s 0x%04x -> 0x%04x\n",
+ __func__, muxname, old_mode, mux_mode);
+ omap_mux_write(partition, old_mode, mux->reg_offset);
return 0;
}
diff --git a/arch/arm/mach-omap2/mux.h b/arch/arm/mach-omap2/mux.h
index 25aab87..2959c0f 100644
--- a/arch/arm/mach-omap2/mux.h
+++ b/arch/arm/mach-omap2/mux.h
@@ -210,6 +210,13 @@ int omap_mux_init_gpio(int gpio, int val);
int omap_mux_init_signal(const char *muxname, int val);
/**
+ * omap_mux_enable_wkup - set/clear the pad wakup bit.
+ * @muxname: Mux name in mode0_name.signal_name format
+ */
+int omap_mux_enable_wkup(const char *muxname);
+int omap_mux_disable_wkup(const char *muxname);
+
+/**
* omap_hwmod_mux_init - initialize hwmod specific mux data
* @bpads: Board specific device signal names
* @nr_pads: Number of signal names for the device
@@ -260,6 +267,16 @@ static inline void omap_hwmod_mux(struct omap_hwmod_mux_info *hmux, u8 state)
{
}
+static inline int omap_mux_enable_wkup(const char *muxname)
+{
+ return 0;
+}
+
+static inline int omap_mux_disable_wkup(const char *muxname)
+{
+ return 0;
+}
+
static struct omap_board_mux *board_mux __initdata __maybe_unused;
#endif