diff options
author | Kevin Hilman <khilman@ti.com> | 2011-04-22 17:37:16 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@ti.com> | 2011-06-16 14:14:13 -0400 |
commit | e5ff4440cf5206fbb99d9a354ed9024eb3da047d (patch) | |
tree | 79a085d5f2e99deb9a71d018c12738e247d23846 /drivers/gpio | |
parent | 9942da0e4b037a852b230208410141768d473deb (diff) |
gpio/omap: cleanup show revision, remove cpu_is checks, display only once
Remove cpu_is_* checks from gpio_show_revision() by passing in the
revision address offset from platform data. SoCs with no revision
register (15xx, 7xx, and all MPUIOs) use -1 (actually, USHRT_MAX) to
signify no register.
While here, all GPIO banks are assumed to be the same revision, so fix
show_revision() to only show the revision for the first bank it finds.
This removes duplicate GPIO revision prints during boot.
Thanks to Charulatha V <charu@ti.com> for finding/fixing a few -1s
that were missed in the original patch.
Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-omap.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index f212d236f908..501ca3d6a49e 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c | |||
@@ -984,19 +984,17 @@ static int gpio_2irq(struct gpio_chip *chip, unsigned offset) | |||
984 | 984 | ||
985 | static void __init omap_gpio_show_rev(struct gpio_bank *bank) | 985 | static void __init omap_gpio_show_rev(struct gpio_bank *bank) |
986 | { | 986 | { |
987 | static bool called; | ||
987 | u32 rev; | 988 | u32 rev; |
988 | 989 | ||
989 | if (cpu_is_omap16xx() && !(bank->method != METHOD_MPUIO)) | 990 | if (called || bank->regs->revision == USHRT_MAX) |
990 | rev = __raw_readw(bank->base + OMAP1610_GPIO_REVISION); | ||
991 | else if (cpu_is_omap24xx() || cpu_is_omap34xx()) | ||
992 | rev = __raw_readl(bank->base + OMAP24XX_GPIO_REVISION); | ||
993 | else if (cpu_is_omap44xx()) | ||
994 | rev = __raw_readl(bank->base + OMAP4_GPIO_REVISION); | ||
995 | else | ||
996 | return; | 991 | return; |
997 | 992 | ||
998 | printk(KERN_INFO "OMAP GPIO hardware version %d.%d\n", | 993 | rev = __raw_readw(bank->base + bank->regs->revision); |
994 | pr_info("OMAP GPIO hardware version %d.%d\n", | ||
999 | (rev >> 4) & 0x0f, rev & 0x0f); | 995 | (rev >> 4) & 0x0f, rev & 0x0f); |
996 | |||
997 | called = true; | ||
1000 | } | 998 | } |
1001 | 999 | ||
1002 | /* This lock class tells lockdep that GPIO irqs are in a different | 1000 | /* This lock class tells lockdep that GPIO irqs are in a different |