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>
This commit is contained in:
committed by
H. Peter Anvin
parent
7a0d4fcf6d
commit
a3128588b3
@@ -2073,11 +2073,12 @@ config OLPC
|
|||||||
Add support for detecting the unique features of the OLPC
|
Add support for detecting the unique features of the OLPC
|
||||||
XO hardware.
|
XO hardware.
|
||||||
|
|
||||||
config OLPC_XO1
|
config OLPC_XO1_PM
|
||||||
tristate "OLPC XO-1 support"
|
bool "OLPC XO-1 Power Management"
|
||||||
depends on OLPC && MFD_CS5535
|
depends on OLPC && MFD_CS5535
|
||||||
|
select MFD_CORE
|
||||||
---help---
|
---help---
|
||||||
Add support for non-essential features of the OLPC XO-1 laptop.
|
Add support for poweroff of the OLPC XO-1 laptop.
|
||||||
|
|
||||||
endif # X86_32
|
endif # X86_32
|
||||||
|
|
||||||
|
@@ -1,2 +1,2 @@
|
|||||||
obj-$(CONFIG_OLPC) += olpc.o olpc_ofw.o olpc_dt.o
|
obj-$(CONFIG_OLPC) += olpc.o olpc_ofw.o olpc_dt.o
|
||||||
obj-$(CONFIG_OLPC_XO1) += olpc-xo1.o
|
obj-$(CONFIG_OLPC_XO1_PM) += olpc-xo1-pm.o
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Support for features of the OLPC XO-1 laptop
|
* Support for power management features of the OLPC XO-1 laptop
|
||||||
*
|
*
|
||||||
* Copyright (C) 2010 Andres Salomon <dilinger@queued.net>
|
* Copyright (C) 2010 Andres Salomon <dilinger@queued.net>
|
||||||
* Copyright (C) 2010 One Laptop per Child
|
* Copyright (C) 2010 One Laptop per Child
|
||||||
@@ -13,7 +13,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/cs5535.h>
|
#include <linux/cs5535.h>
|
||||||
#include <linux/module.h>
|
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
#include <linux/pm.h>
|
#include <linux/pm.h>
|
||||||
#include <linux/mfd/core.h>
|
#include <linux/mfd/core.h>
|
||||||
@@ -21,7 +20,7 @@
|
|||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
#include <asm/olpc.h>
|
#include <asm/olpc.h>
|
||||||
|
|
||||||
#define DRV_NAME "olpc-xo1"
|
#define DRV_NAME "olpc-xo1-pm"
|
||||||
|
|
||||||
static unsigned long acpi_base;
|
static unsigned long acpi_base;
|
||||||
static unsigned long pms_base;
|
static unsigned long pms_base;
|
||||||
@@ -44,7 +43,7 @@ static void xo1_power_off(void)
|
|||||||
outl(0x00002000, acpi_base + CS5536_PM1_CNT);
|
outl(0x00002000, acpi_base + CS5536_PM1_CNT);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __devinit olpc_xo1_probe(struct platform_device *pdev)
|
static int __devinit xo1_pm_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
int err;
|
int err;
|
||||||
@@ -76,7 +75,7 @@ static int __devinit olpc_xo1_probe(struct platform_device *pdev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __devexit olpc_xo1_remove(struct platform_device *pdev)
|
static int __devexit xo1_pm_remove(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
mfd_cell_disable(pdev);
|
mfd_cell_disable(pdev);
|
||||||
|
|
||||||
@@ -89,48 +88,36 @@ static int __devexit olpc_xo1_remove(struct platform_device *pdev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct platform_driver cs5535_pms_drv = {
|
static struct platform_driver cs5535_pms_driver = {
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "cs5535-pms",
|
.name = "cs5535-pms",
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
},
|
},
|
||||||
.probe = olpc_xo1_probe,
|
.probe = xo1_pm_probe,
|
||||||
.remove = __devexit_p(olpc_xo1_remove),
|
.remove = __devexit_p(xo1_pm_remove),
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct platform_driver cs5535_acpi_drv = {
|
static struct platform_driver cs5535_acpi_driver = {
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "olpc-xo1-pm-acpi",
|
.name = "olpc-xo1-pm-acpi",
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
},
|
},
|
||||||
.probe = olpc_xo1_probe,
|
.probe = xo1_pm_probe,
|
||||||
.remove = __devexit_p(olpc_xo1_remove),
|
.remove = __devexit_p(xo1_pm_remove),
|
||||||
};
|
};
|
||||||
|
|
||||||
static int __init olpc_xo1_init(void)
|
static int __init xo1_pm_init(void)
|
||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
r = platform_driver_register(&cs5535_pms_drv);
|
r = platform_driver_register(&cs5535_pms_driver);
|
||||||
if (r)
|
if (r)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
r = platform_driver_register(&cs5535_acpi_drv);
|
r = platform_driver_register(&cs5535_acpi_driver);
|
||||||
if (r)
|
if (r)
|
||||||
platform_driver_unregister(&cs5535_pms_drv);
|
platform_driver_unregister(&cs5535_pms_driver);
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
arch_initcall(xo1_pm_init);
|
||||||
static void __exit olpc_xo1_exit(void)
|
|
||||||
{
|
|
||||||
platform_driver_unregister(&cs5535_acpi_drv);
|
|
||||||
platform_driver_unregister(&cs5535_pms_drv);
|
|
||||||
}
|
|
||||||
|
|
||||||
MODULE_AUTHOR("Daniel Drake <dsd@laptop.org>");
|
|
||||||
MODULE_LICENSE("GPL");
|
|
||||||
MODULE_ALIAS("platform:cs5535-pms");
|
|
||||||
|
|
||||||
module_init(olpc_xo1_init);
|
|
||||||
module_exit(olpc_xo1_exit);
|
|
Reference in New Issue
Block a user