bcm47xx: Implement the remaining PMU resource inits.
[openwrt.git] / target / linux / s3c24xx / patches-2.6.26 / 1179-fix-pcf50633-really-defer-backlight-on-resume.patch.patch
1 From 568981c881e20fccdbfffb073c3868dcdc012446 Mon Sep 17 00:00:00 2001
2 From: Andy Green <andy@openmoko.com>
3 Date: Fri, 25 Jul 2008 23:06:15 +0100
4 Subject: [PATCH] fix-pcf50633-really-defer-backlight-on-resume.patch
5
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.
9
10 Signed-off-by: Andy Green <andy@openmoko.com>
11 ---
12 drivers/i2c/chips/pcf50633.c | 23 +++++++++++++++++------
13 1 files changed, 17 insertions(+), 6 deletions(-)
14
15 diff --git a/drivers/i2c/chips/pcf50633.c b/drivers/i2c/chips/pcf50633.c
16 index 33c4ef4..bbc8ae6 100644
17 --- a/drivers/i2c/chips/pcf50633.c
18 +++ b/drivers/i2c/chips/pcf50633.c
19 @@ -2474,13 +2474,14 @@ EXPORT_SYMBOL_GPL(pcf50633_ready);
20
21 void pcf50633_backlight_resume(struct pcf50633_data *pcf)
22 {
23 + dev_info(&pcf->client.dev, "pcf50633_backlight_resume\n");
24 +
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]);
35 }
36 EXPORT_SYMBOL_GPL(pcf50633_backlight_resume);
37
38 @@ -2491,6 +2492,7 @@ static int pcf50633_resume(struct device *dev)
39 struct pcf50633_data *pcf = i2c_get_clientdata(client);
40 int ret;
41 u8 res[5];
42 + u8 misc[PCF50633_REG_LEDDIM - PCF50633_REG_AUTOOUT + 1];
43
44 dev_info(dev, "pcf50633_resume suspended on entry = %d\n",
45 (int)pcf->suspend_state);
46 @@ -2502,11 +2504,20 @@ static int pcf50633_resume(struct device *dev)
47
48 __reg_write(pcf, PCF50633_REG_OOCTIM2, pcf->standby_regs.ooctim2);
49
50 + memcpy(misc, pcf->standby_regs.misc, sizeof(pcf->standby_regs.misc));
51 +
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;
57 + }
58 +
59 /* regulator voltages and enable states */
60 ret = i2c_smbus_write_i2c_block_data(&pcf->client,
61 PCF50633_REG_AUTOOUT,
62 - sizeof(pcf->standby_regs.misc) - 4,
63 - &pcf->standby_regs.misc[0]);
64 + sizeof(misc),
65 + &misc[0]);
66 if (ret)
67 dev_err(dev, "Failed to restore misc :-( %d\n", ret);
68
69 --
70 1.5.6.3
71
This page took 0.04474 seconds and 5 git commands to generate.