diff options
author | Hans de Goede <hdegoede@redhat.com> | 2015-10-16 03:46:11 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2015-10-23 04:11:34 -0400 |
commit | 8297992cad599e8a214e65959ccdde51738fe5a2 (patch) | |
tree | bb8ff9767d7e68aa020337b96589cb89b0240fdf /drivers/pinctrl/sunxi | |
parent | ec879f1272283c040bc70e1a1fff5edbb547be59 (diff) |
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: Hans de Goede <hdegoede@redhat.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/sunxi')
-rw-r--r-- | drivers/pinctrl/sunxi/pinctrl-sunxi.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c index fe2c74a10245..21fd638171f9 100644 --- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c +++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c | |||
@@ -716,6 +716,7 @@ static int sunxi_pinctrl_irq_of_xlate(struct irq_domain *d, | |||
716 | unsigned long *out_hwirq, | 716 | unsigned long *out_hwirq, |
717 | unsigned int *out_type) | 717 | unsigned int *out_type) |
718 | { | 718 | { |
719 | struct sunxi_pinctrl *pctl = d->host_data; | ||
719 | struct sunxi_desc_function *desc; | 720 | struct sunxi_desc_function *desc; |
720 | int pin, base; | 721 | int pin, base; |
721 | 722 | ||
@@ -723,10 +724,9 @@ static int sunxi_pinctrl_irq_of_xlate(struct irq_domain *d, | |||
723 | return -EINVAL; | 724 | return -EINVAL; |
724 | 725 | ||
725 | base = PINS_PER_BANK * intspec[0]; | 726 | base = PINS_PER_BANK * intspec[0]; |
726 | pin = base + intspec[1]; | 727 | pin = pctl->desc->pin_base + base + intspec[1]; |
727 | 728 | ||
728 | desc = sunxi_pinctrl_desc_find_function_by_pin(d->host_data, | 729 | desc = sunxi_pinctrl_desc_find_function_by_pin(pctl, pin, "irq"); |
729 | pin, "irq"); | ||
730 | if (!desc) | 730 | if (!desc) |
731 | return -EINVAL; | 731 | return -EINVAL; |
732 | 732 | ||