diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2014-01-29 18:47:29 +0530 |
---|---|---|
committer | Laxman Dewangan <ldewangan@nvidia.com> | 2014-01-30 01:23:07 -0800 |
commit | 4a13b0b4b54190bba4c8d2e2b33ff86c8cf5e83d (patch) | |
tree | 73938fe943abba5ae520d0e8a721421cbcde2a30 /drivers/gpio/gpio-tegra.c | |
parent | e8e9e4fe6491be4de2845a7b0f553f3daaca664e (diff) |
gpio: tegra: prints gpio port name when taking dump
When taking dump of tegra gpio through debug FS, also prints the
gpio port name like A, B, C, etc. for easy understanding.
Change-Id: I38af2f7c696ad7633456be5ca1f8c164edcd94f6
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/361532
Diffstat (limited to 'drivers/gpio/gpio-tegra.c')
-rw-r--r-- | drivers/gpio/gpio-tegra.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c index 5369f4cb9a75..3f35036e1f30 100644 --- a/drivers/gpio/gpio-tegra.c +++ b/drivers/gpio/gpio-tegra.c @@ -646,14 +646,18 @@ static int dbg_gpio_show(struct seq_file *s, void *unused) { int i; int j; + char x,y; - seq_printf(s, "Bank:Port CNF OE OUT IN INT_STA INT_ENB INT_LVL\n"); + x = ' '; + y = 'A'; + + seq_printf(s, "Name:Bank:Port CNF OE OUT IN INT_STA INT_ENB INT_LVL\n"); for (i = 0; i < tegra_gpio_bank_count; i++) { for (j = 0; j < 4; j++) { int gpio = tegra_gpio_compose(i, j, 0); seq_printf(s, - "%d:%d %02x %02x %02x %02x %02x %02x %06x\n", - i, j, + "%c%c: %d:%d %02x %02x %02x %02x %02x %02x %06x\n", + x, y, i, j, tegra_gpio_readl(GPIO_CNF(gpio)), tegra_gpio_readl(GPIO_OE(gpio)), tegra_gpio_readl(GPIO_OUT(gpio)), @@ -661,6 +665,15 @@ static int dbg_gpio_show(struct seq_file *s, void *unused) tegra_gpio_readl(GPIO_INT_STA(gpio)), tegra_gpio_readl(GPIO_INT_ENB(gpio)), tegra_gpio_readl(GPIO_INT_LVL(gpio))); + + if (x != ' ') + x++; + if (y == 'Z') { + y = 'A'; + x = 'A'; + } else { + y++; + }; } } return 0; |