1 From 0c734eb8a3a41ca9f9b452d0d1a7211de6c146dd Mon Sep 17 00:00:00 2001
2 From: Andy Green <andy@openmoko.com>
3 Date: Wed, 2 Jul 2008 22:42:07 +0100
4 Subject: [PATCH] fix-pcf50633-really-defer-backlight-on-resume.patch
6 Backlight wasn't off by default on resume, so it was never really
7 deferred (until LCM is initialized). This fixes that and so removes
8 the brief white screen between pcf50633 resume and LCM init.
10 Signed-off-by: Andy Green <andy@openmoko.com>
12 drivers/i2c/chips/pcf50633.c | 23 +++++++++++++++++------
13 1 files changed, 17 insertions(+), 6 deletions(-)
15 diff --git a/drivers/i2c/chips/pcf50633.c b/drivers/i2c/chips/pcf50633.c
16 index 120fdbc..875a5ee 100644
17 --- a/drivers/i2c/chips/pcf50633.c
18 +++ b/drivers/i2c/chips/pcf50633.c
19 @@ -2481,13 +2481,14 @@ EXPORT_SYMBOL_GPL(pcf50633_ready);
21 void pcf50633_backlight_resume(struct pcf50633_data *pcf)
23 + dev_info(&pcf->client.dev, "pcf50633_backlight_resume\n");
25 /* we force the backlight on in fact */
26 - __reg_write(pcf, PCF50633_REG_LEDOUT, pcf->standby_regs.misc[
27 + reg_write(pcf, PCF50633_REG_LEDDIM, 1);
28 + reg_write(pcf, PCF50633_REG_LEDOUT, pcf->standby_regs.misc[
29 PCF50633_REG_LEDOUT - PCF50633_REG_AUTOOUT]);
30 - __reg_write(pcf, PCF50633_REG_LEDENA, pcf->standby_regs.misc[
31 + reg_write(pcf, PCF50633_REG_LEDENA, pcf->standby_regs.misc[
32 PCF50633_REG_LEDENA - PCF50633_REG_AUTOOUT] | 1);
33 - __reg_write(pcf, PCF50633_REG_LEDDIM, pcf->standby_regs.misc[
34 - PCF50633_REG_LEDDIM - PCF50633_REG_AUTOOUT]);
36 EXPORT_SYMBOL_GPL(pcf50633_backlight_resume);
38 @@ -2498,6 +2499,7 @@ static int pcf50633_resume(struct device *dev)
39 struct pcf50633_data *pcf = i2c_get_clientdata(client);
42 + u8 misc[PCF50633_REG_LEDDIM - PCF50633_REG_AUTOOUT + 1];
44 dev_info(dev, "pcf50633_resume suspended on entry = %d\n",
45 (int)pcf->suspend_state);
46 @@ -2509,11 +2511,20 @@ static int pcf50633_resume(struct device *dev)
48 __reg_write(pcf, PCF50633_REG_OOCTIM2, pcf->standby_regs.ooctim2);
50 + memcpy(misc, pcf->standby_regs.misc, sizeof(pcf->standby_regs.misc));
52 + if (pcf->pdata->defer_resume_backlight) {
53 + misc[PCF50633_REG_LEDOUT - PCF50633_REG_AUTOOUT] = 1;
54 + misc[PCF50633_REG_LEDENA - PCF50633_REG_AUTOOUT] = 0x20;
55 + misc[PCF50633_REG_LEDCTL - PCF50633_REG_AUTOOUT] = 1;
56 + misc[PCF50633_REG_LEDDIM - PCF50633_REG_AUTOOUT] = 1;
59 /* regulator voltages and enable states */
60 ret = i2c_smbus_write_i2c_block_data(&pcf->client,
62 - sizeof(pcf->standby_regs.misc) - 4,
63 - &pcf->standby_regs.misc[0]);
67 dev_err(dev, "Failed to restore misc :-( %d\n", ret);