git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'for-2.6.37' of git://linux-nfs.org/~bfields/linux
[pandora-kernel.git]
/
drivers
/
video
/
backlight
/
pwm_bl.c
diff --git
a/drivers/video/backlight/pwm_bl.c
b/drivers/video/backlight/pwm_bl.c
index
5504435
..
21866ec
100644
(file)
--- a/
drivers/video/backlight/pwm_bl.c
+++ b/
drivers/video/backlight/pwm_bl.c
@@
-25,6
+25,7
@@
struct pwm_bl_data {
struct pwm_device *pwm;
struct device *dev;
unsigned int period;
struct pwm_device *pwm;
struct device *dev;
unsigned int period;
+ unsigned int lth_brightness;
int (*notify)(struct device *,
int brightness);
};
int (*notify)(struct device *,
int brightness);
};
@@
-48,7
+49,9
@@
static int pwm_backlight_update_status(struct backlight_device *bl)
pwm_config(pb->pwm, 0, pb->period);
pwm_disable(pb->pwm);
} else {
pwm_config(pb->pwm, 0, pb->period);
pwm_disable(pb->pwm);
} else {
- pwm_config(pb->pwm, brightness * pb->period / max, pb->period);
+ brightness = pb->lth_brightness +
+ (brightness * (pb->period - pb->lth_brightness) / max);
+ pwm_config(pb->pwm, brightness, pb->period);
pwm_enable(pb->pwm);
}
return 0;
pwm_enable(pb->pwm);
}
return 0;
@@
-92,6
+95,8
@@
static int pwm_backlight_probe(struct platform_device *pdev)
pb->period = data->pwm_period_ns;
pb->notify = data->notify;
pb->period = data->pwm_period_ns;
pb->notify = data->notify;
+ pb->lth_brightness = data->lth_brightness *
+ (data->pwm_period_ns / data->max_brightness);
pb->dev = &pdev->dev;
pb->pwm = pwm_request(data->pwm_id, "backlight");
pb->dev = &pdev->dev;
pb->pwm = pwm_request(data->pwm_id, "backlight");