summaryrefslogtreecommitdiff
path: root/drivers/gpio
diff options
context:
space:
mode:
authorDaehyoung Ko <dko@nvidia.com>2011-09-30 17:42:49 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:49:35 -0800
commit52b6d9eb2a5fd416db74102f366f0ee4bef60af3 (patch)
tree65bf15d5319c6a4d5933c3fd4700ee82a7fd8119 /drivers/gpio
parentf20df7895e9c2a8e0ebbd8c806666be3ddf04d61 (diff)
ARM tegra: gpio: Correct gpio interrupt init sequence
It is possible for GPIO interrupt to occur when registering handler since set_irq_chained_handler enables GPIO interrupt. Thus all relevant variables are required to be initialized before calling set_irq_chained_handler. Also add initialization of interrupt status register. Bug 884569 Reviewed-on: http://git-master/r/58218 (cherry picked from commit e03fe4cc1bf06fa6c32c0520e2ba31f009f9301d) Change-Id: Ic76f95215b61d6e091ae1cfa11522f8af9c3eecd Reviewed-on: http://git-master/r/60475 Reviewed-by: Daehyoung Ko <dko@nvidia.com> Tested-by: Daehyoung Ko <dko@nvidia.com> Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Rebase-Id: R5340918dccc1a8b1d95c5b629cc985f44d45fb67
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-tegra.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
index 17e05d6e0e62..88024dd297ef 100644
--- a/drivers/gpio/gpio-tegra.c
+++ b/drivers/gpio/gpio-tegra.c
@@ -397,6 +397,7 @@ static int __init tegra_gpio_init(void)
for (j = 0; j < 4; j++) {
int gpio = tegra_gpio_compose(i, j, 0);
__raw_writel(0x00, GPIO_INT_ENB(gpio));
+ __raw_writel(0x00, GPIO_INT_STA(gpio));
}
}
@@ -424,11 +425,12 @@ static int __init tegra_gpio_init(void)
for (i = 0; i < ARRAY_SIZE(tegra_gpio_banks); i++) {
bank = &tegra_gpio_banks[i];
- irq_set_chained_handler(bank->irq, tegra_gpio_irq_handler);
- irq_set_handler_data(bank->irq, bank);
-
for (j = 0; j < 4; j++)
spin_lock_init(&bank->lvl_lock[j]);
+
+ irq_set_handler_data(bank->irq, bank);
+ irq_set_chained_handler(bank->irq, tegra_gpio_irq_handler);
+
}
return 0;