diff options
author | Axel Haslam <axelhaslam@ti.com> | 2011-10-10 12:15:37 -0500 |
---|---|---|
committer | Ziyann <jaraidaniel@gmail.com> | 2014-10-01 12:59:51 +0200 |
commit | d1f8cd42b759a61719f2954f256d24c418313bb5 (patch) | |
tree | 07d5788c19daf031cdc88cc62478ac2ca864b6d2 /arch/arm/mach-omap2/mux.c | |
parent | 21f1104b4fa3c9b72d40468d0761f722930bb886 (diff) | |
download | kernel_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/mux.c')
-rw-r--r-- | arch/arm/mach-omap2/mux.c | 39 |
1 files changed, 37 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; } |