From 470080015c1f8bbd15ba1486d5c4bd8a3e7fa79a Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Tue, 23 Aug 2011 00:39:55 +0100 Subject: ARM: 7052/1: gpio/tegra: Remove use of irq_to_gpio irq_to_gpio is being removed. Replace the only use of that API by the ARM Tegra sub-architecture. Signed-off-by: Stephen Warren Signed-off-by: Russell King --- drivers/gpio/gpio-tegra.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'drivers/gpio/gpio-tegra.c') diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c index 747eb40e8af..ecade29d79e 100644 --- a/drivers/gpio/gpio-tegra.c +++ b/drivers/gpio/gpio-tegra.c @@ -331,6 +331,7 @@ static struct lock_class_key gpio_lock_class; static int __init tegra_gpio_init(void) { struct tegra_gpio_bank *bank; + int gpio; int i; int j; @@ -352,14 +353,17 @@ static int __init tegra_gpio_init(void) gpiochip_add(&tegra_gpio_chip); - for (i = INT_GPIO_BASE; i < (INT_GPIO_BASE + TEGRA_NR_GPIOS); i++) { - bank = &tegra_gpio_banks[GPIO_BANK(irq_to_gpio(i))]; + for (gpio = 0; gpio < TEGRA_NR_GPIOS; gpio++) { + int irq = TEGRA_GPIO_TO_IRQ(gpio); + /* No validity check; all Tegra GPIOs are valid IRQs */ - irq_set_lockdep_class(i, &gpio_lock_class); - irq_set_chip_data(i, bank); - irq_set_chip_and_handler(i, &tegra_gpio_irq_chip, + bank = &tegra_gpio_banks[GPIO_BANK(gpio)]; + + irq_set_lockdep_class(irq, &gpio_lock_class); + irq_set_chip_data(irq, bank); + irq_set_chip_and_handler(irq, &tegra_gpio_irq_chip, handle_simple_irq); - set_irq_flags(i, IRQF_VALID); + set_irq_flags(irq, IRQF_VALID); } for (i = 0; i < ARRAY_SIZE(tegra_gpio_banks); i++) { -- cgit v1.2.3 From 438a99c078b1bc3c9aebd92e7928f2477311d3e5 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Tue, 23 Aug 2011 00:39:56 +0100 Subject: ARM: 7053/1: gpio/tegra: Implement gpio_chip.to_irq Signed-off-by: Stephen Warren Signed-off-by: Russell King --- drivers/gpio/gpio-tegra.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'drivers/gpio/gpio-tegra.c') diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c index ecade29d79e..df64536464f 100644 --- a/drivers/gpio/gpio-tegra.c +++ b/drivers/gpio/gpio-tegra.c @@ -134,7 +134,10 @@ static int tegra_gpio_direction_output(struct gpio_chip *chip, unsigned offset, return 0; } - +static int tegra_gpio_to_irq(struct gpio_chip *chip, unsigned offset) +{ + return TEGRA_GPIO_TO_IRQ(offset); +} static struct gpio_chip tegra_gpio_chip = { .label = "tegra-gpio", @@ -142,6 +145,7 @@ static struct gpio_chip tegra_gpio_chip = { .get = tegra_gpio_get, .direction_output = tegra_gpio_direction_output, .set = tegra_gpio_set, + .to_irq = tegra_gpio_to_irq, .base = 0, .ngpio = TEGRA_NR_GPIOS, }; -- cgit v1.2.3 From ea5abbd215b749b2ff14397a47a5e65741c67bf4 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Mon, 26 Sep 2011 19:00:02 +0100 Subject: ARM: 7101/1: arm/tegra: Replace with This will eventually allow to be deleted. This mirrors LinusW's recent equivalent work on various other ARM platforms. Signed-off-by: Stephen Warren Acked-by: Olof Johansson Signed-off-by: Russell King --- drivers/gpio/gpio-tegra.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/gpio/gpio-tegra.c') diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c index df64536464f..6b65207c810 100644 --- a/drivers/gpio/gpio-tegra.c +++ b/drivers/gpio/gpio-tegra.c @@ -27,6 +27,7 @@ #include +#include #include #include -- cgit v1.2.3