From patchwork Thu May 17 16:40:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 10407191 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 3BF4A6037D for ; Thu, 17 May 2018 16:47:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2BCDB285FE for ; Thu, 17 May 2018 16:47:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 205FA28641; Thu, 17 May 2018 16:47:20 +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=-2.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=ham 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 39E11285FE for ; Thu, 17 May 2018 16:47:19 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id E497D26765E; Thu, 17 May 2018 18:40:14 +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 00EF326768D; Thu, 17 May 2018 18:40:12 +0200 (CEST) Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id D13332675CD for ; Thu, 17 May 2018 18:40:10 +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=HwcPxl0yHgZ2Cb3pI9ANgy3XQEBHg2wz/eSQqLQqRZs=; b=rSMhZ5Pz8cRn nkMCR3Bxeq7T2XbBAwlVSdGwiMwvu9pjJu+KRnGHbIIwGgyu3S9J2DgPoRtXr91F74n0TpsjjmANv /kOXwHe9TXVLO4bLa8m4uXG2JneIv7OtkFj4hjE5a7pa4I3KGUUBk4aYVAszwOavEj4DqmzMkECv3 WIcto=; Received: from [37.205.61.206] (helo=finisterre.ee.mobilebroadband) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1fJLwo-000124-3a; Thu, 17 May 2018 16:40:10 +0000 Received: by finisterre.ee.mobilebroadband (Postfix, from userid 1000) id 4206444007E; Thu, 17 May 2018 17:40:07 +0100 (BST) From: Mark Brown To: Hans de Goede In-Reply-To: <20180513072435.3358-2-hdegoede@redhat.com> Message-Id: <20180517164007.4206444007E@finisterre.ee.mobilebroadband> Date: Thu, 17 May 2018 17:40:07 +0100 (BST) Cc: Oder Chiou , alsa-devel@alsa-project.org, Takashi Iwai , Pierre-Louis Bossart , Liam Girdwood , Mark Brown , Bard Liao Subject: [alsa-devel] Applied "ASoC: Intel: bytcr_rt5640: Use device properties for setting up dmic" 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 X-Virus-Scanned: ClamAV using ClamSMTP The patch ASoC: Intel: bytcr_rt5640: Use device properties for setting up dmic 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 a3ad29113ddc45a7b8469703b4a3f5e0c1078bcc Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Sun, 13 May 2018 09:24:26 +0200 Subject: [PATCH] ASoC: Intel: bytcr_rt5640: Use device properties for setting up dmic Use device-properties for setting up the dmic, based on the BYT_RT5640_MAP() value, instead of using the codec specific rt5640_dmic_enable() function for this. This also removes the need for the BYT_RT5640_DMIC_EN quirk, which was always set together with a MAP() quirk of DMIC1_MAP or DMIC2_MAP. Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Signed-off-by: Mark Brown --- sound/soc/intel/boards/bytcr_rt5640.c | 42 +++++++++------------------ 1 file changed, 14 insertions(+), 28 deletions(-) diff --git a/sound/soc/intel/boards/bytcr_rt5640.c b/sound/soc/intel/boards/bytcr_rt5640.c index fe46f3b2aecc..cc607cfeda56 100644 --- a/sound/soc/intel/boards/bytcr_rt5640.c +++ b/sound/soc/intel/boards/bytcr_rt5640.c @@ -34,6 +34,7 @@ #include #include #include +#include #include "../../codecs/rt5640.h" #include "../atom/sst-atom-controls.h" #include "../common/sst-dsp.h" @@ -46,7 +47,6 @@ enum { }; #define BYT_RT5640_MAP(quirk) ((quirk) & GENMASK(7, 0)) -#define BYT_RT5640_DMIC_EN BIT(16) #define BYT_RT5640_MONO_SPEAKER BIT(17) #define BYT_RT5640_DIFF_MIC BIT(18) /* defaut is single-ended */ #define BYT_RT5640_SSP2_AIF2 BIT(19) /* default is using AIF1 */ @@ -55,7 +55,7 @@ enum { #define BYT_RT5640_MCLK_EN BIT(22) #define BYT_RT5640_MCLK_25MHZ BIT(23) -/* in-diff + terminating empty entry */ +/* in-diff or dmic-pin + terminating empty entry */ #define MAX_NO_PROPS 2 struct byt_rt5640_private { @@ -71,7 +71,6 @@ MODULE_PARM_DESC(quirk, "Board-specific quirk override"); static void log_quirks(struct device *dev) { int map; - bool has_dmic = false; bool has_mclk = false; bool has_ssp0 = false; bool has_ssp0_aif1 = false; @@ -82,11 +81,9 @@ static void log_quirks(struct device *dev) switch (map) { case BYT_RT5640_DMIC1_MAP: dev_info(dev, "quirk DMIC1_MAP enabled\n"); - has_dmic = true; break; case BYT_RT5640_DMIC2_MAP: dev_info(dev, "quirk DMIC2_MAP enabled\n"); - has_dmic = true; break; case BYT_RT5640_IN1_MAP: dev_info(dev, "quirk IN1_MAP enabled\n"); @@ -98,20 +95,10 @@ static void log_quirks(struct device *dev) dev_err(dev, "quirk map 0x%x is not supported, microphone input will not work\n", map); break; } - if (byt_rt5640_quirk & BYT_RT5640_DMIC_EN) { - if (has_dmic) - dev_info(dev, "quirk DMIC enabled\n"); - else - dev_err(dev, "quirk DMIC enabled but no DMIC input set, will be ignored\n"); - } if (byt_rt5640_quirk & BYT_RT5640_MONO_SPEAKER) dev_info(dev, "quirk MONO_SPEAKER enabled\n"); - if (byt_rt5640_quirk & BYT_RT5640_DIFF_MIC) { - if (!has_dmic) - dev_info(dev, "quirk DIFF_MIC enabled\n"); - else - dev_info(dev, "quirk DIFF_MIC enabled but DMIC input selected, will be ignored\n"); - } + if (byt_rt5640_quirk & BYT_RT5640_DIFF_MIC) + dev_info(dev, "quirk DIFF_MIC enabled\n"); if (byt_rt5640_quirk & BYT_RT5640_SSP0_AIF1) { dev_info(dev, "quirk SSP0_AIF1 enabled\n"); has_ssp0 = true; @@ -387,7 +374,6 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = { DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Venue 8 Pro 5830"), }, .driver_data = (void *)(BYT_RT5640_DMIC2_MAP | - BYT_RT5640_DMIC_EN | BYT_RT5640_MCLK_EN), }, { @@ -405,8 +391,7 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = { DMI_MATCH(DMI_SYS_VENDOR, "Circuitco"), DMI_MATCH(DMI_PRODUCT_NAME, "Minnowboard Max B3 PLATFORM"), }, - .driver_data = (void *)(BYT_RT5640_DMIC1_MAP | - BYT_RT5640_DMIC_EN), + .driver_data = (void *)(BYT_RT5640_DMIC1_MAP), }, { .callback = byt_rt5640_quirk_cb, @@ -457,6 +442,14 @@ static int byt_rt5640_add_codec_device_props(const char *i2c_dev_name) return -EPROBE_DEFER; switch (BYT_RT5640_MAP(byt_rt5640_quirk)) { + case BYT_RT5640_DMIC1_MAP: + props[cnt++] = PROPERTY_ENTRY_U32("realtek,dmic1-data-pin", + RT5640_DMIC1_DATA_PIN_IN1P); + break; + case BYT_RT5640_DMIC2_MAP: + props[cnt++] = PROPERTY_ENTRY_U32("realtek,dmic2-data-pin", + RT5640_DMIC2_DATA_PIN_IN1N); + break; case BYT_RT5640_IN1_MAP: if (byt_rt5640_quirk & BYT_RT5640_DIFF_MIC) props[cnt++] = @@ -556,12 +549,6 @@ static int byt_rt5640_init(struct snd_soc_pcm_runtime *runtime) if (ret) return ret; - if (byt_rt5640_quirk & BYT_RT5640_DMIC_EN) { - ret = rt5640_dmic_enable(component, 0, 0); - if (ret) - return ret; - } - snd_soc_dapm_ignore_suspend(&card->dapm, "Headphone"); snd_soc_dapm_ignore_suspend(&card->dapm, "Speaker"); @@ -862,8 +849,7 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev) byt_rt5640_quirk |= BYT_RT5640_IN1_MAP; byt_rt5640_quirk |= BYT_RT5640_DIFF_MIC; } else { - byt_rt5640_quirk |= (BYT_RT5640_DMIC1_MAP | - BYT_RT5640_DMIC_EN); + byt_rt5640_quirk |= BYT_RT5640_DMIC1_MAP; } /* check quirks before creating card */