diff options
author | Tony Lindgren <tony@atomide.com> | 2010-07-05 16:31:35 +0300 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2010-07-05 16:31:35 +0300 |
commit | d5425be6eb756e846333f9ba87fe02d001baafc3 (patch) | |
tree | 5c7426b85d105f8e8e853b611175061acc32522c /arch/arm/mach-omap2 | |
parent | dd0cdd888251d0d62df417d6859e74e57146c13f (diff) |
omap: mux: Fix omap_mux_init_gpio for omap24xx
Looks like 24xx uses mode3 instead of mode4 for muxable GPIO pins.
This will be needed when 24xx mux code is converted to use the new
mux functions.
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r-- | arch/arm/mach-omap2/mux.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c index 8b3d26935a3..76b5bf761d1 100644 --- a/arch/arm/mach-omap2/mux.c +++ b/arch/arm/mach-omap2/mux.c @@ -43,6 +43,7 @@ #define OMAP_MUX_BASE_OFFSET 0x30 /* Offset from CTRL_BASE */ #define OMAP_MUX_BASE_SZ 0x5ca +#define MUXABLE_GPIO_MODE3 BIT(0) struct omap_mux_entry { struct omap_mux mux; @@ -51,6 +52,7 @@ struct omap_mux_entry { static unsigned long mux_phys; static void __iomem *mux_base; +static u8 omap_mux_flags; u16 omap_mux_read(u16 reg) { @@ -394,7 +396,10 @@ int __init omap_mux_init_gpio(int gpio, int val) old_mode = omap_mux_read(m->reg_offset); mux_mode = val & ~(OMAP_MUX_NR_MODES - 1); - mux_mode |= OMAP_MUX_MODE4; + if (omap_mux_flags & MUXABLE_GPIO_MODE3) + mux_mode |= OMAP_MUX_MODE3; + else + mux_mode |= OMAP_MUX_MODE4; printk(KERN_DEBUG "mux: Setting signal " "%s.gpio%i 0x%04x -> 0x%04x\n", m->muxnames[0], gpio, old_mode, mux_mode); @@ -1032,6 +1037,9 @@ int __init omap_mux_init(u32 mux_pbase, u32 mux_size, return -ENODEV; } + if (cpu_is_omap24xx()) + omap_mux_flags = MUXABLE_GPIO_MODE3; + omap_mux_init_package(superset, package_subset, package_balls); omap_mux_init_list(superset); omap_mux_init_signals(board_mux); |