Commit d53f77d7 authored by Linus Walleij's avatar Linus Walleij

Merge tag 'renesas-pinctrl-for-v6.2-tag1' of...

Merge tag 'renesas-pinctrl-for-v6.2-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into devel

pinctrl: renesas: Updates for v6.2

  - Use dynamic GPIO base on combined pincctrl/gpio controllers on
    SH/R-Mobile SoCs,
  - Miscellaneous improvements.
parents 91dd3114 80d34260
...@@ -135,12 +135,12 @@ static int gpio_pin_request(struct gpio_chip *gc, unsigned offset) ...@@ -135,12 +135,12 @@ static int gpio_pin_request(struct gpio_chip *gc, unsigned offset)
if (idx < 0 || pfc->info->pins[idx].enum_id == 0) if (idx < 0 || pfc->info->pins[idx].enum_id == 0)
return -EINVAL; return -EINVAL;
return pinctrl_gpio_request(offset); return pinctrl_gpio_request(gc->base + offset);
} }
static void gpio_pin_free(struct gpio_chip *gc, unsigned offset) static void gpio_pin_free(struct gpio_chip *gc, unsigned offset)
{ {
return pinctrl_gpio_free(offset); return pinctrl_gpio_free(gc->base + offset);
} }
static void gpio_pin_set_value(struct sh_pfc_chip *chip, unsigned offset, static void gpio_pin_set_value(struct sh_pfc_chip *chip, unsigned offset,
...@@ -164,7 +164,7 @@ static void gpio_pin_set_value(struct sh_pfc_chip *chip, unsigned offset, ...@@ -164,7 +164,7 @@ static void gpio_pin_set_value(struct sh_pfc_chip *chip, unsigned offset,
static int gpio_pin_direction_input(struct gpio_chip *gc, unsigned offset) static int gpio_pin_direction_input(struct gpio_chip *gc, unsigned offset)
{ {
return pinctrl_gpio_direction_input(offset); return pinctrl_gpio_direction_input(gc->base + offset);
} }
static int gpio_pin_direction_output(struct gpio_chip *gc, unsigned offset, static int gpio_pin_direction_output(struct gpio_chip *gc, unsigned offset,
...@@ -172,7 +172,7 @@ static int gpio_pin_direction_output(struct gpio_chip *gc, unsigned offset, ...@@ -172,7 +172,7 @@ static int gpio_pin_direction_output(struct gpio_chip *gc, unsigned offset,
{ {
gpio_pin_set_value(gpiochip_get_data(gc), offset, value); gpio_pin_set_value(gpiochip_get_data(gc), offset, value);
return pinctrl_gpio_direction_output(offset); return pinctrl_gpio_direction_output(gc->base + offset);
} }
static int gpio_pin_get(struct gpio_chip *gc, unsigned offset) static int gpio_pin_get(struct gpio_chip *gc, unsigned offset)
...@@ -238,7 +238,7 @@ static int gpio_pin_setup(struct sh_pfc_chip *chip) ...@@ -238,7 +238,7 @@ static int gpio_pin_setup(struct sh_pfc_chip *chip)
gc->label = pfc->info->name; gc->label = pfc->info->name;
gc->parent = pfc->dev; gc->parent = pfc->dev;
gc->owner = THIS_MODULE; gc->owner = THIS_MODULE;
gc->base = 0; gc->base = IS_ENABLED(CONFIG_PINCTRL_SH_FUNC_GPIO) ? 0 : -1;
gc->ngpio = pfc->nr_gpio_pins; gc->ngpio = pfc->nr_gpio_pins;
return 0; return 0;
......
...@@ -438,8 +438,7 @@ static int rzg2l_dt_node_to_map(struct pinctrl_dev *pctldev, ...@@ -438,8 +438,7 @@ static int rzg2l_dt_node_to_map(struct pinctrl_dev *pctldev,
ret = -EINVAL; ret = -EINVAL;
done: done:
if (ret < 0) rzg2l_dt_free_map(pctldev, *map, *num_maps);
rzg2l_dt_free_map(pctldev, *map, *num_maps);
return ret; return ret;
} }
......
...@@ -399,8 +399,7 @@ static int rzv2m_dt_node_to_map(struct pinctrl_dev *pctldev, ...@@ -399,8 +399,7 @@ static int rzv2m_dt_node_to_map(struct pinctrl_dev *pctldev,
ret = -EINVAL; ret = -EINVAL;
done: done:
if (ret < 0) rzv2m_dt_free_map(pctldev, *map, *num_maps);
rzv2m_dt_free_map(pctldev, *map, *num_maps);
return ret; return ret;
} }
......
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