aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2010-07-05 09:31:35 -0400
committerTony Lindgren <tony@atomide.com>2010-07-05 09:31:35 -0400
commitd5425be6eb756e846333f9ba87fe02d001baafc3 (patch)
tree5c7426b85d105f8e8e853b611175061acc32522c
parentdd0cdd888251d0d62df417d6859e74e57146c13f (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>
-rw-r--r--arch/arm/mach-omap2/mux.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
index 8b3d26935a39..76b5bf761d1d 100644
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -43,6 +43,7 @@
43 43
44#define OMAP_MUX_BASE_OFFSET 0x30 /* Offset from CTRL_BASE */ 44#define OMAP_MUX_BASE_OFFSET 0x30 /* Offset from CTRL_BASE */
45#define OMAP_MUX_BASE_SZ 0x5ca 45#define OMAP_MUX_BASE_SZ 0x5ca
46#define MUXABLE_GPIO_MODE3 BIT(0)
46 47
47struct omap_mux_entry { 48struct omap_mux_entry {
48 struct omap_mux mux; 49 struct omap_mux mux;
@@ -51,6 +52,7 @@ struct omap_mux_entry {
51 52
52static unsigned long mux_phys; 53static unsigned long mux_phys;
53static void __iomem *mux_base; 54static void __iomem *mux_base;
55static u8 omap_mux_flags;
54 56
55u16 omap_mux_read(u16 reg) 57u16 omap_mux_read(u16 reg)
56{ 58{
@@ -394,7 +396,10 @@ int __init omap_mux_init_gpio(int gpio, int val)
394 396
395 old_mode = omap_mux_read(m->reg_offset); 397 old_mode = omap_mux_read(m->reg_offset);
396 mux_mode = val & ~(OMAP_MUX_NR_MODES - 1); 398 mux_mode = val & ~(OMAP_MUX_NR_MODES - 1);
397 mux_mode |= OMAP_MUX_MODE4; 399 if (omap_mux_flags & MUXABLE_GPIO_MODE3)
400 mux_mode |= OMAP_MUX_MODE3;
401 else
402 mux_mode |= OMAP_MUX_MODE4;
398 printk(KERN_DEBUG "mux: Setting signal " 403 printk(KERN_DEBUG "mux: Setting signal "
399 "%s.gpio%i 0x%04x -> 0x%04x\n", 404 "%s.gpio%i 0x%04x -> 0x%04x\n",
400 m->muxnames[0], gpio, old_mode, mux_mode); 405 m->muxnames[0], gpio, old_mode, mux_mode);
@@ -1032,6 +1037,9 @@ int __init omap_mux_init(u32 mux_pbase, u32 mux_size,
1032 return -ENODEV; 1037 return -ENODEV;
1033 } 1038 }
1034 1039
1040 if (cpu_is_omap24xx())
1041 omap_mux_flags = MUXABLE_GPIO_MODE3;
1042
1035 omap_mux_init_package(superset, package_subset, package_balls); 1043 omap_mux_init_package(superset, package_subset, package_balls);
1036 omap_mux_init_list(superset); 1044 omap_mux_init_list(superset);
1037 omap_mux_init_signals(board_mux); 1045 omap_mux_init_signals(board_mux);