diff options
author | Tomi Valkeinen <tomi.valkeinen@nokia.com> | 2010-04-15 09:41:07 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@nokia.com> | 2010-08-03 08:18:47 -0400 |
commit | 1cbc8703e1c510a245a7bd5e269987402ffc9e18 (patch) | |
tree | feb9a86ee833d723ffd2e90ee1a7013bc4b01392 /drivers | |
parent | 4ffa35713e263fbf4975e14bc6f4a515b7701349 (diff) |
OMAP: DSS2: Taal: add locks to taal_bl_update_status
taal_bl_update_status was missing locks to protect taal_data. This caused
a kernel crash randomly, as the code attempted to set the brightness while
the OMAP's DSI block was actually disabled.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/omap2/displays/panel-taal.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c index aaf5d308a046..d2e2ac7444e0 100644 --- a/drivers/video/omap2/displays/panel-taal.c +++ b/drivers/video/omap2/displays/panel-taal.c | |||
@@ -290,24 +290,26 @@ static int taal_bl_update_status(struct backlight_device *dev) | |||
290 | 290 | ||
291 | dev_dbg(&dssdev->dev, "update brightness to %d\n", level); | 291 | dev_dbg(&dssdev->dev, "update brightness to %d\n", level); |
292 | 292 | ||
293 | mutex_lock(&td->lock); | ||
294 | |||
293 | if (td->use_dsi_bl) { | 295 | if (td->use_dsi_bl) { |
294 | if (td->enabled) { | 296 | if (td->enabled) { |
295 | dsi_bus_lock(); | 297 | dsi_bus_lock(); |
296 | r = taal_dcs_write_1(DCS_BRIGHTNESS, level); | 298 | r = taal_dcs_write_1(DCS_BRIGHTNESS, level); |
297 | dsi_bus_unlock(); | 299 | dsi_bus_unlock(); |
298 | if (r) | 300 | } else { |
299 | return r; | 301 | r = 0; |
300 | } | 302 | } |
301 | } else { | 303 | } else { |
302 | if (!dssdev->set_backlight) | 304 | if (!dssdev->set_backlight) |
303 | return -EINVAL; | 305 | r = -EINVAL; |
304 | 306 | else | |
305 | r = dssdev->set_backlight(dssdev, level); | 307 | r = dssdev->set_backlight(dssdev, level); |
306 | if (r) | ||
307 | return r; | ||
308 | } | 308 | } |
309 | 309 | ||
310 | return 0; | 310 | mutex_unlock(&td->lock); |
311 | |||
312 | return r; | ||
311 | } | 313 | } |
312 | 314 | ||
313 | static int taal_bl_get_intensity(struct backlight_device *dev) | 315 | static int taal_bl_get_intensity(struct backlight_device *dev) |