pinctrl: renesas: gpio: Use dynamic GPIO base if no function GPIOs
authorGeert Uytterhoeven <geert+renesas@glider.be>
Wed, 9 Nov 2022 13:33:04 +0000 (14:33 +0100)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Thu, 17 Nov 2022 19:34:51 +0000 (20:34 +0100)
commit80d34260f36c6c55f03c3c33be4a11ec06202e98
tree9ca81b09e57a5fd93bf63c5d675a4f700e01ff72
parent41a87e789c7c2cdeb302331043f866c0138f0413
pinctrl: renesas: gpio: Use dynamic GPIO base if no function GPIOs

Since commit 502df79b860563d7 ("gpiolib: Warn on drivers still using
static gpiobase allocation") in gpio/for-next, one or more warnings are
printed during boot on systems where the pin controller also provides
GPIO functionality:

    gpio gpiochip0: Static allocation of GPIO base is deprecated, use dynamic allocation.

Fix this for ARM-based SH/R-Mobile SoCs by:
  1. Taking into account a non-zero GPIO base in the various GPIO chip
     callbacks,
  2. Switching to dynamic allocation of the GPIO base when support for
     legacy function GPIOs is not enabled.

On SuperH SoCs using legacy function GPIOs, the GPIO bases of the GPIO
controller and the GPIO function controller must not be changed, as all
board files rely on the fixed GPIO_* and GPIO_FN_* definitions provided
by the various <cpu/sh*.h> header files.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/df2cf30ac4c3cbee726799f32b727c1ebe62819c.1668000684.git.geert+renesas@glider.be
drivers/pinctrl/renesas/gpio.c