Skip to content

Commit

Permalink
pinctrl: sunxi: Fix irq_of_xlate for the r_pio pinctrl block
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Chen-Yu Tsai <[email protected]>
Acked-by: Maxime Ripard <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
  • Loading branch information
jwrdegoede authored and linusw committed Oct 23, 2015
1 parent ec879f1 commit 8297992
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/pinctrl/sunxi/pinctrl-sunxi.c
Original file line number Diff line number Diff line change
Expand Up @@ -716,17 +716,17 @@ static int sunxi_pinctrl_irq_of_xlate(struct irq_domain *d,
unsigned long *out_hwirq,
unsigned int *out_type)
{
struct sunxi_pinctrl *pctl = d->host_data;
struct sunxi_desc_function *desc;
int pin, base;

if (intsize < 3)
return -EINVAL;

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,
pin, "irq");
desc = sunxi_pinctrl_desc_find_function_by_pin(pctl, pin, "irq");
if (!desc)
return -EINVAL;

Expand Down

0 comments on commit 8297992

Please sign in to comment.