1 --- a/drivers/pinctrl/pinctrl-xway.c
2 +++ b/drivers/pinctrl/pinctrl-xway.c
3 @@ -563,10 +563,9 @@ static struct pinctrl_desc xway_pctrl_de
4 .confops = &xway_pinconf_ops,
7 -static inline int xway_mux_apply(struct pinctrl_dev *pctrldev,
8 +static int mux_apply(struct ltq_pinmux_info *info,
11 - struct ltq_pinmux_info *info = pinctrl_dev_get_drvdata(pctrldev);
13 u32 alt1_reg = GPIO_ALT1(pin);
15 @@ -586,6 +585,14 @@ static inline int xway_mux_apply(struct
19 +static inline int xway_mux_apply(struct pinctrl_dev *pctrldev,
22 + struct ltq_pinmux_info *info = pinctrl_dev_get_drvdata(pctrldev);
24 + return mux_apply(info, pin, mux);
27 static const struct ltq_cfg_param xway_cfg_params[] = {
28 {"lantiq,pull", LTQ_PINCONF_PARAM_PULL},
29 {"lantiq,open-drain", LTQ_PINCONF_PARAM_OPEN_DRAIN},
30 @@ -630,6 +637,10 @@ static int xway_gpio_dir_out(struct gpio
32 struct ltq_pinmux_info *info = dev_get_drvdata(chip->dev);
34 + if (PORT(pin) == PORT3)
35 + gpio_setbit(info->membase[0], GPIO3_OD, PORT_PIN(pin));
37 + gpio_setbit(info->membase[0], GPIO_OD(pin), PORT_PIN(pin));
38 gpio_setbit(info->membase[0], GPIO_DIR(pin), PORT_PIN(pin));
39 xway_gpio_set(chip, pin, val);
41 @@ -650,6 +661,18 @@ static void xway_gpio_free(struct gpio_c
42 pinctrl_free_gpio(gpio);
45 +static int xway_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
47 + struct ltq_pinmux_info *info = dev_get_drvdata(chip->dev);
50 + for (i = 0; i < info->num_exin; i++)
51 + if (info->exin[i] == offset)
52 + return ltq_eiu_get_irq(i);
57 static struct gpio_chip xway_chip = {
59 .direction_input = xway_gpio_dir_in,
60 @@ -658,6 +681,7 @@ static struct gpio_chip xway_chip = {
62 .request = xway_gpio_req,
63 .free = xway_gpio_free,
64 + .to_irq = xway_gpio_to_irq,