diff options
author | R Sricharan <r.sricharan@ti.com> | 2011-03-11 11:32:25 -0800 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2011-03-11 11:32:25 -0800 |
commit | 86c79bf45f380c6efd907e95f993146b2b975232 (patch) | |
tree | 4dd547e30350bdbbe889efe85cc71df566dceec7 /arch/arm/mach-omap2/mux.c | |
parent | 029268e4c124a38b11ae965849ea2dfef724a568 (diff) | |
download | linux-stable-86c79bf45f380c6efd907e95f993146b2b975232.tar.gz linux-stable-86c79bf45f380c6efd907e95f993146b2b975232.tar.bz2 linux-stable-86c79bf45f380c6efd907e95f993146b2b975232.zip |
omap2+: mux: Remove the use of IDLE flag
Currently OMAP_DEVICE_PAD_IDLE flag is used to mux pins
dynamically. This can be simplified by using the enabled
state variable of each pad. This also fixes the issue of
the static pads not getting muxed after idling and
disable/enable state transitions.
Signed-off-by: sricharan <r.sricharan@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/mux.c')
-rw-r--r-- | arch/arm/mach-omap2/mux.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c index 8717370c91b1..bb043cbb3886 100644 --- a/arch/arm/mach-omap2/mux.c +++ b/arch/arm/mach-omap2/mux.c @@ -359,7 +359,6 @@ void omap_hwmod_mux(struct omap_hwmod_mux_info *hmux, u8 state) struct omap_device_pad *pad = hmux->pads_dynamic[i]; int val = -EINVAL; - pad->flags |= OMAP_DEVICE_PAD_IDLE; val = pad->idle; omap_mux_write(pad->partition, val, pad->mux->reg_offset); @@ -369,25 +368,18 @@ void omap_hwmod_mux(struct omap_hwmod_mux_info *hmux, u8 state) } /* Runtime enabling of dynamic pads */ - if ((state == _HWMOD_STATE_ENABLED) && hmux->pads_dynamic) { - int idled = 0; - + if ((state == _HWMOD_STATE_ENABLED) && hmux->pads_dynamic + && hmux->enabled) { for (i = 0; i < hmux->nr_pads_dynamic; i++) { struct omap_device_pad *pad = hmux->pads_dynamic[i]; int val = -EINVAL; - if (!(pad->flags & OMAP_DEVICE_PAD_IDLE)) - continue; - - pad->flags &= ~OMAP_DEVICE_PAD_IDLE; val = pad->enable; omap_mux_write(pad->partition, val, pad->mux->reg_offset); - idled++; } - if (idled) - return; + return; } /* Enabling or disabling of all pads */ @@ -404,7 +396,6 @@ void omap_hwmod_mux(struct omap_hwmod_mux_info *hmux, u8 state) pad->name, val); break; case _HWMOD_STATE_DISABLED: - default: /* Use safe mode unless OMAP_DEVICE_PAD_REMUX */ if (flags & OMAP_DEVICE_PAD_REMUX) val = pad->off; @@ -412,6 +403,10 @@ void omap_hwmod_mux(struct omap_hwmod_mux_info *hmux, u8 state) val = OMAP_MUX_MODE7; pr_debug("%s: Disabling %s %x\n", __func__, pad->name, val); + break; + default: + /* Nothing to be done */ + break; }; if (val >= 0) { |