Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp36423768rwd; Tue, 11 Jul 2023 00:21:32 -0700 (PDT) X-Google-Smtp-Source: APBJJlFgCvUxBa9IxbN+MannwyAXMyWERiI3pDLJ6h6EpCTWWft7Qwk6I2OeUJMUG8jfd4Xr9Ktr X-Received: by 2002:a05:6402:3548:b0:506:c24e:667d with SMTP id f8-20020a056402354800b00506c24e667dmr14329838edd.4.1689060092164; Tue, 11 Jul 2023 00:21:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689060092; cv=none; d=google.com; s=arc-20160816; b=f5F1rKZpSv+NkTCtVlsptp0zk6+E56Kq9XyXJslFWv46iQO7lz+/pUnFgji37HUe0X SeVMr8DNRMBXzeqB9/LoDzLler+Uu0RtpQnSFzMTUfxvLY647WW9RVdwd4WDzK+eNCkI gGeHEr5RG+uwwLyY3xpanQ53lGmjAcSLjWuF2slmWtc/L01XiJRu9qv+EPgDzj26O4TD mVgjvbZG2MeWV9a0daNib9Jp2dO2rUTKV8shUcNqUPPOzdJrPlyOS5NKFKjYopCBZb9u uJUGLsUYexQq63YsNYJFLXsgZDc1CemxxB6+eIS3Mkvpak2OuqkbPCxNjNnqlboqP9tI pSxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=q0ilNe1fDWhzdSYSwyNzIc5jpbalvqmdxglwRuVqxqI=; fh=0x/Yltn1Ecws02WmW9zI/hZKPW1n580VyL6X52RL5w8=; b=qmRqKAmHx98BmYk9wzhs5FCkyirhZrB/dMLY49DKf7xXubzcUiFbPfoK+1hGuS13Nz lLO8YUQFFJ1N+PO8qnl7MyZ83+ayv+R2A5ebER9DszFpuvb5TvNtellk6fVYpiWa2rWC DjFlvFeO/9AZsWXFUHJcjRgbcZBl3PdHp592N615NAx8tXM4tDNIJ4ihO1UkKfvohLMs YSl1+XHbba4JQv0jrjwJJue2dVoupOEVvkJYr8FqqMtjJ/gH7STQUd/MjxHa83bvmkCG MY9ik35cagtn4pcP30rngpLDGMUxztsNBl6+J0dzkHzWKxAjWomZCNPES1sSEG0ilD5A jXCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=APKt1m5q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p24-20020aa7d318000000b0051be99fde7bsi1390962edq.664.2023.07.11.00.21.08; Tue, 11 Jul 2023 00:21:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=APKt1m5q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230187AbjGKGg5 (ORCPT + 99 others); Tue, 11 Jul 2023 02:36:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229514AbjGKGgx (ORCPT ); Tue, 11 Jul 2023 02:36:53 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32E2293 for ; Mon, 10 Jul 2023 23:36:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689057412; x=1720593412; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=4+1OPTUKS90sS9jGvC6Wn9idI+xTKRc38R1oLorStVs=; b=APKt1m5q1dvPsiXTKy/9UflSlq1jYzYNp6DU1UyfjL5630OE4NW3ioXG uNb6nW5CDWoV6pg23Z2kzoDWRUzMaKpTR/ZiucOOyTKNuBmtZ/HtceC4y Ge1Xb57YQ/I+k4LmXTGBuz0V7wv5tiXEL9hkvFwLsaBbAeqhKtcnZJbb7 RV/0ThFJpTQ23+bKRgIJMxbgl3pdcf1mc0nMsTvZ/RUgDBixXCBqp9gIK 1GSAHZa/Dx2AFyl5SYnNFPG4QNL/eufENUJxXb8S7B/dJUeDeoEqGQBts WXwRzkRrcj3QB0AJIUP8/mvdp1NNU1oBSBVPjOK50vgWEdCn63FzseEdT A==; X-IronPort-AV: E=McAfee;i="6600,9927,10767"; a="362001206" X-IronPort-AV: E=Sophos;i="6.01,196,1684825200"; d="scan'208";a="362001206" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jul 2023 23:36:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10767"; a="698328881" X-IronPort-AV: E=Sophos;i="6.01,196,1684825200"; d="scan'208";a="698328881" Received: from baparham-mobl.ger.corp.intel.com (HELO [10.252.44.75]) ([10.252.44.75]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jul 2023 23:36:45 -0700 Message-ID: Date: Mon, 10 Jul 2023 09:35:57 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.11.0 Subject: Re: [PATCH v2] ASoC: Intel: sof_rt5682: add jsl_rt5650 board config Content-Language: en-US To: Brent Lu , alsa-devel@alsa-project.org Cc: Cezary Rojewski , Liam Girdwood , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Mark Brown , Jaroslav Kysela , Takashi Iwai , Yong Zhi , Uday M Bhat , Gongjun Song , Ajye Huang , Arnd Bergmann , Terry Cheong , "Dharageswari . R" , Mac Chiang , Kuninori Morimoto , linux-kernel@vger.kernel.org References: <20230710141610.227988-1-brent.lu@intel.com> From: Pierre-Louis Bossart In-Reply-To: <20230710141610.227988-1-brent.lu@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DATE_IN_PAST_12_24, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/10/23 16:16, Brent Lu wrote: > This configuration supports JSL boards which implement ALC5650 dual > I2S interface codec. Two DAI links are added: AIF1 (on codec side) for > headphone and AIF2 for speakers. > > Signed-off-by: Brent Lu > --- > sound/soc/intel/boards/Kconfig | 5 +- > sound/soc/intel/boards/sof_rt5682.c | 81 ++++++++++++++++++- > .../intel/common/soc-acpi-intel-jsl-match.c | 12 +++ > 3 files changed, 93 insertions(+), 5 deletions(-) > > diff --git a/sound/soc/intel/boards/Kconfig b/sound/soc/intel/boards/Kconfig > index f472f603ab75..1fe830af2b84 100644 > --- a/sound/soc/intel/boards/Kconfig > +++ b/sound/soc/intel/boards/Kconfig > @@ -475,7 +475,7 @@ endif ## SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC || SND_SOC_SOF_HDA_AUDIO_CODEC > > if SND_SOC_SOF_HDA_LINK || SND_SOC_SOF_BAYTRAIL > config SND_SOC_INTEL_SOF_RT5682_MACH > - tristate "SOF with rt5682 codec in I2S Mode" > + tristate "SOF with rt5650/rt5682 codec in I2S Mode" > depends on I2C && ACPI > depends on ((SND_HDA_CODEC_HDMI && SND_SOC_SOF_HDA_AUDIO_CODEC) &&\ > (MFD_INTEL_LPSS || COMPILE_TEST)) ||\ > @@ -485,6 +485,7 @@ config SND_SOC_INTEL_SOF_RT5682_MACH > select SND_SOC_RT1011 > select SND_SOC_RT1015 > select SND_SOC_RT1015P > + select SND_SOC_RT5645 > select SND_SOC_RT5682_I2C > select SND_SOC_RT5682S > select SND_SOC_DMIC > @@ -494,7 +495,7 @@ config SND_SOC_INTEL_SOF_RT5682_MACH > select SND_SOC_INTEL_SOF_REALTEK_COMMON > help > This adds support for ASoC machine driver for SOF platforms > - with rt5682 codec. > + with rt5650 or rt5682 codec. > Say Y if you have such a device. > If unsure select "N". > > diff --git a/sound/soc/intel/boards/sof_rt5682.c b/sound/soc/intel/boards/sof_rt5682.c > index 7c034d671cf3..53451c1b67f8 100644 > --- a/sound/soc/intel/boards/sof_rt5682.c > +++ b/sound/soc/intel/boards/sof_rt5682.c > @@ -22,6 +22,7 @@ > #include > #include "../../codecs/rt5682.h" > #include "../../codecs/rt5682s.h" > +#include "../../codecs/rt5645.h" > #include "../../codecs/hdac_hdmi.h" > #include "../common/soc-intel-quirks.h" > #include "hda_dsp_common.h" > @@ -60,6 +61,7 @@ > #define SOF_MAX98390_SPEAKER_AMP_PRESENT BIT(24) > #define SOF_MAX98390_TWEETER_SPEAKER_PRESENT BIT(25) > #define SOF_RT1019_SPEAKER_AMP_PRESENT BIT(26) > +#define SOF_RT5650_HEADPHONE_CODEC_PRESENT BIT(27) > > > /* Default: MCLK on, MCLK 19.2M, SSP0 */ > @@ -305,7 +307,7 @@ static int sof_rt5682_codec_init(struct snd_soc_pcm_runtime *rtd) > struct sof_card_private *ctx = snd_soc_card_get_drvdata(rtd->card); > struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component; > struct snd_soc_jack *jack; > - int ret; > + int ret, extra; two lines, and rename to e.g. extra_jack_data > + if (sof_rt5682_quirk & SOF_RT5650_HEADPHONE_CODEC_PRESENT) { > + extra = SND_JACK_MICROPHONE | SND_JACK_BTN_0; > + ret = snd_soc_component_set_jack(component, jack, &extra); I am a bit confused on why this wasn't set for rt5682? > + } else > + ret = snd_soc_component_set_jack(component, jack, NULL); > +static const struct snd_soc_dapm_route rt5650_spk_dapm_routes[] = { > + /* speaker */ > + { "Left Spk", NULL, "SPOL" }, > + { "Right Spk", NULL, "SPOR" }, > +}; > + > static const struct snd_soc_dapm_route dmic_map[] = { > /* digital mics */ > {"DMic", NULL, "SoC DMIC"}, > }; > > +static int rt5650_spk_init(struct snd_soc_pcm_runtime *rtd) > +{ > + struct snd_soc_card *card = rtd->card; > + int ret; > + > + ret = snd_soc_dapm_add_routes(&card->dapm, rt5650_spk_dapm_routes, > + ARRAY_SIZE(rt5650_spk_dapm_routes)); > + if (ret) > + dev_err(rtd->dev, "fail to add dapm routes, ret=%d\n", ret); > + > + return ret; > +} > + > static int dmic_init(struct snd_soc_pcm_runtime *rtd) > { > struct snd_soc_card *card = rtd->card; > @@ -614,6 +656,17 @@ static struct snd_soc_dai_link_component rt5682s_component[] = { > } > }; > > +static struct snd_soc_dai_link_component rt5650_components[] = { > + { > + .name = "i2c-10EC5650:00", > + .dai_name = "rt5645-aif1", > + }, > + { > + .name = "i2c-10EC5650:00", > + .dai_name = "rt5645-aif2", > + } > +}; can we move these definitions to realtek_common.c, chances are other boards will also use this codec. Thanks!