summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Ruehl <chris.ruehl@gtsys.com.hk>2014-01-22 11:14:52 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-02-20 11:10:11 -0800
commitaa5c9d33ed6a4c177b49f1873b00a365c0c4731a (patch)
tree330de0ab08286e37f4385a1a8d65ee13b18f15b9
parenta9c075b1d198fc4d192e69bb35916632ca220d14 (diff)
downloadlwn-aa5c9d33ed6a4c177b49f1873b00a365c0c4731a.tar.gz
lwn-aa5c9d33ed6a4c177b49f1873b00a365c0c4731a.zip
pinctrl: imx27: fix offset calculation in imx_read_2bit
commit e3365d0974ed64157f5b5a576c611057dc40a595 upstream. The offset for the 2bit register calculate wrong, this patch fixes the problem. The debugfs printout for oconf, iconfa, iconfb now shows the real values. Signed-off-by: Chris Ruehl <chris.ruehl@gtsys.com.hk> Reviewed-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/pinctrl/pinctrl-imx1-core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pinctrl/pinctrl-imx1-core.c b/drivers/pinctrl/pinctrl-imx1-core.c
index 8dfc3dc0ac2a..59a16b680b7f 100644
--- a/drivers/pinctrl/pinctrl-imx1-core.c
+++ b/drivers/pinctrl/pinctrl-imx1-core.c
@@ -139,7 +139,7 @@ static int imx1_read_2bit(struct imx1_pinctrl *ipctl, unsigned int pin_id,
u32 reg_offset)
{
void __iomem *reg = imx1_mem(ipctl, pin_id) + reg_offset;
- int offset = pin_id % 16;
+ int offset = (pin_id % 16) * 2;
/* Use the next register if the pin's port pin number is >=16 */
if (pin_id % 32 >= 16)