Commit bc962997 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Linus Walleij

pinctrl: bcm2835: Switch to use ->add_pin_ranges()

Yeah, while the ->add_pin_ranges() shouldn't be used by DT drivers,
this one requires it to support quite old firmware descriptions that
do not have gpio-ranges property.

The change allows to clean up GPIO library from OF specifics.
There is no functional change intended.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: default avatarStefan Wahren <stefan.wahren@i2se.com>
Tested-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Acked-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/r/20230113215352.44272-4-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 2d578dd2
...@@ -358,9 +358,9 @@ static int bcm2835_gpio_direction_output(struct gpio_chip *chip, ...@@ -358,9 +358,9 @@ static int bcm2835_gpio_direction_output(struct gpio_chip *chip,
return 0; return 0;
} }
static int bcm2835_of_gpio_ranges_fallback(struct gpio_chip *gc, static int bcm2835_add_pin_ranges_fallback(struct gpio_chip *gc)
struct device_node *np)
{ {
struct device_node *np = dev_of_node(gc->parent);
struct pinctrl_dev *pctldev = of_pinctrl_get(np); struct pinctrl_dev *pctldev = of_pinctrl_get(np);
if (!pctldev) if (!pctldev)
...@@ -386,7 +386,7 @@ static const struct gpio_chip bcm2835_gpio_chip = { ...@@ -386,7 +386,7 @@ static const struct gpio_chip bcm2835_gpio_chip = {
.base = -1, .base = -1,
.ngpio = BCM2835_NUM_GPIOS, .ngpio = BCM2835_NUM_GPIOS,
.can_sleep = false, .can_sleep = false,
.of_gpio_ranges_fallback = bcm2835_of_gpio_ranges_fallback, .add_pin_ranges = bcm2835_add_pin_ranges_fallback,
}; };
static const struct gpio_chip bcm2711_gpio_chip = { static const struct gpio_chip bcm2711_gpio_chip = {
...@@ -403,7 +403,7 @@ static const struct gpio_chip bcm2711_gpio_chip = { ...@@ -403,7 +403,7 @@ static const struct gpio_chip bcm2711_gpio_chip = {
.base = -1, .base = -1,
.ngpio = BCM2711_NUM_GPIOS, .ngpio = BCM2711_NUM_GPIOS,
.can_sleep = false, .can_sleep = false,
.of_gpio_ranges_fallback = bcm2835_of_gpio_ranges_fallback, .add_pin_ranges = bcm2835_add_pin_ranges_fallback,
}; };
static void bcm2835_gpio_irq_handle_bank(struct bcm2835_pinctrl *pc, static void bcm2835_gpio_irq_handle_bank(struct bcm2835_pinctrl *pc,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment