Skip to content

Commit 7832986

Browse files
author
Bartosz Golaszewski
committed
pinctrl: ingenic: use new pinctrl GPIO helpers
Replace the pinctrl helpers taking the global GPIO number as argument with the improved variants that instead take a pointer to the GPIO chip and the controller-relative offset. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Acked-by: Linus Walleij <linus.walleij@linaro.org>
1 parent 4125651 commit 7832986

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

drivers/pinctrl/pinctrl-ingenic.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ struct ingenic_pinctrl {
133133
struct pinctrl_pin_desc *pdesc;
134134

135135
const struct ingenic_chip_info *info;
136+
137+
struct gpio_chip *gc;
136138
};
137139

138140
struct ingenic_gpio_chip {
@@ -3561,14 +3563,14 @@ static int ingenic_gpio_get(struct gpio_chip *gc, unsigned int offset)
35613563
static int ingenic_gpio_direction_input(struct gpio_chip *gc,
35623564
unsigned int offset)
35633565
{
3564-
return pinctrl_gpio_direction_input(gc->base + offset);
3566+
return pinctrl_gpio_direction_input_new(gc, offset);
35653567
}
35663568

35673569
static int ingenic_gpio_direction_output(struct gpio_chip *gc,
35683570
unsigned int offset, int value)
35693571
{
35703572
ingenic_gpio_set(gc, offset, value);
3571-
return pinctrl_gpio_direction_output(gc->base + offset);
3573+
return pinctrl_gpio_direction_output_new(gc, offset);
35723574
}
35733575

35743576
static inline void ingenic_config_pin(struct ingenic_pinctrl *jzpc,
@@ -4052,7 +4054,8 @@ static int ingenic_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
40524054
break;
40534055

40544056
case PIN_CONFIG_OUTPUT:
4055-
ret = pinctrl_gpio_direction_output(pin);
4057+
ret = pinctrl_gpio_direction_output_new(jzpc->gc,
4058+
pin - jzpc->gc->base);
40564059
if (ret)
40574060
return ret;
40584061

@@ -4172,6 +4175,8 @@ static int __init ingenic_gpio_probe(struct ingenic_pinctrl *jzpc,
41724175
if (!jzgc)
41734176
return -ENOMEM;
41744177

4178+
jzpc->gc = &jzgc->gc;
4179+
41754180
jzgc->jzpc = jzpc;
41764181
jzgc->reg_base = bank * jzpc->info->reg_offset;
41774182

0 commit comments

Comments
 (0)