Commit 8297992c authored by Hans de Goede's avatar Hans de Goede Committed by Linus Walleij

pinctrl: sunxi: Fix irq_of_xlate for the r_pio pinctrl block

The r_pio gpio / pin controller has a pin_base of non 0, we need to
adjust for this before calling sunxi_pinctrl_desc_find_function_by_pin.
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Acked-by: default avatarChen-Yu Tsai <wens@csie.org>
Acked-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent ec879f12
...@@ -716,6 +716,7 @@ static int sunxi_pinctrl_irq_of_xlate(struct irq_domain *d, ...@@ -716,6 +716,7 @@ static int sunxi_pinctrl_irq_of_xlate(struct irq_domain *d,
unsigned long *out_hwirq, unsigned long *out_hwirq,
unsigned int *out_type) unsigned int *out_type)
{ {
struct sunxi_pinctrl *pctl = d->host_data;
struct sunxi_desc_function *desc; struct sunxi_desc_function *desc;
int pin, base; int pin, base;
...@@ -723,10 +724,9 @@ static int sunxi_pinctrl_irq_of_xlate(struct irq_domain *d, ...@@ -723,10 +724,9 @@ static int sunxi_pinctrl_irq_of_xlate(struct irq_domain *d,
return -EINVAL; return -EINVAL;
base = PINS_PER_BANK * intspec[0]; base = PINS_PER_BANK * intspec[0];
pin = base + intspec[1]; pin = pctl->desc->pin_base + base + intspec[1];
desc = sunxi_pinctrl_desc_find_function_by_pin(d->host_data, desc = sunxi_pinctrl_desc_find_function_by_pin(pctl, pin, "irq");
pin, "irq");
if (!desc) if (!desc)
return -EINVAL; return -EINVAL;
......
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