i.MX31: fix mxc_iomux_set_pad()
mxc_iomux_set_pad() is buggy on i.MX31 - it calculates the register and the offset therein wrongly. Fix it. Signed-off-by: Guennadi Liakhovetski <lg@denx.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
1d5aa17be1
commit
4a7b98d7e7
@ -74,17 +74,18 @@ void mxc_iomux_set_pad(enum iomux_pins pin, u32 config)
|
|||||||
u32 field, l;
|
u32 field, l;
|
||||||
void __iomem *reg;
|
void __iomem *reg;
|
||||||
|
|
||||||
reg = IOMUXSW_PAD_CTL + (pin + 2) / 3;
|
pin &= IOMUX_PADNUM_MASK;
|
||||||
|
reg = IOMUXSW_PAD_CTL + (pin + 2) / 3 * 4;
|
||||||
field = (pin + 2) % 3;
|
field = (pin + 2) % 3;
|
||||||
|
|
||||||
pr_debug("%s: reg offset = 0x%x field = %d\n",
|
pr_debug("%s: reg offset = 0x%x, field = %d\n",
|
||||||
__func__, (pin + 2) / 3, field);
|
__func__, (pin + 2) / 3, field);
|
||||||
|
|
||||||
spin_lock(&gpio_mux_lock);
|
spin_lock(&gpio_mux_lock);
|
||||||
|
|
||||||
l = __raw_readl(reg);
|
l = __raw_readl(reg);
|
||||||
l &= ~(0x1ff << (field * 9));
|
l &= ~(0x1ff << (field * 10));
|
||||||
l |= config << (field * 9);
|
l |= config << (field * 10);
|
||||||
__raw_writel(l, reg);
|
__raw_writel(l, reg);
|
||||||
|
|
||||||
spin_unlock(&gpio_mux_lock);
|
spin_unlock(&gpio_mux_lock);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user