diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2012-03-10 10:20:54 -0500 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2012-03-13 03:15:04 -0400 |
commit | f14d9a4dda65439d74326694db727c6d2a5df0ce (patch) | |
tree | 4a723aad34dd3917ad38536f962f261fb07cc5e1 /drivers/gpu/drm/nouveau/nouveau_dp.c | |
parent | e436d1bb0a3e5ff27b190d0bf9173f4f6ad21d3f (diff) |
drm/nouveau/dp: make dp dpms function common, call from sor code instead
GF119 will use this too.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_dp.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_dp.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_dp.c b/drivers/gpu/drm/nouveau/nouveau_dp.c index f38f561a0058..7be4e06e8438 100644 --- a/drivers/gpu/drm/nouveau/nouveau_dp.c +++ b/drivers/gpu/drm/nouveau/nouveau_dp.c | |||
@@ -475,6 +475,29 @@ nouveau_dp_link_train(struct drm_encoder *encoder, u32 datarate, | |||
475 | return true; | 475 | return true; |
476 | } | 476 | } |
477 | 477 | ||
478 | void | ||
479 | nouveau_dp_dpms(struct drm_encoder *encoder, int mode, u32 datarate, | ||
480 | struct dp_train_func *func) | ||
481 | { | ||
482 | struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); | ||
483 | struct nouveau_i2c_chan *auxch; | ||
484 | u8 status; | ||
485 | |||
486 | auxch = nouveau_i2c_find(encoder->dev, nv_encoder->dcb->i2c_index); | ||
487 | if (!auxch) | ||
488 | return; | ||
489 | |||
490 | if (mode == DRM_MODE_DPMS_ON) | ||
491 | status = DP_SET_POWER_D0; | ||
492 | else | ||
493 | status = DP_SET_POWER_D3; | ||
494 | |||
495 | nouveau_dp_auxch(auxch, 8, DP_SET_POWER, &status, 1); | ||
496 | |||
497 | if (mode == DRM_MODE_DPMS_ON) | ||
498 | nouveau_dp_link_train(encoder, datarate, func); | ||
499 | } | ||
500 | |||
478 | bool | 501 | bool |
479 | nouveau_dp_detect(struct drm_encoder *encoder) | 502 | nouveau_dp_detect(struct drm_encoder *encoder) |
480 | { | 503 | { |