From patchwork Mon Jun 19 09:56:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Thomson X-Patchwork-Id: 9795635 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 E003360381 for ; Mon, 19 Jun 2017 09:57:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A80E1FF2D for ; Mon, 19 Jun 2017 09:57:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F353924B5B; Mon, 19 Jun 2017 09:57:26 +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=1.4 required=2.0 tests=BAYES_00,FROM_WORDY, RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 47CEE1FF2D for ; Mon, 19 Jun 2017 09:57:26 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 327F2267059; Mon, 19 Jun 2017 11:56:53 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id A300F267029; Mon, 19 Jun 2017 11:56:51 +0200 (CEST) Received: from mail1.bemta5.messagelabs.com (mail1.bemta5.messagelabs.com [195.245.231.138]) by alsa0.perex.cz (Postfix) with ESMTP id 22977267049 for ; Mon, 19 Jun 2017 11:56:46 +0200 (CEST) Received: from [85.158.139.51] by server-2.bemta-5.messagelabs.com id 44/1F-02006-CDF97495; Mon, 19 Jun 2017 09:56:44 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrKIsWRWlGSWpSXmKPExsUSt3Opse7l+e6 RBk/XalpcuXiIyWLqwydsFrdvdzFbfLvSwWRxedccNovOXf2sFqvfLGCx2PB9LaMDh8eGz01s Hjtn3WX3WLznJZPHplWdbB773i5j81i/5SqLx+dNcgHsUayZeUn5FQmsGf/39bAVvBCouPJrE UsD4zy+LkYuDiGB9YwSy7d+Y+ti5ARyKiRWNMwDs3kFMiVOHfjPCGJzCrhLLL6yiRmixk3i85 fFrCA2m4CFxOQTD8DqWQRUJY49/gtmCwuES/zctJARZIGIwDFGiZYj/9hAHGaBBUDbTk1lgtg gKHFy5hMWEJtZQELi4IsXUBsMJE4vaASLSwjYS0x/fxUozgFk60s0HouFCBtKfJ/1jQUibC7x 46nQBEbBWUiGzkIydAEj0ypG9eLUorLUIl0zvaSizPSMktzEzBxdQwNTvdzU4uLE9NScxKRiv eT83E2MwOhgAIIdjFMbnA8xSnIwKYnyFk5xjxTiS8pPqcxILM6ILyrNSS0+xCjDwaEkwftmHl BOsCg1PbUiLTMHGKcwaQkOHiUR3rw+oDRvcUFibnFmOkTqFKOilDjvDZA+AZBERmkeXBssNVx ilJUS5mUEOkSIpyC1KDezBFX+FaM4B6OSMK/TXKApPJl5JXDTXwEtZgJazHzGBWRxSSJCSqqB MeieRPWxf1xPGT7azV79+ajKjjPRDKXCKzo0DbYKPqpye+ckaC27d/Pb/gqnrIxjX9h5G9VzG hxuNScu5tivmhN1S/OqC2dT0jFmYX+hmXb62u1Kt85nuf5oaNdNKrj8TWjSnyd8VbaG0791LG fouWQb2zdrytr515qFyg24777oysti+LBEiaU4I9FQi7moOBEADrNJhwgDAAA= X-Env-Sender: Adam.Thomson.Opensource@diasemi.com X-Msg-Ref: server-16.tower-180.messagelabs.com!1497866195!89495911!1 X-Originating-IP: [94.185.165.51] X-StarScan-Received: X-StarScan-Version: 9.4.19; banners=-,-,- X-VirusChecked: Checked Received: (qmail 6825 invoked from network); 19 Jun 2017 09:56:35 -0000 Received: from mailrelay2.diasemi.com (HELO sw-ex-cashub01.diasemi.com) (94.185.165.51) by server-16.tower-180.messagelabs.com with AES128-SHA encrypted SMTP; 19 Jun 2017 09:56:35 -0000 Received: from swsrvapps-01.diasemi.com (10.20.28.141) by SW-EX-CASHUB01.diasemi.com (10.20.16.140) with Microsoft SMTP Server id 14.3.248.2; Mon, 19 Jun 2017 10:56:34 +0100 Received: by swsrvapps-01.diasemi.com (Postfix, from userid 22379) id 8336B3FB4D; Mon, 19 Jun 2017 10:56:34 +0100 (BST) Message-ID: In-Reply-To: References: From: Adam Thomson Date: Mon, 19 Jun 2017 10:56:34 +0100 To: Mark Brown , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Sathyanarayana Nujella MIME-Version: 1.0 X-KSE-AttachmentFiltering-Interceptor-Info: protection disabled X-KSE-ServerInfo: sw-ex-cashub01.diasemi.com, 9 X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: Clean, bases: 19/06/2017 07:05:00 Cc: Harsha Priya , alsa-devel@alsa-project.org, Support Opensource , linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH 2/2] ASoC: Intel: bxt: Move codec sysclk config to codec_init function X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP The MCLK for DA7219 does not change in this platform, but is currently being configured everytime as part of the platform_clock event handler for DAPM. The upshot of this is that we have unnecessary calls to this function, and it also means that if a stream hasn't yet been started, DA7219 driver does not have the correct MCLK rates programmed and so the HP detection feature does not operate as expected. This patch rectifies this issue by moving the sysclk call to codec_init function so it's only called once at initialisation. Signed-off-by: Adam Thomson Acked-by: Sathyanarayana Nujella --- sound/soc/intel/boards/bxt_da7219_max98357a.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/sound/soc/intel/boards/bxt_da7219_max98357a.c b/sound/soc/intel/boards/bxt_da7219_max98357a.c index 3a8c4d9..1866e31 100644 --- a/sound/soc/intel/boards/bxt_da7219_max98357a.c +++ b/sound/soc/intel/boards/bxt_da7219_max98357a.c @@ -89,11 +89,6 @@ static int platform_clock_control(struct snd_soc_dapm_widget *w, if (ret) dev_err(card->dev, "failed to stop PLL: %d\n", ret); } else if(SND_SOC_DAPM_EVENT_ON(event)) { - ret = snd_soc_dai_set_sysclk(codec_dai, - DA7219_CLKSRC_MCLK, 19200000, SND_SOC_CLOCK_IN); - if (ret) - dev_err(card->dev, "can't set codec sysclk configuration\n"); - ret = snd_soc_dai_set_pll(codec_dai, 0, DA7219_SYSCLK_PLL_SRM, 0, DA7219_PLL_FREQ_OUT_98304); if (ret) @@ -187,8 +182,17 @@ static int broxton_ssp_fixup(struct snd_soc_pcm_runtime *rtd, static int broxton_da7219_codec_init(struct snd_soc_pcm_runtime *rtd) { int ret; + struct snd_soc_dai *codec_dai = rtd->codec_dai; struct snd_soc_codec *codec = rtd->codec; + /* Configure sysclk for codec */ + ret = snd_soc_dai_set_sysclk(codec_dai, DA7219_CLKSRC_MCLK, 19200000, + SND_SOC_CLOCK_IN); + if (ret) { + dev_err(rtd->dev, "can't set codec sysclk configuration\n"); + return ret; + } + /* * Headset buttons map to the google Reference headset. * These can be configured by userspace.