radeon/audio: consolidate audio_fini() functions
authorSlava Grigorev <slava.grigorev@amd.com>
Wed, 3 Dec 2014 22:07:01 +0000 (17:07 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 22 Jan 2015 15:42:09 +0000 (10:42 -0500)
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 files changed:
drivers/gpu/drm/radeon/cik.c
drivers/gpu/drm/radeon/dce6_afmt.c
drivers/gpu/drm/radeon/evergreen.c
drivers/gpu/drm/radeon/ni.c
drivers/gpu/drm/radeon/r600.c
drivers/gpu/drm/radeon/r600_hdmi.c
drivers/gpu/drm/radeon/radeon_audio.c
drivers/gpu/drm/radeon/radeon_audio.h
drivers/gpu/drm/radeon/rs600.c
drivers/gpu/drm/radeon/rs690.c
drivers/gpu/drm/radeon/rv770.c
drivers/gpu/drm/radeon/si.c

index efbcd23e9c51ffb775451ff5c39a617f8e5f2d80..de77c27d8106477b4237ba2a6aa444b5cc76c85c 100644 (file)
@@ -8576,7 +8576,7 @@ int cik_suspend(struct radeon_device *rdev)
 {
        radeon_kfd_suspend(rdev);
        radeon_pm_suspend(rdev);
-       dce6_audio_fini(rdev);
+       radeon_audio_fini(rdev);
        radeon_vm_manager_fini(rdev);
        cik_cp_enable(rdev, false);
        cik_sdma_enable(rdev, false);
index 7fd7f157317361628ac128e1594c2394ee7ba247..c4ff60f005d222b95318172e04709ff08924e3e6 100644 (file)
@@ -248,16 +248,3 @@ void dce6_audio_enable(struct radeon_device *rdev,
        WREG32_ENDPOINT(pin->offset, AZ_F0_CODEC_PIN_CONTROL_HOT_PLUG_CONTROL,
                        enable_mask ? AUDIO_ENABLED : 0);
 }
-
-void dce6_audio_fini(struct radeon_device *rdev)
-{
-       int i;
-
-       if (!rdev->audio.enabled)
-               return;
-
-       for (i = 0; i < rdev->audio.num_pins; i++)
-               radeon_audio_enable(rdev, &rdev->audio.pin[i], false);
-
-       rdev->audio.enabled = false;
-}
index 406ea8ee085226fc7f27e86223ff6ff0aebdfc70..78600f534c804b745b99f7aea8688381b4204182 100644 (file)
@@ -5333,7 +5333,7 @@ int evergreen_resume(struct radeon_device *rdev)
 int evergreen_suspend(struct radeon_device *rdev)
 {
        radeon_pm_suspend(rdev);
-       r600_audio_fini(rdev);
+       radeon_audio_fini(rdev);
        uvd_v1_0_fini(rdev);
        radeon_uvd_suspend(rdev);
        r700_cp_stop(rdev);
@@ -5483,7 +5483,7 @@ int evergreen_init(struct radeon_device *rdev)
 void evergreen_fini(struct radeon_device *rdev)
 {
        radeon_pm_fini(rdev);
-       r600_audio_fini(rdev);
+       radeon_audio_fini(rdev);
        r700_cp_fini(rdev);
        r600_dma_fini(rdev);
        r600_irq_fini(rdev);
index d2f10408c560148db4bb6d325a4af46a9e21ce07..24242a7f0ac3d728c4c69366f8af1077ecc25190 100644 (file)
@@ -2135,10 +2135,7 @@ int cayman_resume(struct radeon_device *rdev)
 int cayman_suspend(struct radeon_device *rdev)
 {
        radeon_pm_suspend(rdev);
-       if (ASIC_IS_DCE6(rdev))
-               dce6_audio_fini(rdev);
-       else
-               r600_audio_fini(rdev);
+       radeon_audio_fini(rdev);
        radeon_vm_manager_fini(rdev);
        cayman_cp_enable(rdev, false);
        cayman_dma_stop(rdev);
index de7878aef65c760d5298994a33e7c9a827d1d8d8..07a71a2488c93404f0803e3fbefe4c6204a4b5da 100644 (file)
@@ -3106,7 +3106,7 @@ int r600_resume(struct radeon_device *rdev)
 int r600_suspend(struct radeon_device *rdev)
 {
        radeon_pm_suspend(rdev);
-       r600_audio_fini(rdev);
+       radeon_audio_fini(rdev);
        r600_cp_stop(rdev);
        if (rdev->has_uvd) {
                uvd_v1_0_fini(rdev);
@@ -3225,7 +3225,7 @@ int r600_init(struct radeon_device *rdev)
 void r600_fini(struct radeon_device *rdev)
 {
        radeon_pm_fini(rdev);
-       r600_audio_fini(rdev);
+       radeon_audio_fini(rdev);
        r600_cp_fini(rdev);
        r600_irq_fini(rdev);
        if (rdev->has_uvd) {
index f92eb77cdd607bfbd1ce379ddc409ee69bbb22e4..1c49f4d2945a806fb25cf1bc9b859b853bc9fd45 100644 (file)
@@ -183,19 +183,6 @@ void r600_audio_enable(struct radeon_device *rdev,
        WREG32(AZ_HOT_PLUG_CONTROL, tmp);
 }
 
-/*
- * release the audio timer
- * TODO: How to do this correctly on SMP systems?
- */
-void r600_audio_fini(struct radeon_device *rdev)
-{
-       if (!rdev->audio.enabled)
-               return;
-
-       radeon_audio_enable(rdev, &rdev->audio.pin[0], 0);
-       rdev->audio.enabled = false;
-}
-
 struct r600_audio_pin *r600_audio_get_pin(struct radeon_device *rdev)
 {
        /* only one pin on 6xx-NI */
index eed5c740cefa6473d6629c4f4eb9331aaffba63f..e6c73f8206b218ed5edb59bb3cc039597f9fb657 100644 (file)
@@ -380,3 +380,16 @@ void radeon_audio_enable(struct radeon_device *rdev,
        if (rdev->audio.funcs->enable)
                rdev->audio.funcs->enable(rdev, pin, enable_mask);
 }
+
+void radeon_audio_fini(struct radeon_device *rdev)
+{
+       int i;
+
+       if (!rdev->audio.enabled)
+               return;
+
+       for (i = 0; i < rdev->audio.num_pins; i++)
+               radeon_audio_enable(rdev, &rdev->audio.pin[i], false);
+
+       rdev->audio.enabled = false;
+}
index 2bd845de8d4dec2aa643c791ca50daf1f914cbb0..5844993a1edb26a751a3aa279ef5a5183e44f69e 100644 (file)
@@ -68,5 +68,6 @@ struct r600_audio_pin *radeon_audio_get_pin(struct drm_encoder *encoder);
 void radeon_audio_select_pin(struct drm_encoder *encoder);
 void radeon_audio_enable(struct radeon_device *rdev,
        struct r600_audio_pin *pin, u8 enable_mask);
+void radeon_audio_fini(struct radeon_device *rdev);
 
 #endif
index c26f96093a10487d5cf8aa283ac469ca9b2f6a5a..68f154a451c014321259591dcc2e2462c5d95344 100644 (file)
@@ -1054,7 +1054,7 @@ int rs600_resume(struct radeon_device *rdev)
 int rs600_suspend(struct radeon_device *rdev)
 {
        radeon_pm_suspend(rdev);
-       r600_audio_fini(rdev);
+       radeon_audio_fini(rdev);
        r100_cp_disable(rdev);
        radeon_wb_disable(rdev);
        rs600_irq_disable(rdev);
@@ -1065,7 +1065,7 @@ int rs600_suspend(struct radeon_device *rdev)
 void rs600_fini(struct radeon_device *rdev)
 {
        radeon_pm_fini(rdev);
-       r600_audio_fini(rdev);
+       radeon_audio_fini(rdev);
        r100_cp_fini(rdev);
        radeon_wb_fini(rdev);
        radeon_ib_pool_fini(rdev);
index 0fc5592219336ea769d897f42fec48e742c5bf0f..516ca27cfa12847e904bd9f8ecb8047db53bdba5 100644 (file)
@@ -771,7 +771,7 @@ int rs690_resume(struct radeon_device *rdev)
 int rs690_suspend(struct radeon_device *rdev)
 {
        radeon_pm_suspend(rdev);
-       r600_audio_fini(rdev);
+       radeon_audio_fini(rdev);
        r100_cp_disable(rdev);
        radeon_wb_disable(rdev);
        rs600_irq_disable(rdev);
@@ -782,7 +782,7 @@ int rs690_suspend(struct radeon_device *rdev)
 void rs690_fini(struct radeon_device *rdev)
 {
        radeon_pm_fini(rdev);
-       r600_audio_fini(rdev);
+       radeon_audio_fini(rdev);
        r100_cp_fini(rdev);
        radeon_wb_fini(rdev);
        radeon_ib_pool_fini(rdev);
index 9bdeb4edb722807ed9c6f5c08cfa59343122dd6f..01ee96acb3985ea65ec2470456381251d51f444e 100644 (file)
@@ -1830,7 +1830,7 @@ int rv770_resume(struct radeon_device *rdev)
 int rv770_suspend(struct radeon_device *rdev)
 {
        radeon_pm_suspend(rdev);
-       r600_audio_fini(rdev);
+       radeon_audio_fini(rdev);
        uvd_v1_0_fini(rdev);
        radeon_uvd_suspend(rdev);
        r700_cp_stop(rdev);
index 86cdc6798240303f738525d39edc933d3fe4f64a..73107fe9e46f7de25d1d22b3ad3ba0b28f40c8f0 100644 (file)
@@ -6909,7 +6909,7 @@ int si_resume(struct radeon_device *rdev)
 int si_suspend(struct radeon_device *rdev)
 {
        radeon_pm_suspend(rdev);
-       dce6_audio_fini(rdev);
+       radeon_audio_fini(rdev);
        radeon_vm_manager_fini(rdev);
        si_cp_enable(rdev, false);
        cayman_dma_stop(rdev);