diff options
Diffstat (limited to 'arch/arm/mach-mx3/iomux.c')
-rw-r--r-- | arch/arm/mach-mx3/iomux.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/arm/mach-mx3/iomux.c b/arch/arm/mach-mx3/iomux.c index 6e664be8cc13..7a5088b519a8 100644 --- a/arch/arm/mach-mx3/iomux.c +++ b/arch/arm/mach-mx3/iomux.c | |||
@@ -74,17 +74,18 @@ void mxc_iomux_set_pad(enum iomux_pins pin, u32 config) | |||
74 | u32 field, l; | 74 | u32 field, l; |
75 | void __iomem *reg; | 75 | void __iomem *reg; |
76 | 76 | ||
77 | reg = IOMUXSW_PAD_CTL + (pin + 2) / 3; | 77 | pin &= IOMUX_PADNUM_MASK; |
78 | reg = IOMUXSW_PAD_CTL + (pin + 2) / 3 * 4; | ||
78 | field = (pin + 2) % 3; | 79 | field = (pin + 2) % 3; |
79 | 80 | ||
80 | pr_debug("%s: reg offset = 0x%x field = %d\n", | 81 | pr_debug("%s: reg offset = 0x%x, field = %d\n", |
81 | __func__, (pin + 2) / 3, field); | 82 | __func__, (pin + 2) / 3, field); |
82 | 83 | ||
83 | spin_lock(&gpio_mux_lock); | 84 | spin_lock(&gpio_mux_lock); |
84 | 85 | ||
85 | l = __raw_readl(reg); | 86 | l = __raw_readl(reg); |
86 | l &= ~(0x1ff << (field * 9)); | 87 | l &= ~(0x1ff << (field * 10)); |
87 | l |= config << (field * 9); | 88 | l |= config << (field * 10); |
88 | __raw_writel(l, reg); | 89 | __raw_writel(l, reg); |
89 | 90 | ||
90 | spin_unlock(&gpio_mux_lock); | 91 | spin_unlock(&gpio_mux_lock); |