summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Brace <kevinbrace@gmx.com>2017-04-04 18:51:01 -0700
committerKevin Brace <kevinbrace@gmx.com>2017-04-04 18:51:01 -0700
commit1bd4f131566a7b47d8b68d04e9fe1c2953f2242b (patch)
tree64d5276a7f9bdb86dea697e4488c6728e3a1170d
parent72d0e69e62adee0798f5379b1e6bc4642f1139bd (diff)
Rename via_dac_dpms as via_analog_dpms
Also, update the code so that DAC can be turned on / off correctly. Signed-off-by: Kevin Brace <kevinbrace@gmx.com>
-rw-r--r--drivers/gpu/drm/via/via_analog.c45
1 files changed, 24 insertions, 21 deletions
diff --git a/drivers/gpu/drm/via/via_analog.c b/drivers/gpu/drm/via/via_analog.c
index 1263201f977b..47ae89766fa7 100644
--- a/drivers/gpu/drm/via/via_analog.c
+++ b/drivers/gpu/drm/via/via_analog.c
@@ -49,28 +49,31 @@ static const struct drm_encoder_funcs via_dac_enc_funcs = {
.destroy = via_encoder_cleanup,
};
-/* Manage the power state of the DAC */
+/*
+ * Manage the power state of analog (VGA) DAC.
+ */
static void
-via_dac_dpms(struct drm_encoder *encoder, int mode)
+via_analog_dpms(struct drm_encoder *encoder, int mode)
{
- struct via_device *dev_priv = encoder->dev->dev_private;
- u8 mask = 0;
-
- switch (mode) {
- case DRM_MODE_DPMS_SUSPEND:
- mask = BIT(5); /* VSync off */
- break;
- case DRM_MODE_DPMS_STANDBY:
- mask = BIT(4); /* HSync off */
- break;
- case DRM_MODE_DPMS_OFF:
- mask = (BIT(5) | BIT(4));/* HSync and VSync off */
- break;
- case DRM_MODE_DPMS_ON:
- default:
- break;
- }
- svga_wcrt_mask(VGABASE, 0x36, mask, BIT(5) | BIT(4));
+ struct via_device *dev_priv = encoder->dev->dev_private;
+
+ DRM_DEBUG("Entered via_analog_dpms.\n");
+
+ switch (mode) {
+ case DRM_MODE_DPMS_ON:
+ viaAnalogOutput(dev_priv, true);
+ break;
+ case DRM_MODE_DPMS_SUSPEND:
+ case DRM_MODE_DPMS_STANDBY:
+ case DRM_MODE_DPMS_OFF:
+ viaAnalogOutput(dev_priv, false);
+ break;
+ default:
+ DRM_ERROR("Bad DPMS mode.");
+ break;
+ }
+
+ DRM_DEBUG("Exiting via_analog_dpms.\n");
}
/* Pass our mode to the connectors and the CRTC to give them a chance to
@@ -87,7 +90,7 @@ via_dac_mode_fixup(struct drm_encoder *encoder,
}
static const struct drm_encoder_helper_funcs via_dac_enc_helper_funcs = {
- .dpms = via_dac_dpms,
+ .dpms = via_analog_dpms,
.mode_fixup = via_dac_mode_fixup,
.mode_set = via_set_sync_polarity,
.prepare = via_encoder_prepare,