mirror of https://github.com/hak5/openwrt-owl.git
99 lines
2.9 KiB
Diff
99 lines
2.9 KiB
Diff
|
From a3ce0f5da32538cdf96c1dc1d6dc8b7452b096d2 Mon Sep 17 00:00:00 2001
|
||
|
From: mokopatches <mokopatches@openmoko.org>
|
||
|
Date: Sun, 13 Apr 2008 07:23:59 +0100
|
||
|
Subject: [PATCH] suspend-prelim1.patch
|
||
|
|
||
|
---
|
||
|
drivers/i2c/chips/pcf50633.c | 5 +++++
|
||
|
drivers/i2c/i2c-core.c | 13 ++++++++++++-
|
||
|
drivers/mfd/glamo/glamo-core.c | 2 ++
|
||
|
3 files changed, 19 insertions(+), 1 deletions(-)
|
||
|
|
||
|
diff --git a/drivers/i2c/chips/pcf50633.c b/drivers/i2c/chips/pcf50633.c
|
||
|
index fc1262e..e23c540 100644
|
||
|
--- a/drivers/i2c/chips/pcf50633.c
|
||
|
+++ b/drivers/i2c/chips/pcf50633.c
|
||
|
@@ -1901,6 +1901,9 @@ static int pcf50633_suspend(struct device *dev, pm_message_t state)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
+ /* turn off the backlight */
|
||
|
+ __reg_write(pcf, PCF50633_REG_LEDENA, 0x00);
|
||
|
+
|
||
|
pcf->standby_regs.int1m = __reg_read(pcf, PCF50633_REG_INT1M);
|
||
|
pcf->standby_regs.int2m = __reg_read(pcf, PCF50633_REG_INT2M);
|
||
|
pcf->standby_regs.int3m = __reg_read(pcf, PCF50633_REG_INT3M);
|
||
|
@@ -1925,6 +1928,8 @@ static int pcf50633_resume(struct device *dev)
|
||
|
|
||
|
mutex_lock(&pcf->lock);
|
||
|
|
||
|
+ __reg_write(pcf, PCF50633_REG_LEDENA, 0x01);
|
||
|
+
|
||
|
/* Resume all saved registers that don't "survive" standby state */
|
||
|
__reg_write(pcf, PCF50633_REG_INT1M, pcf->standby_regs.int1m);
|
||
|
__reg_write(pcf, PCF50633_REG_INT2M, pcf->standby_regs.int2m);
|
||
|
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
|
||
|
index 2c802de..405c957 100644
|
||
|
--- a/drivers/i2c/i2c-core.c
|
||
|
+++ b/drivers/i2c/i2c-core.c
|
||
|
@@ -1,4 +1,3 @@
|
||
|
-/* i2c-core.c - a device driver for the iic-bus interface */
|
||
|
/* ------------------------------------------------------------------------- */
|
||
|
/* Copyright (C) 1995-99 Simon G. Vogl
|
||
|
|
||
|
@@ -136,10 +135,16 @@ static int i2c_device_suspend(struct device * dev, pm_message_t mesg)
|
||
|
|
||
|
if (!dev->driver)
|
||
|
return 0;
|
||
|
+#if 0
|
||
|
driver = to_i2c_driver(dev->driver);
|
||
|
if (!driver->suspend)
|
||
|
return 0;
|
||
|
return driver->suspend(to_i2c_client(dev), mesg);
|
||
|
+#else
|
||
|
+ if (!dev->driver->suspend)
|
||
|
+ return 0;
|
||
|
+ return dev->driver->suspend(dev, mesg);
|
||
|
+#endif
|
||
|
}
|
||
|
|
||
|
static int i2c_device_resume(struct device * dev)
|
||
|
@@ -148,10 +153,16 @@ static int i2c_device_resume(struct device * dev)
|
||
|
|
||
|
if (!dev->driver)
|
||
|
return 0;
|
||
|
+#if 0
|
||
|
driver = to_i2c_driver(dev->driver);
|
||
|
if (!driver->resume)
|
||
|
return 0;
|
||
|
return driver->resume(to_i2c_client(dev));
|
||
|
+#else
|
||
|
+ if (!dev->driver->resume)
|
||
|
+ return 0;
|
||
|
+ return dev->driver->resume(dev);
|
||
|
+#endif
|
||
|
}
|
||
|
|
||
|
static void i2c_client_release(struct device *dev)
|
||
|
diff --git a/drivers/mfd/glamo/glamo-core.c b/drivers/mfd/glamo/glamo-core.c
|
||
|
index 8497de2..ffa4945 100644
|
||
|
--- a/drivers/mfd/glamo/glamo-core.c
|
||
|
+++ b/drivers/mfd/glamo/glamo-core.c
|
||
|
@@ -1125,11 +1125,13 @@ static int glamo_remove(struct platform_device *pdev)
|
||
|
#ifdef CONFIG_PM
|
||
|
static int glamo_suspend(struct platform_device *pdev, pm_message_t state)
|
||
|
{
|
||
|
+ glamo_power(glamo_handle, GLAMO_POWER_SUSPEND);
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
static int glamo_resume(struct platform_device *pdev)
|
||
|
{
|
||
|
+ glamo_power(glamo_handle, GLAMO_POWER_ON);
|
||
|
return 0;
|
||
|
}
|
||
|
#else
|
||
|
--
|
||
|
1.5.6.5
|
||
|
|