From: Rafał Miłecki Date: Thu, 11 Feb 2010 21:58:52 +0000 (+0100) Subject: drm/radeon/kms: isolate audio engine management, change fini order X-Git-Tag: MMI-PSA29.97-13-9~23984^2~100^2~25 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5230aea62c0d8f53edcc3e014c3404132afcfeb4;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git drm/radeon/kms: isolate audio engine management, change fini order We should stop audio-state-reading timer before we turn off engine Signed-off-by: Rafał Miłecki Signed-off-by: Dave Airlie --- diff --git a/drivers/gpu/drm/radeon/r600_audio.c b/drivers/gpu/drm/radeon/r600_audio.c index b1c1d3433454..d7f6909afc01 100644 --- a/drivers/gpu/drm/radeon/r600_audio.c +++ b/drivers/gpu/drm/radeon/r600_audio.c @@ -146,6 +146,15 @@ static void r600_audio_update_hdmi(unsigned long param) jiffies + msecs_to_jiffies(AUDIO_TIMER_INTERVALL)); } +/* + * turn on/off audio engine + */ +static void r600_audio_engine_enable(struct radeon_device *rdev, bool enable) +{ + DRM_INFO("%s audio support", enable ? "Enabling" : "Disabling"); + WREG32_P(R600_AUDIO_ENABLE, enable ? 0x81000000 : 0x0, ~0x81000000); +} + /* * initialize the audio vars and register the update timer */ @@ -154,8 +163,7 @@ int r600_audio_init(struct radeon_device *rdev) if (!r600_audio_chipset_supported(rdev)) return 0; - DRM_INFO("%s audio support", radeon_audio ? "Enabling" : "Disabling"); - WREG32_P(R600_AUDIO_ENABLE, radeon_audio ? 0x81000000 : 0x0, ~0x81000000); + r600_audio_engine_enable(rdev, radeon_audio); rdev->audio_channels = -1; rdev->audio_rate = -1; @@ -261,7 +269,7 @@ void r600_audio_fini(struct radeon_device *rdev) if (!r600_audio_chipset_supported(rdev)) return; - WREG32_P(R600_AUDIO_ENABLE, 0x0, ~0x81000000); - del_timer(&rdev->audio_timer); + + r600_audio_engine_enable(rdev, false); }