aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-nomadik
diff options
context:
space:
mode:
authorRabin Vincent <rabin.vincent@stericsson.com>2010-06-16 01:10:43 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-06-16 17:29:00 -0400
commit0d2aec9cd356254649fa2aa6bb5fb4d20cfded2c (patch)
tree57709a1e24ecfb9a94a46f607e7a8a1d6c1549a4 /arch/arm/plat-nomadik
parent4d4e20f77c6170eaec61976e0a165bdff6b09d79 (diff)
ARM: 6176/1: nomadik-gpio: implement to_irq
So that gpio_to_irq() works. Acked-by: Alessandro Rubini <rubini@unipv.it> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/plat-nomadik')
-rw-r--r--arch/arm/plat-nomadik/gpio.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/arm/plat-nomadik/gpio.c b/arch/arm/plat-nomadik/gpio.c
index 9cb717417ba0..1e0e9130e51e 100644
--- a/arch/arm/plat-nomadik/gpio.c
+++ b/arch/arm/plat-nomadik/gpio.c
@@ -515,12 +515,21 @@ static int nmk_gpio_make_output(struct gpio_chip *chip, unsigned offset,
515 return 0; 515 return 0;
516} 516}
517 517
518static int nmk_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
519{
520 struct nmk_gpio_chip *nmk_chip =
521 container_of(chip, struct nmk_gpio_chip, chip);
522
523 return NOMADIK_GPIO_TO_IRQ(nmk_chip->chip.base) + offset;
524}
525
518/* This structure is replicated for each GPIO block allocated at probe time */ 526/* This structure is replicated for each GPIO block allocated at probe time */
519static struct gpio_chip nmk_gpio_template = { 527static struct gpio_chip nmk_gpio_template = {
520 .direction_input = nmk_gpio_make_input, 528 .direction_input = nmk_gpio_make_input,
521 .get = nmk_gpio_get_input, 529 .get = nmk_gpio_get_input,
522 .direction_output = nmk_gpio_make_output, 530 .direction_output = nmk_gpio_make_output,
523 .set = nmk_gpio_set_output, 531 .set = nmk_gpio_set_output,
532 .to_irq = nmk_gpio_to_irq,
524 .ngpio = NMK_GPIO_PER_CHIP, 533 .ngpio = NMK_GPIO_PER_CHIP,
525 .can_sleep = 0, 534 .can_sleep = 0,
526}; 535};