aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Drake <dsd@laptop.org>2011-06-25 12:34:10 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2011-07-06 17:44:28 -0400
commita3128588b3c6be634a9013a375903e0b55668f0a (patch)
tree7889b876bf0188f4eff3b7b50cfdc15273a6180e
parent7a0d4fcf6d4b80b30503fd2701eeef1883e11404 (diff)
x86, olpc: Rename olpc-xo1 to olpc-xo1-pm
Based on earlier review comments, we'll no longer try to stick all of our XO-1 goodies in a single driver. We'll split it into a power management driver, and an EC/SCI driver. As a first step, rename olpc-xo1 to olpc-xo1-pm, and make it builtin instead of modular. Signed-off-by: Daniel Drake <dsd@laptop.org> Link: http://lkml.kernel.org/r/1309019658-1712-4-git-send-email-dsd@laptop.org Acked-by: Andres Salomon <dilinger@queued.net> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r--arch/x86/Kconfig7
-rw-r--r--arch/x86/platform/olpc/Makefile2
-rw-r--r--arch/x86/platform/olpc/olpc-xo1-pm.c (renamed from arch/x86/platform/olpc/olpc-xo1.c)43
3 files changed, 20 insertions, 32 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index da349723d411..29615ee688a5 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2073,11 +2073,12 @@ config OLPC
2073 Add support for detecting the unique features of the OLPC 2073 Add support for detecting the unique features of the OLPC
2074 XO hardware. 2074 XO hardware.
2075 2075
2076config OLPC_XO1 2076config OLPC_XO1_PM
2077 tristate "OLPC XO-1 support" 2077 bool "OLPC XO-1 Power Management"
2078 depends on OLPC && MFD_CS5535 2078 depends on OLPC && MFD_CS5535
2079 select MFD_CORE
2079 ---help--- 2080 ---help---
2080 Add support for non-essential features of the OLPC XO-1 laptop. 2081 Add support for poweroff of the OLPC XO-1 laptop.
2081 2082
2082endif # X86_32 2083endif # X86_32
2083 2084
diff --git a/arch/x86/platform/olpc/Makefile b/arch/x86/platform/olpc/Makefile
index 81c5e2165c24..cd250387d4bb 100644
--- a/arch/x86/platform/olpc/Makefile
+++ b/arch/x86/platform/olpc/Makefile
@@ -1,2 +1,2 @@
1obj-$(CONFIG_OLPC) += olpc.o olpc_ofw.o olpc_dt.o 1obj-$(CONFIG_OLPC) += olpc.o olpc_ofw.o olpc_dt.o
2obj-$(CONFIG_OLPC_XO1) += olpc-xo1.o 2obj-$(CONFIG_OLPC_XO1_PM) += olpc-xo1-pm.o
diff --git a/arch/x86/platform/olpc/olpc-xo1.c b/arch/x86/platform/olpc/olpc-xo1-pm.c
index a63e9488979f..a2a59d36824d 100644
--- a/arch/x86/platform/olpc/olpc-xo1.c
+++ b/arch/x86/platform/olpc/olpc-xo1-pm.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Support for features of the OLPC XO-1 laptop 2 * Support for power management features of the OLPC XO-1 laptop
3 * 3 *
4 * Copyright (C) 2010 Andres Salomon <dilinger@queued.net> 4 * Copyright (C) 2010 Andres Salomon <dilinger@queued.net>
5 * Copyright (C) 2010 One Laptop per Child 5 * Copyright (C) 2010 One Laptop per Child
@@ -13,7 +13,6 @@
13 */ 13 */
14 14
15#include <linux/cs5535.h> 15#include <linux/cs5535.h>
16#include <linux/module.h>
17#include <linux/platform_device.h> 16#include <linux/platform_device.h>
18#include <linux/pm.h> 17#include <linux/pm.h>
19#include <linux/mfd/core.h> 18#include <linux/mfd/core.h>
@@ -21,7 +20,7 @@
21#include <asm/io.h> 20#include <asm/io.h>
22#include <asm/olpc.h> 21#include <asm/olpc.h>
23 22
24#define DRV_NAME "olpc-xo1" 23#define DRV_NAME "olpc-xo1-pm"
25 24
26static unsigned long acpi_base; 25static unsigned long acpi_base;
27static unsigned long pms_base; 26static unsigned long pms_base;
@@ -44,7 +43,7 @@ static void xo1_power_off(void)
44 outl(0x00002000, acpi_base + CS5536_PM1_CNT); 43 outl(0x00002000, acpi_base + CS5536_PM1_CNT);
45} 44}
46 45
47static int __devinit olpc_xo1_probe(struct platform_device *pdev) 46static int __devinit xo1_pm_probe(struct platform_device *pdev)
48{ 47{
49 struct resource *res; 48 struct resource *res;
50 int err; 49 int err;
@@ -76,7 +75,7 @@ static int __devinit olpc_xo1_probe(struct platform_device *pdev)
76 return 0; 75 return 0;
77} 76}
78 77
79static int __devexit olpc_xo1_remove(struct platform_device *pdev) 78static int __devexit xo1_pm_remove(struct platform_device *pdev)
80{ 79{
81 mfd_cell_disable(pdev); 80 mfd_cell_disable(pdev);
82 81
@@ -89,48 +88,36 @@ static int __devexit olpc_xo1_remove(struct platform_device *pdev)
89 return 0; 88 return 0;
90} 89}
91 90
92static struct platform_driver cs5535_pms_drv = { 91static struct platform_driver cs5535_pms_driver = {
93 .driver = { 92 .driver = {
94 .name = "cs5535-pms", 93 .name = "cs5535-pms",
95 .owner = THIS_MODULE, 94 .owner = THIS_MODULE,
96 }, 95 },
97 .probe = olpc_xo1_probe, 96 .probe = xo1_pm_probe,
98 .remove = __devexit_p(olpc_xo1_remove), 97 .remove = __devexit_p(xo1_pm_remove),
99}; 98};
100 99
101static struct platform_driver cs5535_acpi_drv = { 100static struct platform_driver cs5535_acpi_driver = {
102 .driver = { 101 .driver = {
103 .name = "olpc-xo1-pm-acpi", 102 .name = "olpc-xo1-pm-acpi",
104 .owner = THIS_MODULE, 103 .owner = THIS_MODULE,
105 }, 104 },
106 .probe = olpc_xo1_probe, 105 .probe = xo1_pm_probe,
107 .remove = __devexit_p(olpc_xo1_remove), 106 .remove = __devexit_p(xo1_pm_remove),
108}; 107};
109 108
110static int __init olpc_xo1_init(void) 109static int __init xo1_pm_init(void)
111{ 110{
112 int r; 111 int r;
113 112
114 r = platform_driver_register(&cs5535_pms_drv); 113 r = platform_driver_register(&cs5535_pms_driver);
115 if (r) 114 if (r)
116 return r; 115 return r;
117 116
118 r = platform_driver_register(&cs5535_acpi_drv); 117 r = platform_driver_register(&cs5535_acpi_driver);
119 if (r) 118 if (r)
120 platform_driver_unregister(&cs5535_pms_drv); 119 platform_driver_unregister(&cs5535_pms_driver);
121 120
122 return r; 121 return r;
123} 122}
124 123arch_initcall(xo1_pm_init);
125static void __exit olpc_xo1_exit(void)
126{
127 platform_driver_unregister(&cs5535_acpi_drv);
128 platform_driver_unregister(&cs5535_pms_drv);
129}
130
131MODULE_AUTHOR("Daniel Drake <dsd@laptop.org>");
132MODULE_LICENSE("GPL");
133MODULE_ALIAS("platform:cs5535-pms");
134
135module_init(olpc_xo1_init);
136module_exit(olpc_xo1_exit);