From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7E63C433EF for ; Thu, 28 Oct 2021 14:00:11 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 147CF6113B for ; Thu, 28 Oct 2021 14:00:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 147CF6113B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 80AF716A1; Thu, 28 Oct 2021 15:59:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 80AF716A1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1635429609; bh=dmMqZ0NxgQtojcBmR5U4JUSKaqzqwng3igS5XfIhf54=; h=Subject:To:References:From:Date:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=rI4QmnofrO3c7rl9/KKWMUzkEeTunEs+fCDDxWgyfOOxEif59n4o3TbZfk/u8cpkf k4gpqvIX1DO66R/BTbwNRMhcbEW0MHV0WVbD2CH+g4szpiA/7PkgX0jmXp4QvnU3Yq 69abralJA7Lsd+lXaWV6RbrG06fu8qsS4dKUw6NM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id BFBBBF804E7; Thu, 28 Oct 2021 15:58:19 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7C5BCF804EB; Thu, 28 Oct 2021 15:58:18 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 69361F804E6 for ; Thu, 28 Oct 2021 15:58:11 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 69361F804E6 X-IronPort-AV: E=McAfee;i="6200,9189,10150"; a="230262903" X-IronPort-AV: E=Sophos;i="5.87,190,1631602800"; d="scan'208";a="230262903" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Oct 2021 06:58:05 -0700 X-IronPort-AV: E=Sophos;i="5.87,190,1631602800"; d="scan'208";a="573755634" Received: from sjsanghv-mobl.amr.corp.intel.com (HELO [10.212.61.51]) ([10.212.61.51]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Oct 2021 06:58:03 -0700 Subject: Re: [PATCH] ASoc: Intel: glk_rt5682_max98357a: support ALC5682I-VS codec To: Brent Lu , alsa-devel@alsa-project.org References: <20211028060203.446093-1-brent.lu@intel.com> From: Pierre-Louis Bossart Message-ID: <2ca92247-70c6-a092-8fe2-cfca9d6f18e6@linux.intel.com> Date: Thu, 28 Oct 2021 08:58:00 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20211028060203.446093-1-brent.lu@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Cc: Guennadi Liakhovetski , Cezary Rojewski , Julian Braha , Kai Vehmanen , Nathan Chancellor , Jie Yang , Takashi Iwai , linux-kernel@vger.kernel.org, Liam Girdwood , Mark Brown , Geert Uytterhoeven , Paul Olaru , Rander Wang , Peter Ujfalusi X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" > @@ -592,12 +610,29 @@ static int geminilake_audio_probe(struct platform_device *pdev) > struct snd_soc_acpi_mach *mach; > const char *platform_name; > struct snd_soc_card *card; > - int ret; > + int ret, i; > > ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); > if (!ctx) > return -ENOMEM; > > + /* Detect the headset codec variant */ > + if (acpi_dev_present("RTL5682", NULL, -1)) { > + /* ALC5682I-VS is detected */ > + ctx->is_rt5682s = 1; > + > + for (i = 0; i < glk_audio_card_rt5682_m98357a.num_links; i++) { > + if (strcmp(geminilake_dais[i].name, "SSP2-Codec")) > + continue; > + > + /* update the dai link to use rt5682s codec */ > + geminilake_dais[i].codecs = ssp2_codec_5682s; > + geminilake_dais[i].num_codecs = ARRAY_SIZE(ssp2_codec_5682s); > + break; > + } > + } else > + ctx->is_rt5682s = 0; > + nit-pick: this branch is not required, the field is already reset with kzalloc(). > INIT_LIST_HEAD(&ctx->hdmi_pcm_list); > > card = &glk_audio_card_rt5682_m98357a; > diff --git a/sound/soc/intel/common/soc-acpi-intel-glk-match.c b/sound/soc/intel/common/soc-acpi-intel-glk-match.c > index 32fff9389eb3..4de4add74443 100644 > --- a/sound/soc/intel/common/soc-acpi-intel-glk-match.c > +++ b/sound/soc/intel/common/soc-acpi-intel-glk-match.c > @@ -40,6 +40,15 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_glk_machines[] = { > .sof_fw_filename = "sof-glk.ri", > .sof_tplg_filename = "sof-glk-rt5682.tplg", > }, > + { > + .id = "RTL5682", > + .drv_name = "glk_rt5682_max98357a", > + .fw_filename = "intel/dsp_fw_glk.bin", Have you actually tested with this firmware? if not, it's probably better not to list it as an option. > + .machine_quirk = snd_soc_acpi_codec_list, > + .quirk_data = &glk_codecs, > + .sof_fw_filename = "sof-glk.ri", > + .sof_tplg_filename = "sof-glk-rt5682.tplg", > + }, > { > .id = "10134242", > .drv_name = "glk_cs4242_mx98357a", > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 274BCC433FE for ; Thu, 28 Oct 2021 13:58:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0B611610CA for ; Thu, 28 Oct 2021 13:58:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230195AbhJ1OAx (ORCPT ); Thu, 28 Oct 2021 10:00:53 -0400 Received: from mga17.intel.com ([192.55.52.151]:13436 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231208AbhJ1OAt (ORCPT ); Thu, 28 Oct 2021 10:00:49 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10150"; a="211180582" X-IronPort-AV: E=Sophos;i="5.87,190,1631602800"; d="scan'208";a="211180582" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Oct 2021 06:58:05 -0700 X-IronPort-AV: E=Sophos;i="5.87,190,1631602800"; d="scan'208";a="573755634" Received: from sjsanghv-mobl.amr.corp.intel.com (HELO [10.212.61.51]) ([10.212.61.51]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Oct 2021 06:58:03 -0700 Subject: Re: [PATCH] ASoc: Intel: glk_rt5682_max98357a: support ALC5682I-VS codec To: Brent Lu , alsa-devel@alsa-project.org Cc: Guennadi Liakhovetski , Cezary Rojewski , Kai Vehmanen , Rander Wang , linux-kernel@vger.kernel.org, Takashi Iwai , Jie Yang , Liam Girdwood , Mark Brown , Geert Uytterhoeven , Paul Olaru , Nathan Chancellor , Julian Braha , Peter Ujfalusi References: <20211028060203.446093-1-brent.lu@intel.com> From: Pierre-Louis Bossart Message-ID: <2ca92247-70c6-a092-8fe2-cfca9d6f18e6@linux.intel.com> Date: Thu, 28 Oct 2021 08:58:00 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20211028060203.446093-1-brent.lu@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > @@ -592,12 +610,29 @@ static int geminilake_audio_probe(struct platform_device *pdev) > struct snd_soc_acpi_mach *mach; > const char *platform_name; > struct snd_soc_card *card; > - int ret; > + int ret, i; > > ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); > if (!ctx) > return -ENOMEM; > > + /* Detect the headset codec variant */ > + if (acpi_dev_present("RTL5682", NULL, -1)) { > + /* ALC5682I-VS is detected */ > + ctx->is_rt5682s = 1; > + > + for (i = 0; i < glk_audio_card_rt5682_m98357a.num_links; i++) { > + if (strcmp(geminilake_dais[i].name, "SSP2-Codec")) > + continue; > + > + /* update the dai link to use rt5682s codec */ > + geminilake_dais[i].codecs = ssp2_codec_5682s; > + geminilake_dais[i].num_codecs = ARRAY_SIZE(ssp2_codec_5682s); > + break; > + } > + } else > + ctx->is_rt5682s = 0; > + nit-pick: this branch is not required, the field is already reset with kzalloc(). > INIT_LIST_HEAD(&ctx->hdmi_pcm_list); > > card = &glk_audio_card_rt5682_m98357a; > diff --git a/sound/soc/intel/common/soc-acpi-intel-glk-match.c b/sound/soc/intel/common/soc-acpi-intel-glk-match.c > index 32fff9389eb3..4de4add74443 100644 > --- a/sound/soc/intel/common/soc-acpi-intel-glk-match.c > +++ b/sound/soc/intel/common/soc-acpi-intel-glk-match.c > @@ -40,6 +40,15 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_glk_machines[] = { > .sof_fw_filename = "sof-glk.ri", > .sof_tplg_filename = "sof-glk-rt5682.tplg", > }, > + { > + .id = "RTL5682", > + .drv_name = "glk_rt5682_max98357a", > + .fw_filename = "intel/dsp_fw_glk.bin", Have you actually tested with this firmware? if not, it's probably better not to list it as an option. > + .machine_quirk = snd_soc_acpi_codec_list, > + .quirk_data = &glk_codecs, > + .sof_fw_filename = "sof-glk.ri", > + .sof_tplg_filename = "sof-glk-rt5682.tplg", > + }, > { > .id = "10134242", > .drv_name = "glk_cs4242_mx98357a", >