[ar71xx] create firmware image for the Ubiquiti LS-SR71 board
[openwrt.git] / target / linux / s3c24xx / patches-2.6.24 / 1232-change-backlight-level-not-forced-up-on-resume.patch.patch
1 From db07519c1dfe916bcf9644bfdc4d7c03707a979e Mon Sep 17 00:00:00 2001
2 From: Andy Green <andy@openmoko.com>
3 Date: Tue, 15 Jul 2008 09:04:05 +0100
4 Subject: [PATCH] change-backlight-level-not-forced-up-on-resume.patch
5
6 We at least always enabled backlight on resume, this patch
7 changes us to set backlight back to last requested backlight
8 brightness level on resume. Note it means that you can
9 resume with screen blanked, but it should come back if that
10 happened with touchscreen action as usual.
11
12 /sys/class/backlight/pcf50633-bl/actual_brightness
13 and
14 /sys/class/backlight/pcf50633-bl/brightness
15
16 seem to agree after resume when reportedly they didn't before.
17
18 Signed-off-by: Andy Green <andy@openmoko.com>
19 ---
20 drivers/i2c/chips/pcf50633.c | 29 +++++++++++++++--------------
21 1 files changed, 15 insertions(+), 14 deletions(-)
22
23 diff --git a/drivers/i2c/chips/pcf50633.c b/drivers/i2c/chips/pcf50633.c
24 index 9f98ba1..f461378 100644
25 --- a/drivers/i2c/chips/pcf50633.c
26 +++ b/drivers/i2c/chips/pcf50633.c
27 @@ -1878,22 +1878,14 @@ static int pcf50633bl_get_intensity(struct backlight_device *bd)
28 return intensity & 0x3f;
29 }
30
31 -static int pcf50633bl_set_intensity(struct backlight_device *bd)
32 +static int __pcf50633bl_set_intensity(struct pcf50633_data *pcf, int intensity)
33 {
34 - struct pcf50633_data *pcf = bl_get_data(bd);
35 - int intensity = bd->props.brightness;
36 int old_intensity = reg_read(pcf, PCF50633_REG_LEDOUT);
37 int ret;
38
39 - dev_info(&pcf->client.dev, "pcf50633bl_set_intensity\n");
40 -
41 if (!(reg_read(pcf, PCF50633_REG_LEDENA) & 1))
42 old_intensity = 0;
43
44 - if ((bd->props.power != FB_BLANK_UNBLANK) ||
45 - (bd->props.fb_blank != FB_BLANK_UNBLANK))
46 - intensity = 0;
47 -
48 /*
49 * The PCF50633 cannot handle LEDOUT = 0 (datasheet p60)
50 * if seen, you have to re-enable the LED unit
51 @@ -1919,6 +1911,18 @@ static int pcf50633bl_set_intensity(struct backlight_device *bd)
52 return ret;
53 }
54
55 +static int pcf50633bl_set_intensity(struct backlight_device *bd)
56 +{
57 + struct pcf50633_data *pcf = bl_get_data(bd);
58 + int intensity = bd->props.brightness;
59 +
60 + if ((bd->props.power != FB_BLANK_UNBLANK) ||
61 + (bd->props.fb_blank != FB_BLANK_UNBLANK))
62 + intensity = 0;
63 +
64 + return __pcf50633bl_set_intensity(pcf, intensity);
65 +}
66 +
67 static struct backlight_ops pcf50633bl_ops = {
68 .get_brightness = pcf50633bl_get_intensity,
69 .update_status = pcf50633bl_set_intensity,
70 @@ -2508,11 +2512,8 @@ void pcf50633_backlight_resume(struct pcf50633_data *pcf)
71 /* platform defines resume ramp speed */
72 reg_write(pcf, PCF50633_REG_LEDDIM,
73 pcf->pdata->resume_backlight_ramp_speed);
74 - reg_write(pcf, PCF50633_REG_LEDOUT, pcf->standby_regs.misc[
75 - PCF50633_REG_LEDOUT - PCF50633_REG_AUTOOUT]);
76 - /* we force the backlight on in fact */
77 - reg_write(pcf, PCF50633_REG_LEDENA, pcf->standby_regs.misc[
78 - PCF50633_REG_LEDENA - PCF50633_REG_AUTOOUT] | 1);
79 +
80 + __pcf50633bl_set_intensity(pcf, pcf->backlight->props.brightness);
81 }
82 EXPORT_SYMBOL_GPL(pcf50633_backlight_resume);
83
84 --
85 1.5.6.5
86
This page took 0.046609 seconds and 5 git commands to generate.