diff options
Diffstat (limited to 'drivers/gpu/drm/i915/dvo_ch7xxx.c')
-rw-r--r-- | drivers/gpu/drm/i915/dvo_ch7xxx.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/dvo_ch7xxx.c b/drivers/gpu/drm/i915/dvo_ch7xxx.c index 4a036600e806..38f3a6cb8c7d 100644 --- a/drivers/gpu/drm/i915/dvo_ch7xxx.c +++ b/drivers/gpu/drm/i915/dvo_ch7xxx.c | |||
@@ -289,14 +289,26 @@ static void ch7xxx_mode_set(struct intel_dvo_device *dvo, | |||
289 | } | 289 | } |
290 | 290 | ||
291 | /* set the CH7xxx power state */ | 291 | /* set the CH7xxx power state */ |
292 | static void ch7xxx_dpms(struct intel_dvo_device *dvo, int mode) | 292 | static void ch7xxx_dpms(struct intel_dvo_device *dvo, bool enable) |
293 | { | 293 | { |
294 | if (mode == DRM_MODE_DPMS_ON) | 294 | if (enable) |
295 | ch7xxx_writeb(dvo, CH7xxx_PM, CH7xxx_PM_DVIL | CH7xxx_PM_DVIP); | 295 | ch7xxx_writeb(dvo, CH7xxx_PM, CH7xxx_PM_DVIL | CH7xxx_PM_DVIP); |
296 | else | 296 | else |
297 | ch7xxx_writeb(dvo, CH7xxx_PM, CH7xxx_PM_FPD); | 297 | ch7xxx_writeb(dvo, CH7xxx_PM, CH7xxx_PM_FPD); |
298 | } | 298 | } |
299 | 299 | ||
300 | static bool ch7xxx_get_hw_state(struct intel_dvo_device *dvo) | ||
301 | { | ||
302 | u8 val; | ||
303 | |||
304 | ch7xxx_readb(dvo, CH7xxx_PM, &val); | ||
305 | |||
306 | if (val & CH7xxx_PM_FPD) | ||
307 | return false; | ||
308 | else | ||
309 | return true; | ||
310 | } | ||
311 | |||
300 | static void ch7xxx_dump_regs(struct intel_dvo_device *dvo) | 312 | static void ch7xxx_dump_regs(struct intel_dvo_device *dvo) |
301 | { | 313 | { |
302 | int i; | 314 | int i; |
@@ -326,6 +338,7 @@ struct intel_dvo_dev_ops ch7xxx_ops = { | |||
326 | .mode_valid = ch7xxx_mode_valid, | 338 | .mode_valid = ch7xxx_mode_valid, |
327 | .mode_set = ch7xxx_mode_set, | 339 | .mode_set = ch7xxx_mode_set, |
328 | .dpms = ch7xxx_dpms, | 340 | .dpms = ch7xxx_dpms, |
341 | .get_hw_state = ch7xxx_get_hw_state, | ||
329 | .dump_regs = ch7xxx_dump_regs, | 342 | .dump_regs = ch7xxx_dump_regs, |
330 | .destroy = ch7xxx_destroy, | 343 | .destroy = ch7xxx_destroy, |
331 | }; | 344 | }; |