]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drm/radeon: disable audio when we disable hdmi (v2)
authorAlex Deucher <alexander.deucher@amd.com>
Thu, 18 Sep 2014 22:07:08 +0000 (18:07 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 1 Oct 2014 13:00:04 +0000 (09:00 -0400)
This should allow the audio driver to get a better
idea of whether the sink is connected or not.

v2: fix copy/paste typo noticed by David Henningsson

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/evergreen_hdmi.c
drivers/gpu/drm/radeon/r600_hdmi.c

index 8d5497e34b422dad3307c012e995b73dda11b968..2514d659b1ba1783fb4c6474ea6e45d0b3a1b941 100644 (file)
@@ -501,6 +501,8 @@ void evergreen_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode
 
 void evergreen_hdmi_enable(struct drm_encoder *encoder, bool enable)
 {
+       struct drm_device *dev = encoder->dev;
+       struct radeon_device *rdev = dev->dev_private;
        struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
        struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
 
@@ -513,6 +515,14 @@ void evergreen_hdmi_enable(struct drm_encoder *encoder, bool enable)
        if (!enable && !dig->afmt->enabled)
                return;
 
+       if (!enable && dig->afmt->pin) {
+               if (ASIC_IS_DCE6(rdev))
+                       dce6_audio_enable(rdev, dig->afmt->pin, 0);
+               else
+                       dce4_audio_enable(rdev, dig->afmt->pin, 0);
+               dig->afmt->pin = NULL;
+       }
+
        dig->afmt->enabled = enable;
 
        DRM_DEBUG("%sabling HDMI interface @ 0x%04X for encoder 0x%x\n",
index a51068923490848c60d5daff5013b58c9c6753bf..b90dc0eb08e6637623af76e3f76911ced593fba3 100644 (file)
@@ -691,6 +691,11 @@ void r600_hdmi_enable(struct drm_encoder *encoder, bool enable)
        if (!enable && !dig->afmt->enabled)
                return;
 
+       if (!enable && dig->afmt->pin) {
+               r600_audio_enable(rdev, dig->afmt->pin, 0);
+               dig->afmt->pin = NULL;
+       }
+
        /* Older chipsets require setting HDMI and routing manually */
        if (!ASIC_IS_DCE3(rdev)) {
                if (enable)