1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
From a158085e182617f31960599ab1f468668c3161d4 Mon Sep 17 00:00:00 2001
From: mokopatches <mokopatches@openmoko.org>
Date: Fri, 25 Jul 2008 23:05:18 +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 bb0c5e5..c300975 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
@@ -160,10 +159,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)
@@ -172,10 +177,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.3
|