Skip to content

Commit

Permalink
omap2+: mux: Remove the use of IDLE flag
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
R Sricharan authored and Tony Lindgren committed Mar 11, 2011
1 parent 029268e commit 86c79bf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
19 changes: 7 additions & 12 deletions arch/arm/mach-omap2/mux.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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 */
Expand All @@ -404,14 +396,17 @@ 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;
else
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) {
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-omap2/mux.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ struct omap_board_mux {
u16 value;
};

#define OMAP_DEVICE_PAD_IDLE BIT(7) /* Not needed for board-*.c */
#define OMAP_DEVICE_PAD_REMUX BIT(1) /* Dynamically remux a pad,
needs enable, idle and off
values */
Expand Down

0 comments on commit 86c79bf

Please sign in to comment.