Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 336384
b: refs/heads/master
c: a728c7c
h: refs/heads/master
v: v3
  • Loading branch information
Jean-Christophe PLAGNIOL-VILLARD authored and Linus Walleij committed Oct 24, 2012
1 parent 1aed766 commit 661620f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 525fae21317658ae556ca850f3004319004641d1
refs/heads/master: a728c7cdd033f0cbeacc302d2409a2428e68e1be
26 changes: 25 additions & 1 deletion trunk/drivers/pinctrl/pinctrl-at91.c
Original file line number Diff line number Diff line change
Expand Up @@ -1255,9 +1255,33 @@ static int at91_gpio_irq_map(struct irq_domain *h, unsigned int virq,
return 0;
}

int at91_gpio_irq_domain_xlate(struct irq_domain *d, struct device_node *ctrlr,
const u32 *intspec, unsigned int intsize,
irq_hw_number_t *out_hwirq, unsigned int *out_type)
{
struct at91_gpio_chip *at91_gpio = d->host_data;
int ret;
int pin = at91_gpio->chip.base + intspec[0];

if (WARN_ON(intsize < 2))
return -EINVAL;
*out_hwirq = intspec[0];
*out_type = intspec[1] & IRQ_TYPE_SENSE_MASK;

ret = gpio_request(pin, ctrlr->full_name);
if (ret)
return ret;

ret = gpio_direction_input(pin);
if (ret)
return ret;

return 0;
}

static struct irq_domain_ops at91_gpio_ops = {
.map = at91_gpio_irq_map,
.xlate = irq_domain_xlate_twocell,
.xlate = at91_gpio_irq_domain_xlate,
};

static int at91_gpio_of_irq_setup(struct device_node *node,
Expand Down

0 comments on commit 661620f

Please sign in to comment.