pinctrl: sunxi: fix pin numbers passed to register offset helpers
authorChen-Yu Tsai <wens@csie.org>
Thu, 22 May 2014 15:20:55 +0000 (23:20 +0800)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 27 May 2014 09:26:01 +0000 (11:26 +0200)
commitb4575c699882346c0c18e93bb5173c2689965c7b
tree45b0036476c6ef28dc9637fc9eba788306ab5e91
parent2cc140fe360732bc5467df3ad932685c76078dd4
pinctrl: sunxi: fix pin numbers passed to register offset helpers

The pin numbers passed to sunxi_*_reg helpers to get the correct
registers should be the pin offset for the PIO block, not the
absolute number we use that is based on the alphanumeric labels
Allwinner uses.

This patch subtracts .pin_base from the pin number passed to these
functions, so the driver accesses the correct registers.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/sunxi/pinctrl-sunxi.c