diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2011-04-25 15:38:01 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:42:33 -0800 |
commit | 733678bd001820babdb3ca756f3f2c339b4a8156 (patch) | |
tree | 1ff49ed6d8fe1bd8cd22e9fb36e33ae8a57d27c3 /drivers/gpio | |
parent | 2fa0552df27d46d94e6544d2b56961d7f5a883da (diff) |
arm: tegra: gpio: Removing fixed number of gpio bank.
The number of gpio bank varies from arch to arch and in
this case, the gpio bank count should not fix to single
arch.
Making the gpio bank count based on number of gpio bank
available in a corresponding architecture.
Original-Change-Id: I16ece8945db519d73c702c8bb832b42cc0bf35fc
Reviewed-on: http://git-master/r/29625
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Scott Williams <scwilliams@nvidia.com>
Rebase-Id: R31dcbc6e0511c4ace85979f059dabdb5b62d4270
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-tegra.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c index 9a9c8b188c08..0e14caa4b66d 100644 --- a/drivers/gpio/gpio-tegra.c +++ b/drivers/gpio/gpio-tegra.c @@ -6,6 +6,8 @@ * Author: * Erik Gilling <konkers@google.com> * + * Copyright (c) 2011 NVIDIA Corporation. + * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. @@ -378,7 +380,7 @@ static int __init tegra_gpio_init(void) int i; int j; - for (i = 0; i < 7; i++) { + for (i = 0; i < ARRAY_SIZE(tegra_gpio_banks); i++) { for (j = 0; j < 4; j++) { int gpio = tegra_gpio_compose(i, j, 0); __raw_writel(0x00, GPIO_INT_ENB(gpio)); @@ -445,7 +447,8 @@ static int dbg_gpio_show(struct seq_file *s, void *unused) int i; int j; - for (i = 0; i < 7; i++) { + seq_printf(s, "Bank:Port CNF OE OUT IN INT_STA INT_ENB INT_LVL\n"); + for (i = 0; i < ARRAY_SIZE(tegra_gpio_banks); i++) { for (j = 0; j < 4; j++) { int gpio = tegra_gpio_compose(i, j, 0); seq_printf(s, |