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.c35
1 files changed, 9 insertions, 26 deletions
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index d2adcdda23cf..bd9e32187eab 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>
@@ -1372,9 +1372,7 @@ static const struct dev_pm_ops omap_mpuio_dev_pm_ops = {
1372 .resume_noirq = omap_mpuio_resume_noirq, 1372 .resume_noirq = omap_mpuio_resume_noirq,
1373}; 1373};
1374 1374
1375/* use platform_driver for this, now that there's no longer any 1375/* use platform_driver for this. */
1376 * point to sys_device (other than not disturbing old code).
1377 */
1378static struct platform_driver omap_mpuio_driver = { 1376static struct platform_driver omap_mpuio_driver = {
1379 .driver = { 1377 .driver = {
1380 .name = "mpuio", 1378 .name = "mpuio",
@@ -1745,7 +1743,7 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev)
1745} 1743}
1746 1744
1747#if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP2PLUS) 1745#if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP2PLUS)
1748static int omap_gpio_suspend(struct sys_device *dev, pm_message_t mesg) 1746static int omap_gpio_suspend(void)
1749{ 1747{
1750 int i; 1748 int i;
1751 1749
@@ -1795,12 +1793,12 @@ static int omap_gpio_suspend(struct sys_device *dev, pm_message_t mesg)
1795 return 0; 1793 return 0;
1796} 1794}
1797 1795
1798static int omap_gpio_resume(struct sys_device *dev) 1796static void omap_gpio_resume(void)
1799{ 1797{
1800 int i; 1798 int i;
1801 1799
1802 if (!cpu_class_is_omap2() && !cpu_is_omap16xx()) 1800 if (!cpu_class_is_omap2() && !cpu_is_omap16xx())
1803 return 0; 1801 return;
1804 1802
1805 for (i = 0; i < gpio_bank_count; i++) { 1803 for (i = 0; i < gpio_bank_count; i++) {
1806 struct gpio_bank *bank = &gpio_bank[i]; 1804 struct gpio_bank *bank = &gpio_bank[i];
@@ -1836,21 +1834,13 @@ static int omap_gpio_resume(struct sys_device *dev)
1836 __raw_writel(bank->saved_wakeup, wake_set); 1834 __raw_writel(bank->saved_wakeup, wake_set);
1837 spin_unlock_irqrestore(&bank->lock, flags); 1835 spin_unlock_irqrestore(&bank->lock, flags);
1838 } 1836 }
1839
1840 return 0;
1841} 1837}
1842 1838
1843static struct sysdev_class omap_gpio_sysclass = { 1839static struct syscore_ops omap_gpio_syscore_ops = {
1844 .name = "gpio",
1845 .suspend = omap_gpio_suspend, 1840 .suspend = omap_gpio_suspend,
1846 .resume = omap_gpio_resume, 1841 .resume = omap_gpio_resume,
1847}; 1842};
1848 1843
1849static struct sys_device omap_gpio_device = {
1850 .id = 0,
1851 .cls = &omap_gpio_sysclass,
1852};
1853
1854#endif 1844#endif
1855 1845
1856#ifdef CONFIG_ARCH_OMAP2PLUS 1846#ifdef CONFIG_ARCH_OMAP2PLUS
@@ -2108,21 +2098,14 @@ postcore_initcall(omap_gpio_drv_reg);
2108 2098
2109static int __init omap_gpio_sysinit(void) 2099static int __init omap_gpio_sysinit(void)
2110{ 2100{
2111 int ret = 0;
2112
2113 mpuio_init(); 2101 mpuio_init();
2114 2102
2115#if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP2PLUS) 2103#if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP2PLUS)
2116 if (cpu_is_omap16xx() || cpu_class_is_omap2()) { 2104 if (cpu_is_omap16xx() || cpu_class_is_omap2())
2117 if (ret == 0) { 2105 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 2106#endif
2124 2107
2125 return ret; 2108 return 0;
2126} 2109}
2127 2110
2128arch_initcall(omap_gpio_sysinit); 2111arch_initcall(omap_gpio_sysinit);