linux/drivers/pinctrl/sunxi
Chen-Yu Tsai 343f132752 pinctrl: sunxi: number gpio ranges starting from 0
The pinctrl-sunxi driver originally used the pin number as the gpio
range offset. This resulted in large, bogus gpio numbers for the
new sun6i-a31-r pinctrl devices.

This patch makes the driver number the gpios ranges starting from an
offset of 0, by subtracting the pin_base number from the pin number.
This also makes the system-wide gpio number match the pin number.

Tested on sun8i with sysfs exported gpios.

This patch also changes the GPIO bindings for R_PIO:

    gpios = <&r_pio B N flag>;

Where B originally was the pinbank label (L or M) counted from A,
with this patch it becomes (L or M) counted from its pinbank base (L).

Thus

    gpios = <&r_pio 10 11 0>; /* PL11 */

becomes

    gpios = <&r_pio 0 11 0>; /* PL11 */

IMO this is correct, as the binding shows the bank offset and pin offset
within the bank for the GPIO controller. But I'm worried it might be a
bit confusing.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2014-07-28 12:14:33 +02:00
..
Kconfig pinctrl: sunxi: Add A23 R_PIO controller support 2014-07-11 14:08:30 +02:00
Makefile pinctrl: sunxi: Add A23 R_PIO controller support 2014-07-11 14:08:30 +02:00
pinctrl-sun4i-a10.c pinctrl: sunxi: Declare the number of interrupt banks in the descriptor 2014-06-19 09:35:11 +02:00
pinctrl-sun5i-a10s.c pinctrl: sunxi: Declare the number of interrupt banks in the descriptor 2014-06-19 09:35:11 +02:00
pinctrl-sun5i-a13.c pinctrl: sunxi: Remove gpio_out function from sun5i-a13 PG0/1/2 pins 2014-07-11 14:08:29 +02:00
pinctrl-sun6i-a31-r.c pinctrl: sunxi: Declare the number of interrupt banks in the descriptor 2014-06-19 09:35:11 +02:00
pinctrl-sun6i-a31.c pinctrl: sunxi: Declare the interrupt function for the A31 2014-06-19 09:35:12 +02:00
pinctrl-sun7i-a20.c pinctrl: sunxi: Declare the number of interrupt banks in the descriptor 2014-06-19 09:35:11 +02:00
pinctrl-sun8i-a23-r.c pinctrl: sunxi: Add A23 R_PIO controller support 2014-07-11 14:08:30 +02:00
pinctrl-sun8i-a23.c pinctrl: sunxi: Add A23 PIO controller support 2014-07-11 14:08:30 +02:00
pinctrl-sunxi.c pinctrl: sunxi: number gpio ranges starting from 0 2014-07-28 12:14:33 +02:00
pinctrl-sunxi.h pinctrl: sunxi: Implement multiple interrupt banks support 2014-06-19 09:35:12 +02:00