1 From a3ce0f5da32538cdf96c1dc1d6dc8b7452b096d2 Mon Sep 17 00:00:00 2001
2 From: mokopatches <mokopatches@openmoko.org>
3 Date: Sun, 13 Apr 2008 07:23:59 +0100
4 Subject: [PATCH] suspend-prelim1.patch
7 drivers/i2c/chips/pcf50633.c | 5 +++++
8 drivers/i2c/i2c-core.c | 13 ++++++++++++-
9 drivers/mfd/glamo/glamo-core.c | 2 ++
10 3 files changed, 19 insertions(+), 1 deletions(-)
12 diff --git a/drivers/i2c/chips/pcf50633.c b/drivers/i2c/chips/pcf50633.c
13 index fc1262e..e23c540 100644
14 --- a/drivers/i2c/chips/pcf50633.c
15 +++ b/drivers/i2c/chips/pcf50633.c
16 @@ -1901,6 +1901,9 @@ static int pcf50633_suspend(struct device *dev, pm_message_t state)
20 + /* turn off the backlight */
21 + __reg_write(pcf, PCF50633_REG_LEDENA, 0x00);
23 pcf->standby_regs.int1m = __reg_read(pcf, PCF50633_REG_INT1M);
24 pcf->standby_regs.int2m = __reg_read(pcf, PCF50633_REG_INT2M);
25 pcf->standby_regs.int3m = __reg_read(pcf, PCF50633_REG_INT3M);
26 @@ -1925,6 +1928,8 @@ static int pcf50633_resume(struct device *dev)
28 mutex_lock(&pcf->lock);
30 + __reg_write(pcf, PCF50633_REG_LEDENA, 0x01);
32 /* Resume all saved registers that don't "survive" standby state */
33 __reg_write(pcf, PCF50633_REG_INT1M, pcf->standby_regs.int1m);
34 __reg_write(pcf, PCF50633_REG_INT2M, pcf->standby_regs.int2m);
35 diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
36 index 2c802de..405c957 100644
37 --- a/drivers/i2c/i2c-core.c
38 +++ b/drivers/i2c/i2c-core.c
40 -/* i2c-core.c - a device driver for the iic-bus interface */
41 /* ------------------------------------------------------------------------- */
42 /* Copyright (C) 1995-99 Simon G. Vogl
44 @@ -136,10 +135,16 @@ static int i2c_device_suspend(struct device * dev, pm_message_t mesg)
49 driver = to_i2c_driver(dev->driver);
52 return driver->suspend(to_i2c_client(dev), mesg);
54 + if (!dev->driver->suspend)
56 + return dev->driver->suspend(dev, mesg);
60 static int i2c_device_resume(struct device * dev)
61 @@ -148,10 +153,16 @@ static int i2c_device_resume(struct device * dev)
66 driver = to_i2c_driver(dev->driver);
69 return driver->resume(to_i2c_client(dev));
71 + if (!dev->driver->resume)
73 + return dev->driver->resume(dev);
77 static void i2c_client_release(struct device *dev)
78 diff --git a/drivers/mfd/glamo/glamo-core.c b/drivers/mfd/glamo/glamo-core.c
79 index 8497de2..ffa4945 100644
80 --- a/drivers/mfd/glamo/glamo-core.c
81 +++ b/drivers/mfd/glamo/glamo-core.c
82 @@ -1125,11 +1125,13 @@ static int glamo_remove(struct platform_device *pdev)
84 static int glamo_suspend(struct platform_device *pdev, pm_message_t state)
86 + glamo_power(glamo_handle, GLAMO_POWER_SUSPEND);
90 static int glamo_resume(struct platform_device *pdev)
92 + glamo_power(glamo_handle, GLAMO_POWER_ON);