From patchwork Fri Jun 1 11:05:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 137505 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp785552lji; Fri, 1 Jun 2018 04:06:04 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJcXwnf1/JeQFVFho4u6QU5l0Syvnmmuu2Jt3DlYioojnhrlN1ZrMGZ8z/woNQrvgQ5qOBV X-Received: by 2002:adf:eb52:: with SMTP id u18-v6mr8052958wrn.252.1527851164463; Fri, 01 Jun 2018 04:06:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527851164; cv=none; d=google.com; s=arc-20160816; b=Uv3SgDGRUiFopiLAkWfApcmd4X+TD0se9MNQZz0gk0Zgulj5ofjCL51AdKEvB8Migl h0815oyuzEQHFC9CAoXKQDqafHOOLI5XAn1lRaKrM5fMS2ieG4hnCaygOS2E7NKn65yH UifQvre4Bu7qdhHbEl5UKZFF4XDcrLGc629TjlAWzxRd2Nh2CzNbh7QnSTOLn1s/CwWZ f9fUOxSddVA7YV4e8DbOqaldUGIINuY0u0yDRZiytgJimeVPNIXVAVQH4IGxdc11YJ41 LQybbtiTcB8FLgLVnXzHS9q3lK+Vf8+KUQERJdW6FZlKZJDJvdmRGuPpN2oYudaaK0Oi Vd7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=UMqRKLE9wLzgqMVb4VmMT5DUJTPqMGUD3BAcObyOEVs=; b=IBnjHVIw5c58ZNBCXK2ONagPkFdwmYmyeZ5ROu9vjNmpVGkI0GyVvzVsR8IH7aFIiM T9Icg7j0lC1Tjptj5dJ0LvJby2J3RqjImebI4tymblmefd/G+8JioKDAjT+YOimdk6Zj t4Dp5005yZXU22gROLZzKWDwce8wC2+kvF7VM9lRE12jdKDbIkpWFZusi4cEm4fEM1LH ikxr1xqWjqqBt3hm62dxxY0Y63SLgGpDFIVcTvUBH9+NN6HuxDXJCxLK9KKRlgGkZ2+K ELDJKUh9Kg6y3MbsKZYtzXR5l2DU9OxgBx5g0ZXJ7HPFNhYoo82gcWb62bvjBi08v9KX Dk/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=MXKJ81VN; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id t19-v6si27391482wrg.75.2018.06.01.04.06.04; Fri, 01 Jun 2018 04:06:04 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=MXKJ81VN; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 8AB7C2676EB; Fri, 1 Jun 2018 13:06:02 +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 5F5EE2676EB; Fri, 1 Jun 2018 13:06:00 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id C4BE42676E7 for ; Fri, 1 Jun 2018 13:05:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=pWwZh4HIvfd88NjlROfcJaNQviKCAmHFJeJ1da/8Vuk=; b=MXKJ81VNPBK0 LGpDSNwU7Ex4FDfe0O5N4uStTlGqwLubCwBXwzjOg80Jru6HJuvqVlZbRDUBkM0aZ/JnEECS1bJUb rW8qHDy7G+Ztf4UzepZxVRDyxbA1y5ftY0bzRlkVR1sjlvkzHQHq7lAPeTkqJsXTeVE/ld6l93NnI 4YCtI=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1fOhsV-0001DW-Or; Fri, 01 Jun 2018 11:05:51 +0000 Received: from broonie by debutante with local (Exim 4.91) (envelope-from ) id 1fOhsV-0000Sd-BQ; Fri, 01 Jun 2018 12:05:51 +0100 From: Mark Brown To: Mac Chiang In-Reply-To: <1527234447-1384-1-git-send-email-mac.chiang@intel.com> Message-Id: Date: Fri, 01 Jun 2018 12:05:51 +0100 Cc: alsa-devel@alsa-project.org, Mark Brown , Pierre-Louis Bossart Subject: [alsa-devel] Applied "ASoC: Intel: kbl: Move codec sysclk config to codec_init function" to the asoc tree 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org The patch ASoC: Intel: kbl: Move codec sysclk config to codec_init function has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From 56c3a95385df558a471f7fcedba73c9ed836a906 Mon Sep 17 00:00:00 2001 From: Mac Chiang Date: Fri, 1 Jun 2018 01:18:32 +0800 Subject: [PATCH] ASoC: Intel: kbl: Move codec sysclk config to codec_init function On APL, commit fd0f237572ad ("ASoC: Intel: bxt: Move codec sysclk config to codec_init function") fixed an issue related to jack detection. 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. The same fix is needed on KBL. 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: Mac Chiang Acked-by: Pierre-Louis Bossart Signed-off-by: Mark Brown --- sound/soc/intel/boards/kbl_da7219_max98357a.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) -- 2.17.0 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/intel/boards/kbl_da7219_max98357a.c b/sound/soc/intel/boards/kbl_da7219_max98357a.c index 60e739f3d6f3..94294c27d1db 100644 --- a/sound/soc/intel/boards/kbl_da7219_max98357a.c +++ b/sound/soc/intel/boards/kbl_da7219_max98357a.c @@ -65,14 +65,6 @@ static int platform_clock_control(struct snd_soc_dapm_widget *w, return -EIO; } - /* Configure sysclk for codec */ - ret = snd_soc_dai_set_sysclk(codec_dai, DA7219_CLKSRC_MCLK, 24576000, - SND_SOC_CLOCK_IN); - if (ret) { - dev_err(card->dev, "can't set codec sysclk configuration\n"); - return ret; - } - if (SND_SOC_DAPM_EVENT_OFF(event)) { ret = snd_soc_dai_set_pll(codec_dai, 0, DA7219_SYSCLK_MCLK, 0, 0); @@ -169,9 +161,18 @@ static int kabylake_da7219_codec_init(struct snd_soc_pcm_runtime *rtd) { struct kbl_codec_private *ctx = snd_soc_card_get_drvdata(rtd->card); struct snd_soc_component *component = rtd->codec_dai->component; + struct snd_soc_dai *codec_dai = rtd->codec_dai; struct snd_soc_jack *jack; int ret; + /* Configure sysclk for codec */ + ret = snd_soc_dai_set_sysclk(codec_dai, DA7219_CLKSRC_MCLK, 24576000, + 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.