aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap/gpio.c
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2008-12-10 20:35:25 -0500
committerTony Lindgren <tony@atomide.com>2008-12-10 20:35:25 -0500
commit0b84b5ca43a9c86cfad848c135fdbf7c72af68fa (patch)
tree9eb6f9cfb74c245bdb68be9c8814778ddc2ff1f4 /arch/arm/plat-omap/gpio.c
parenta007b7096feea2d865ad3e7177eb8be34041bef9 (diff)
ARM: OMAP: switch to standard gpio get/set calls
This patch replaces some legacy OMAP GPIO calls with the "new" (not really, any more!) calls that work on most platforms. The calls addressed by this patch are the simple ones to get and set values ... for code that's in mainline, including the implementations of those calls. Except for the declarations and definitions of those calls, all of these changes were performed by a simple SED script. Plus, a few "if() set() else set()" branches were merged by hand. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/plat-omap/gpio.c')
-rw-r--r--arch/arm/plat-omap/gpio.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index e07ab233e783..c0322b56efe9 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -407,20 +407,7 @@ static void _set_gpio_dataout(struct gpio_bank *bank, int gpio, int enable)
407 __raw_writel(l, reg); 407 __raw_writel(l, reg);
408} 408}
409 409
410void omap_set_gpio_dataout(int gpio, int enable) 410static int __omap_get_gpio_datain(int gpio)
411{
412 struct gpio_bank *bank;
413 unsigned long flags;
414
415 if (check_gpio(gpio) < 0)
416 return;
417 bank = get_gpio_bank(gpio);
418 spin_lock_irqsave(&bank->lock, flags);
419 _set_gpio_dataout(bank, get_gpio_index(gpio), enable);
420 spin_unlock_irqrestore(&bank->lock, flags);
421}
422
423int omap_get_gpio_datain(int gpio)
424{ 411{
425 struct gpio_bank *bank; 412 struct gpio_bank *bank;
426 void __iomem *reg; 413 void __iomem *reg;
@@ -1258,7 +1245,7 @@ static int gpio_input(struct gpio_chip *chip, unsigned offset)
1258 1245
1259static int gpio_get(struct gpio_chip *chip, unsigned offset) 1246static int gpio_get(struct gpio_chip *chip, unsigned offset)
1260{ 1247{
1261 return omap_get_gpio_datain(chip->base + offset); 1248 return __omap_get_gpio_datain(chip->base + offset);
1262} 1249}
1263 1250
1264static int gpio_output(struct gpio_chip *chip, unsigned offset, int value) 1251static int gpio_output(struct gpio_chip *chip, unsigned offset, int value)
@@ -1755,8 +1742,6 @@ static int __init omap_gpio_sysinit(void)
1755EXPORT_SYMBOL(omap_request_gpio); 1742EXPORT_SYMBOL(omap_request_gpio);
1756EXPORT_SYMBOL(omap_free_gpio); 1743EXPORT_SYMBOL(omap_free_gpio);
1757EXPORT_SYMBOL(omap_set_gpio_direction); 1744EXPORT_SYMBOL(omap_set_gpio_direction);
1758EXPORT_SYMBOL(omap_set_gpio_dataout);
1759EXPORT_SYMBOL(omap_get_gpio_datain);
1760 1745
1761arch_initcall(omap_gpio_sysinit); 1746arch_initcall(omap_gpio_sysinit);
1762 1747
@@ -1814,7 +1799,7 @@ static int dbg_gpio_show(struct seq_file *s, void *unused)
1814 continue; 1799 continue;
1815 1800
1816 irq = bank->virtual_irq_start + j; 1801 irq = bank->virtual_irq_start + j;
1817 value = omap_get_gpio_datain(gpio); 1802 value = gpio_get_value(gpio);
1818 is_in = gpio_is_input(bank, mask); 1803 is_in = gpio_is_input(bank, mask);
1819 1804
1820 if (bank_is_mpuio(bank)) 1805 if (bank_is_mpuio(bank))