diff options
author | Paul Mundt <lethal@linux-sh.org> | 2011-01-13 04:38:28 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-01-13 04:38:28 -0500 |
commit | 8b6f08eaef16dfcfebc32fa9a017bf70336ad9ec (patch) | |
tree | 9f29f39de67b85baad5eca7d7165549a166c4367 /drivers/gpu/drm/i915/intel_panel.c | |
parent | 4ae26f46c98f58ef19ad34f475617b40740d2faa (diff) | |
parent | 8a453cac94803910305f7e95cbd157b6bbd88811 (diff) |
Merge branch 'sh/alphaproject' into sh-latest
Diffstat (limited to 'drivers/gpu/drm/i915/intel_panel.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_panel.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index 7350ec2515c6..e00d200df3db 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c | |||
@@ -250,3 +250,34 @@ void intel_panel_set_backlight(struct drm_device *dev, u32 level) | |||
250 | tmp &= ~BACKLIGHT_DUTY_CYCLE_MASK; | 250 | tmp &= ~BACKLIGHT_DUTY_CYCLE_MASK; |
251 | I915_WRITE(BLC_PWM_CTL, tmp | level); | 251 | I915_WRITE(BLC_PWM_CTL, tmp | level); |
252 | } | 252 | } |
253 | |||
254 | void intel_panel_disable_backlight(struct drm_device *dev) | ||
255 | { | ||
256 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
257 | |||
258 | if (dev_priv->backlight_enabled) { | ||
259 | dev_priv->backlight_level = intel_panel_get_backlight(dev); | ||
260 | dev_priv->backlight_enabled = false; | ||
261 | } | ||
262 | |||
263 | intel_panel_set_backlight(dev, 0); | ||
264 | } | ||
265 | |||
266 | void intel_panel_enable_backlight(struct drm_device *dev) | ||
267 | { | ||
268 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
269 | |||
270 | if (dev_priv->backlight_level == 0) | ||
271 | dev_priv->backlight_level = intel_panel_get_max_backlight(dev); | ||
272 | |||
273 | intel_panel_set_backlight(dev, dev_priv->backlight_level); | ||
274 | dev_priv->backlight_enabled = true; | ||
275 | } | ||
276 | |||
277 | void intel_panel_setup_backlight(struct drm_device *dev) | ||
278 | { | ||
279 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
280 | |||
281 | dev_priv->backlight_level = intel_panel_get_max_backlight(dev); | ||
282 | dev_priv->backlight_enabled = dev_priv->backlight_level != 0; | ||
283 | } | ||