aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap/gpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/plat-omap/gpio.c')
-rw-r--r--arch/arm/plat-omap/gpio.c42
1 files changed, 13 insertions, 29 deletions
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index d2adcdda23cf..efb869390199 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -17,7 +17,7 @@
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/module.h> 18#include <linux/module.h>
19#include <linux/interrupt.h> 19#include <linux/interrupt.h>
20#include <linux/sysdev.h> 20#include <linux/syscore_ops.h>
21#include <linux/err.h> 21#include <linux/err.h>
22#include <linux/clk.h> 22#include <linux/clk.h>
23#include <linux/io.h> 23#include <linux/io.h>
@@ -1137,8 +1137,9 @@ static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
1137 struct gpio_bank *bank; 1137 struct gpio_bank *bank;
1138 u32 retrigger = 0; 1138 u32 retrigger = 0;
1139 int unmasked = 0; 1139 int unmasked = 0;
1140 struct irq_chip *chip = irq_desc_get_chip(desc);
1140 1141
1141 desc->irq_data.chip->irq_ack(&desc->irq_data); 1142 chained_irq_enter(chip, desc);
1142 1143
1143 bank = irq_get_handler_data(irq); 1144 bank = irq_get_handler_data(irq);
1144#ifdef CONFIG_ARCH_OMAP1 1145#ifdef CONFIG_ARCH_OMAP1
@@ -1195,7 +1196,7 @@ static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
1195 configured, we could unmask GPIO bank interrupt immediately */ 1196 configured, we could unmask GPIO bank interrupt immediately */
1196 if (!level_mask && !unmasked) { 1197 if (!level_mask && !unmasked) {
1197 unmasked = 1; 1198 unmasked = 1;
1198 desc->irq_data.chip->irq_unmask(&desc->irq_data); 1199 chained_irq_exit(chip, desc);
1199 } 1200 }
1200 1201
1201 isr |= retrigger; 1202 isr |= retrigger;
@@ -1231,7 +1232,7 @@ static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
1231 interrupt */ 1232 interrupt */
1232exit: 1233exit:
1233 if (!unmasked) 1234 if (!unmasked)
1234 desc->irq_data.chip->irq_unmask(&desc->irq_data); 1235 chained_irq_exit(chip, desc);
1235} 1236}
1236 1237
1237static void gpio_irq_shutdown(struct irq_data *d) 1238static void gpio_irq_shutdown(struct irq_data *d)
@@ -1372,9 +1373,7 @@ static const struct dev_pm_ops omap_mpuio_dev_pm_ops = {
1372 .resume_noirq = omap_mpuio_resume_noirq, 1373 .resume_noirq = omap_mpuio_resume_noirq,
1373}; 1374};
1374 1375
1375/* use platform_driver for this, now that there's no longer any 1376/* use platform_driver for this. */
1376 * point to sys_device (other than not disturbing old code).
1377 */
1378static struct platform_driver omap_mpuio_driver = { 1377static struct platform_driver omap_mpuio_driver = {
1379 .driver = { 1378 .driver = {
1380 .name = "mpuio", 1379 .name = "mpuio",
@@ -1745,7 +1744,7 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev)
1745} 1744}
1746 1745
1747#if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP2PLUS) 1746#if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP2PLUS)
1748static int omap_gpio_suspend(struct sys_device *dev, pm_message_t mesg) 1747static int omap_gpio_suspend(void)
1749{ 1748{
1750 int i; 1749 int i;
1751 1750
@@ -1795,12 +1794,12 @@ static int omap_gpio_suspend(struct sys_device *dev, pm_message_t mesg)
1795 return 0; 1794 return 0;
1796} 1795}
1797 1796
1798static int omap_gpio_resume(struct sys_device *dev) 1797static void omap_gpio_resume(void)
1799{ 1798{
1800 int i; 1799 int i;
1801 1800
1802 if (!cpu_class_is_omap2() && !cpu_is_omap16xx()) 1801 if (!cpu_class_is_omap2() && !cpu_is_omap16xx())
1803 return 0; 1802 return;
1804 1803
1805 for (i = 0; i < gpio_bank_count; i++) { 1804 for (i = 0; i < gpio_bank_count; i++) {
1806 struct gpio_bank *bank = &gpio_bank[i]; 1805 struct gpio_bank *bank = &gpio_bank[i];
@@ -1836,21 +1835,13 @@ static int omap_gpio_resume(struct sys_device *dev)
1836 __raw_writel(bank->saved_wakeup, wake_set); 1835 __raw_writel(bank->saved_wakeup, wake_set);
1837 spin_unlock_irqrestore(&bank->lock, flags); 1836 spin_unlock_irqrestore(&bank->lock, flags);
1838 } 1837 }
1839
1840 return 0;
1841} 1838}
1842 1839
1843static struct sysdev_class omap_gpio_sysclass = { 1840static struct syscore_ops omap_gpio_syscore_ops = {
1844 .name = "gpio",
1845 .suspend = omap_gpio_suspend, 1841 .suspend = omap_gpio_suspend,
1846 .resume = omap_gpio_resume, 1842 .resume = omap_gpio_resume,
1847}; 1843};
1848 1844
1849static struct sys_device omap_gpio_device = {
1850 .id = 0,
1851 .cls = &omap_gpio_sysclass,
1852};
1853
1854#endif 1845#endif
1855 1846
1856#ifdef CONFIG_ARCH_OMAP2PLUS 1847#ifdef CONFIG_ARCH_OMAP2PLUS
@@ -2108,21 +2099,14 @@ postcore_initcall(omap_gpio_drv_reg);
2108 2099
2109static int __init omap_gpio_sysinit(void) 2100static int __init omap_gpio_sysinit(void)
2110{ 2101{
2111 int ret = 0;
2112
2113 mpuio_init(); 2102 mpuio_init();
2114 2103
2115#if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP2PLUS) 2104#if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP2PLUS)
2116 if (cpu_is_omap16xx() || cpu_class_is_omap2()) { 2105 if (cpu_is_omap16xx() || cpu_class_is_omap2())
2117 if (ret == 0) { 2106 register_syscore_ops(&omap_gpio_syscore_ops);
2118 ret = sysdev_class_register(&omap_gpio_sysclass);
2119 if (ret == 0)
2120 ret = sysdev_register(&omap_gpio_device);
2121 }
2122 }
2123#endif 2107#endif
2124 2108
2125 return ret; 2109 return 0;
2126} 2110}
2127 2111
2128arch_initcall(omap_gpio_sysinit); 2112arch_initcall(omap_gpio_sysinit);