]> Pileus Git - ~andy/linux/commitdiff
pinctrl: imx27: fix offset calculation in imx_read_2bit
authorChris Ruehl <chris.ruehl@gtsys.com.hk>
Wed, 22 Jan 2014 03:14:52 +0000 (11:14 +0800)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 3 Feb 2014 08:08:09 +0000 (09:08 +0100)
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.

Cc: stable@vger.kernel.org
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>
drivers/pinctrl/pinctrl-imx1-core.c

index 9e7893fe96e000da8c1d5e600f2ac2b52d014451..815384b377b5fc192a4cdab6eba6c413e62c53fd 100644 (file)
@@ -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)