From patchwork Thu Feb 11 21:58:52 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 78844 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1C7NkYB021042 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 12 Feb 2010 07:24:27 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1Nfh3Z-0004fu-Ma; Thu, 11 Feb 2010 21:58:41 +0000 Received: from sfi-mx-1.v28.ch3.sourceforge.com ([172.29.28.121] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1Nfh3Y-0004fi-3E for dri-devel@lists.sourceforge.net; Thu, 11 Feb 2010 21:58:40 +0000 Received-SPF: pass (sfi-mx-1.v28.ch3.sourceforge.com: domain of gmail.com designates 209.85.219.215 as permitted sender) client-ip=209.85.219.215; envelope-from=zajec5@gmail.com; helo=mail-ew0-f215.google.com; Received: from mail-ew0-f215.google.com ([209.85.219.215]) by sfi-mx-1.v28.ch3.sourceforge.com with esmtp (Exim 4.69) id 1Nfh3V-0003Dj-N1 for dri-devel@lists.sourceforge.net; Thu, 11 Feb 2010 21:58:40 +0000 Received: by ewy7 with SMTP id 7so1608003ewy.6 for ; Thu, 11 Feb 2010 13:58:30 -0800 (PST) Received: by 10.213.96.68 with SMTP id g4mr1117241ebn.77.1265925510717; Thu, 11 Feb 2010 13:58:30 -0800 (PST) Received: from localhost.localdomain (c3-107.icpnet.pl [62.21.3.107]) by mx.google.com with ESMTPS id 7sm6703002eyg.33.2010.02.11.13.58.29 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 11 Feb 2010 13:58:29 -0800 (PST) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: dri-devel@lists.sourceforge.net, Dave Airlie Subject: [PATCH] drm/radeon/kms: isolate audio engine management, change fini order Date: Thu, 11 Feb 2010 22:58:52 +0100 Message-Id: <1265925532-4307-2-git-send-email-zajec5@gmail.com> X-Mailer: git-send-email 1.6.4.2 MIME-Version: 1.0 X-Spam-Score: -0.7 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record -0.0 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.0 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.8 AWL AWL: From: address is in the auto white-list X-Headers-End: 1Nfh3V-0003Dj-N1 X-BeenThere: dri-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 12 Feb 2010 07:24:27 +0000 (UTC) diff --git a/drivers/gpu/drm/radeon/r600_audio.c b/drivers/gpu/drm/radeon/r600_audio.c index b1c1d34..d7f6909 100644 --- a/drivers/gpu/drm/radeon/r600_audio.c +++ b/drivers/gpu/drm/radeon/r600_audio.c @@ -147,6 +147,15 @@ static void r600_audio_update_hdmi(unsigned long param) } /* + * 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 */ int r600_audio_init(struct radeon_device *rdev) @@ -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); }