summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/dvo_ns2501.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-08-12 19:27:12 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-08-17 10:10:02 +0200
commitfac3274c4ee090140410b2f29d3fbd8f10eae186 (patch)
tree76dddaff935feeb008bb4c3d35538325ce92e176 /drivers/gpu/drm/i915/dvo_ns2501.c
parentd2434ab7fb085ac6848acd9d82366f96a642e471 (diff)
drm/i915: simplify dvo dpms interface
All dvo drivers only support 2 dpms states, and our dvo driver even switches of the dvo port for anything else than DPMS_ON. Hence ditch this complexity and simply use bool enable. While reading through this code I've noticed that the mode_set function of ch7017 is a bit peculiar - it disable the lvds again, even though the crtc helper code should have done that ... This might be to work around an issue at driver load, we pretty much ignore the hw state when taking over. v2: Also do the conversion for the new ns2501 driver. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/dvo_ns2501.c')
-rw-r--r--drivers/gpu/drm/i915/dvo_ns2501.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/gpu/drm/i915/dvo_ns2501.c b/drivers/gpu/drm/i915/dvo_ns2501.c
index 6bd383dfbb09..c4d9f2f395e6 100644
--- a/drivers/gpu/drm/i915/dvo_ns2501.c
+++ b/drivers/gpu/drm/i915/dvo_ns2501.c
@@ -493,19 +493,19 @@ static void ns2501_mode_set(struct intel_dvo_device *dvo,
}
/* set the NS2501 power state */
-static void ns2501_dpms(struct intel_dvo_device *dvo, int mode)
+static void ns2501_dpms(struct intel_dvo_device *dvo, bool enable)
{
bool ok;
bool restore = false;
struct ns2501_priv *ns = (struct ns2501_priv *)(dvo->dev_priv);
unsigned char ch;
- DRM_DEBUG_KMS("%s: Trying set the dpms of the DVO to %d\n",
- __FUNCTION__, mode);
+ DRM_DEBUG_KMS("%s: Trying set the dpms of the DVO to %i\n",
+ __FUNCTION__, enable);
ch = ns->reg_8_shadow;
- if (mode == DRM_MODE_DPMS_ON)
+ if (enable)
ch |= NS2501_8_PD;
else
ch &= ~NS2501_8_PD;
@@ -519,12 +519,10 @@ static void ns2501_dpms(struct intel_dvo_device *dvo, int mode)
ok &= ns2501_writeb(dvo, NS2501_REG8, ch);
ok &=
ns2501_writeb(dvo, 0x34,
- (mode ==
- DRM_MODE_DPMS_ON) ? (0x03) : (0x00));
+ enable ? 0x03 : 0x00);
ok &=
ns2501_writeb(dvo, 0x35,
- (mode ==
- DRM_MODE_DPMS_ON) ? (0xff) : (0x00));
+ enable ? 0xff : 0x00);
if (!ok) {
if (restore)
restore_dvo(dvo);