aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-26 12:34:29 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-26 12:34:29 -0500
commit3eb05225ee8efb81fe50558f5f9d94e7477ade8f (patch)
tree40692236718c808455f1fcdfbc1c6de6a274eb36 /drivers/video
parented5dc2372dba46e0ecd08791b1a0399d313e5cff (diff)
parent30f786170352b8264bc7b61c2482713e54accec8 (diff)
Merge tag 'for-3.9-rc1' of git://gitorious.org/linux-pwm/linux-pwm
Pull PWM changes from Thierry Reding: "A new driver has been added to support the PWM mode of the timer counter blocks found on Atmel AT91 SoCs. The VT8500 driver now supports changing the PWM signal polarity and the TI drivers (EHRPWM and ECAP) gained suspend and resume functionality. User drivers can now query the core for whether access to a PWM device will sleep (if the PWM chip is on a slow bus such as I2C or SPI). The pwm-backlight driver now handles the backlight BL_CORE_FBBLANK state in addition to the FB layer's blanking states. To round things off, a few fixes and cleanups are also included" * tag 'for-3.9-rc1' of git://gitorious.org/linux-pwm/linux-pwm: pwm: twl: Use to_twl() instead of container_of() pwm: tegra: assume CONFIG_OF pwm_backlight: Validate dft_brightness in main probe function pwm: Export pwm_{set,get}_chip_data() pwm: Make Kconfig entries more consistent pwm: Add can_sleep property to drivers pwm: Add pwm_can_sleep() as exported API to users pwm-backlight: handle BL_CORE_FBBLANK state pwm: pwm-tiecap: Low power sleep support pwm: pwm-tiehrpwm: Low power sleep support pwm: pwm-tiehrpwm: Update the clock handling of pwm-tiehrpwm driver pwm: vt8500: Add polarity support pwm: vt8500: Register write busy test performed incorrectly pwm: atmel: add Timer Counter Block PWM driver
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/backlight/pwm_bl.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index f2f4c43d6e22..fa00304a63d8 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -41,10 +41,9 @@ static int pwm_backlight_update_status(struct backlight_device *bl)
41 int brightness = bl->props.brightness; 41 int brightness = bl->props.brightness;
42 int max = bl->props.max_brightness; 42 int max = bl->props.max_brightness;
43 43
44 if (bl->props.power != FB_BLANK_UNBLANK) 44 if (bl->props.power != FB_BLANK_UNBLANK ||
45 brightness = 0; 45 bl->props.fb_blank != FB_BLANK_UNBLANK ||
46 46 bl->props.state & BL_CORE_FBBLANK)
47 if (bl->props.fb_blank != FB_BLANK_UNBLANK)
48 brightness = 0; 47 brightness = 0;
49 48
50 if (pb->notify) 49 if (pb->notify)
@@ -135,12 +134,6 @@ static int pwm_backlight_parse_dt(struct device *dev,
135 if (ret < 0) 134 if (ret < 0)
136 return ret; 135 return ret;
137 136
138 if (value >= data->max_brightness) {
139 dev_warn(dev, "invalid default brightness level: %u, using %u\n",
140 value, data->max_brightness - 1);
141 value = data->max_brightness - 1;
142 }
143
144 data->dft_brightness = value; 137 data->dft_brightness = value;
145 data->max_brightness--; 138 data->max_brightness--;
146 } 139 }
@@ -249,6 +242,13 @@ static int pwm_backlight_probe(struct platform_device *pdev)
249 goto err_alloc; 242 goto err_alloc;
250 } 243 }
251 244
245 if (data->dft_brightness > data->max_brightness) {
246 dev_warn(&pdev->dev,
247 "invalid default brightness level: %u, using %u\n",
248 data->dft_brightness, data->max_brightness);
249 data->dft_brightness = data->max_brightness;
250 }
251
252 bl->props.brightness = data->dft_brightness; 252 bl->props.brightness = data->dft_brightness;
253 backlight_update_status(bl); 253 backlight_update_status(bl);
254 254