From patchwork Thu Aug 11 06:41:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dhinakaran Pandiyan X-Patchwork-Id: 9274515 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B1E116022E for ; Thu, 11 Aug 2016 06:28:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A06C3284F7 for ; Thu, 11 Aug 2016 06:28:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C8E6284F5; Thu, 11 Aug 2016 06:28:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 520BB284F5 for ; Thu, 11 Aug 2016 06:28:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E0BFA6E8BD; Thu, 11 Aug 2016 06:28:00 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTP id F17B46E0D1 for ; Thu, 11 Aug 2016 06:27:57 +0000 (UTC) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP; 10 Aug 2016 23:27:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,503,1464678000"; d="scan'208";a="747197703" Received: from skynet.jf.intel.com ([10.54.75.148]) by FMSMGA003.fm.intel.com with ESMTP; 10 Aug 2016 23:27:59 -0700 From: Dhinakaran Pandiyan To: intel-gfx@lists.freedesktop.org Date: Wed, 10 Aug 2016 23:41:12 -0700 Message-Id: <1470897673-29292-2-git-send-email-dhinakaran.pandiyan@intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1470897673-29292-1-git-send-email-dhinakaran.pandiyan@intel.com> References: <20160809220857.GA29783@nuc-i3427.alporthouse.com> <1470897673-29292-1-git-send-email-dhinakaran.pandiyan@intel.com> Cc: Dhinakaran Pandiyan Subject: [Intel-gfx] [PATCH 2/3] drm/dp/i915: Clean up clock configuration for HDMI audio X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP No functional change, just clean up. Debug messages now print out clock units. Additionally, the configuration bits, which are 1:1 mapped to the clock frequency and don't convey much information are not printed out. Signed-off-by: Dhinakaran Pandiyan Reviewed-by: Chris Wilson --- drivers/gpu/drm/i915/intel_audio.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c index 3efce0e..9465f54 100644 --- a/drivers/gpu/drm/i915/intel_audio.c +++ b/drivers/gpu/drm/i915/intel_audio.c @@ -104,21 +104,17 @@ static u32 audio_config_hdmi_pixel_clock(const struct drm_display_mode *adjusted int i; for (i = 0; i < ARRAY_SIZE(hdmi_audio_clock); i++) { - if (adjusted_mode->crtc_clock == hdmi_audio_clock[i].clock) - break; - } - - if (i == ARRAY_SIZE(hdmi_audio_clock)) { - DRM_DEBUG_KMS("HDMI audio pixel clock setting for %d not found, falling back to defaults\n", - adjusted_mode->crtc_clock); - i = 1; + if (adjusted_mode->crtc_clock == hdmi_audio_clock[i].clock) { + DRM_DEBUG_KMS("Configuring audio for HDMI pixel clk %dkHz\n", + hdmi_audio_clock[i].clock); + return hdmi_audio_clock[i].config; + } } - DRM_DEBUG_KMS("Configuring HDMI audio for pixel clock %d (0x%08x)\n", - hdmi_audio_clock[i].clock, - hdmi_audio_clock[i].config); + DRM_DEBUG_KMS("No config. for HDMI pixel clk %dkHz, using default %dkHz\n", + adjusted_mode->crtc_clock, hdmi_audio_clock[1].clock); - return hdmi_audio_clock[i].config; + return hdmi_audio_clock[1].config; } static int audio_config_get_n(const struct drm_display_mode *mode, int rate)