From patchwork Fri Mar 3 13:48:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= X-Patchwork-Id: 658478 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id B1954C678D4 for ; Fri, 3 Mar 2023 13:52:20 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id DC559AEA; Fri, 3 Mar 2023 14:51:28 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DC559AEA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1677851538; bh=78bhLIpL0583yO/A6uau/UxIuNrUxTtdCO8dsISk3OM=; h=From:To:Subject:Date:In-Reply-To:References:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ZDkM+9oLMHTmmdJC8qwZFdi4uwO838lUpHpPjDNPbamPVWV94DOHpU17kJfQAP5iU dPjyBsqb6rnKcf+qkNo1otzpQ8/NlKc0k2DpbYLNGWsbJiN+8T8/7wdnJU6yKWeJXS kn1N6UeAC4D81OSHhYpangBFNgjjZGlavnhMbrGw= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id E1D4CF80527; Fri, 3 Mar 2023 14:50:39 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2E7CDF800BA; Fri, 3 Mar 2023 14:50:34 +0100 (CET) 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 5663EF800BA for ; Fri, 3 Mar 2023 14:50:29 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5663EF800BA Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=epkxIjJ+ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677851430; x=1709387430; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=78bhLIpL0583yO/A6uau/UxIuNrUxTtdCO8dsISk3OM=; b=epkxIjJ+i+0hWxJFodQvoNiRHSl59gVTFB6odVxjUxTjIrfJSW6+eMOu uahg7Q5QlL+dJOKCCutAFh5qudEfTlNqDPF8ppgJFDIEAe02NfVp46RXn NfFOJkUBYyEJapeGPt4UFTMQ7D8hT7HJ0eLBlFX5GbLkqTr8vVWfIzH0q ceoGJKFDxfhT+wY1586QhtjqV5SRdpF9xJ4zGuMykIo+YMX7VQGJcnRYu cEaZpLw0iS0Pkf6vcas/gTlMFirGaC/nvpUsthC28kbdQ2FJvdrtzoIXR /tjsRzoVn+NXheLQcny8ZiEYvGrOsdatrbfiK641GX62zHFC6ebJdWdPG g==; X-IronPort-AV: E=McAfee;i="6500,9779,10637"; a="336564410" X-IronPort-AV: E=Sophos;i="5.98,230,1673942400"; d="scan'208";a="336564410" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2023 05:49:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10637"; a="668660677" X-IronPort-AV: E=Sophos;i="5.98,230,1673942400"; d="scan'208";a="668660677" Received: from dev2 (HELO DEV2.igk.intel.com) ([10.237.148.94]) by orsmga007.jf.intel.com with ESMTP; 03 Mar 2023 05:49:22 -0800 From: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= To: Mark Brown Subject: [PATCH 1/5] ASoC: Intel: avs: max98357a: Explicitly define codec format Date: Fri, 3 Mar 2023 14:48:50 +0100 Message-Id: <20230303134854.2277146-2-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230303134854.2277146-1-amadeuszx.slawinski@linux.intel.com> References: <20230303134854.2277146-1-amadeuszx.slawinski@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: LLDTKHJR7XOVBLWP43VY5NLFN4WFWM57 X-Message-ID-Hash: LLDTKHJR7XOVBLWP43VY5NLFN4WFWM57 X-MailFrom: amadeuszx.slawinski@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Cezary Rojewski , Pierre-Louis Bossart , Takashi Iwai , alsa-devel@alsa-project.org, =?utf-8?q?Amade?= =?utf-8?q?usz_S=C5=82awi=C5=84ski?= X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: max98357a is speaker codec configured in 48000/2/S16_LE format regardless of front end format, so force it to be so. Reviewed-by: Cezary Rojewski Signed-off-by: Amadeusz Sławiński --- sound/soc/intel/avs/boards/max98357a.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/sound/soc/intel/avs/boards/max98357a.c b/sound/soc/intel/avs/boards/max98357a.c index 921f42caf7e0..183123d08c5a 100644 --- a/sound/soc/intel/avs/boards/max98357a.c +++ b/sound/soc/intel/avs/boards/max98357a.c @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -24,6 +25,26 @@ static const struct snd_soc_dapm_route card_base_routes[] = { { "Spk", NULL, "Speaker" }, }; +static int +avs_max98357a_be_fixup(struct snd_soc_pcm_runtime *runrime, struct snd_pcm_hw_params *params) +{ + struct snd_interval *rate, *channels; + struct snd_mask *fmt; + + rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE); + channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); + fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT); + + /* The ADSP will convert the FE rate to 48k, stereo */ + rate->min = rate->max = 48000; + channels->min = channels->max = 2; + + /* set SSP0 to 16 bit */ + snd_mask_none(fmt); + snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S16_LE); + return 0; +} + static int avs_create_dai_link(struct device *dev, const char *platform_name, int ssp_port, struct snd_soc_dai_link **dai_link) { @@ -55,6 +76,7 @@ static int avs_create_dai_link(struct device *dev, const char *platform_name, in dl->num_platforms = 1; dl->id = 0; dl->dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS; + dl->be_hw_params_fixup = avs_max98357a_be_fixup; dl->nonatomic = 1; dl->no_pcm = 1; dl->dpcm_playback = 1; From patchwork Fri Mar 3 13:48:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= X-Patchwork-Id: 658791 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id AE52DC64EC4 for ; Fri, 3 Mar 2023 13:52:25 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id A8529DF7; Fri, 3 Mar 2023 14:51:31 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A8529DF7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1677851541; bh=pP8AQruczD+pfiRSN3UN24ECjKcr1OzxB4s+RtGyJb0=; h=From:To:Subject:Date:In-Reply-To:References:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=FjzrY+uuXP3xgr9vwmbBS8CjD1BPmotFGgyOmVGjzmV2h0prKj0Bj+qp9kLnpV680 1tszJbW086mepAK4tDuDFilQ6/E4SJl7cM2RXiKOZl0SOrk29qnJnbimshC62TDMma H/RLEkw4crnSB1HUqxcT20hJieBsFX+61C0l61M4= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id D8483F8053D; Fri, 3 Mar 2023 14:50:43 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A01E0F80266; Fri, 3 Mar 2023 14:50:35 +0100 (CET) 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 7179BF8025A for ; Fri, 3 Mar 2023 14:50:31 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7179BF8025A Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=UrJGOLsq DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677851434; x=1709387434; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=pP8AQruczD+pfiRSN3UN24ECjKcr1OzxB4s+RtGyJb0=; b=UrJGOLsqpe4th7A5KGagrBfOOqSGJOC/pK07Bh/6+9yDND2GhWEwtHRl ay8Ux4X6yjAYX/JgfO4lPASfw3Ft6ioPtNZO5H29ZnmcSs5+laBcQRoqT n0o24PjIoPu1hSXmFBxp5REewd4vjQE/z2hSOs24pz79/8samBIJ4+WBW pyx+gesPY7tXXlbq7h5x0ghR+m5GbJOt5PtN+hq2jBM9QEG42PAE15ref Z/yD3tKOehIlKoLDZLq65PW6gwJH8PD9diqNgQ1HhJC75mmez1QzU7/XR qt+6+icM7+WQv3NVZU6wwrvwNjMIB7ZPLp3eRQht2Zv1+nlAtQlovAgvL g==; X-IronPort-AV: E=McAfee;i="6500,9779,10637"; a="336564433" X-IronPort-AV: E=Sophos;i="5.98,230,1673942400"; d="scan'208";a="336564433" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2023 05:49:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10637"; a="668660703" X-IronPort-AV: E=Sophos;i="5.98,230,1673942400"; d="scan'208";a="668660703" Received: from dev2 (HELO DEV2.igk.intel.com) ([10.237.148.94]) by orsmga007.jf.intel.com with ESMTP; 03 Mar 2023 05:49:24 -0800 From: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= To: Mark Brown Subject: [PATCH 2/5] ASoC: Intel: avs: da7219: Explicitly define codec format Date: Fri, 3 Mar 2023 14:48:51 +0100 Message-Id: <20230303134854.2277146-3-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230303134854.2277146-1-amadeuszx.slawinski@linux.intel.com> References: <20230303134854.2277146-1-amadeuszx.slawinski@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: L4K6NFD2XNFP7WLXE3K5AZMX7BSX5KHH X-Message-ID-Hash: L4K6NFD2XNFP7WLXE3K5AZMX7BSX5KHH X-MailFrom: amadeuszx.slawinski@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Cezary Rojewski , Pierre-Louis Bossart , Takashi Iwai , alsa-devel@alsa-project.org, =?utf-8?q?Amade?= =?utf-8?q?usz_S=C5=82awi=C5=84ski?= X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: da7219 is headset codec configured in 48000/2/S24_LE format regardless of front end format, so force it to be so. Reviewed-by: Cezary Rojewski Signed-off-by: Amadeusz Sławiński --- sound/soc/intel/avs/boards/da7219.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sound/soc/intel/avs/boards/da7219.c b/sound/soc/intel/avs/boards/da7219.c index acd43b6108e9..1a1d572cc1d0 100644 --- a/sound/soc/intel/avs/boards/da7219.c +++ b/sound/soc/intel/avs/boards/da7219.c @@ -117,6 +117,26 @@ static void avs_da7219_codec_exit(struct snd_soc_pcm_runtime *rtd) snd_soc_component_set_jack(asoc_rtd_to_codec(rtd, 0)->component, NULL, NULL); } +static int +avs_da7219_be_fixup(struct snd_soc_pcm_runtime *runrime, struct snd_pcm_hw_params *params) +{ + struct snd_interval *rate, *channels; + struct snd_mask *fmt; + + rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE); + channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); + fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT); + + /* The ADSP will convert the FE rate to 48k, stereo */ + rate->min = rate->max = 48000; + channels->min = channels->max = 2; + + /* set SSP0 to 24 bit */ + snd_mask_none(fmt); + snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S24_LE); + return 0; +} + static int avs_create_dai_link(struct device *dev, const char *platform_name, int ssp_port, struct snd_soc_dai_link **dai_link) { @@ -148,6 +168,7 @@ static int avs_create_dai_link(struct device *dev, const char *platform_name, in dl->num_platforms = 1; dl->id = 0; dl->dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS; + dl->be_hw_params_fixup = avs_da7219_be_fixup; dl->init = avs_da7219_codec_init; dl->exit = avs_da7219_codec_exit; dl->nonatomic = 1; From patchwork Fri Mar 3 13:48:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= X-Patchwork-Id: 658477 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id F1758C64EC4 for ; Fri, 3 Mar 2023 13:52:43 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id A787FDF9; Fri, 3 Mar 2023 14:51:51 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A787FDF9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1677851561; bh=7EZYd2LvzbCfLSI95pn908Qh8TDo8ymtoqPNue673fM=; h=From:To:Subject:Date:In-Reply-To:References:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=gL2OmUHIfI8nj0v04x5SfD6Zx/SGokohYPh3kXSuPChCLStOenKmKfkfRPMw2ZhOz MRR//BCUP4BbI1Ji49vgpp/Zzs5/XgONnaCVyCsB6T/tqhm4kovtvdZ1WKuV2Jd0JP TNA0PlksCSpEoG7hagkDMEU0VJnH+3YoYLNP0CpU= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 059BCF80542; Fri, 3 Mar 2023 14:50:50 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 75B19F80551; Fri, 3 Mar 2023 14:50:45 +0100 (CET) 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 2A3ECF80236 for ; Fri, 3 Mar 2023 14:50:34 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2A3ECF80236 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=j0qSLupF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677851436; x=1709387436; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7EZYd2LvzbCfLSI95pn908Qh8TDo8ymtoqPNue673fM=; b=j0qSLupFB2AulDSH0UIAhgeJodmCWlpEPT9AuDD5nE0YGHuGRJc9XxUr sC7X/JocDGdvIVYj9lr+795XqUk3shE1pz99+JqPf8Jj8610/IfWvExAQ kDXbHVTxJ74JeCcERVRHfb/ybCuZWSudUaIptOgZjVAIE1/+pTdw+PgNn iY1DT11g7uN39qHpH8fZLtP53QqMgdo6ghQqPFsIIt67tjV7gi2wLuj2t GaHL6sM+2rr4OpCjta3xb9zw+sNTKU0SARkw3NCK1dDfvn3Dix4cGNt70 5iHLQMs9aiQCneXsyOg9d1gMUm7Pyd4baogD8Co2XeVJuPvEP8r9eFrdi Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10637"; a="336564452" X-IronPort-AV: E=Sophos;i="5.98,230,1673942400"; d="scan'208";a="336564452" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2023 05:49:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10637"; a="668660727" X-IronPort-AV: E=Sophos;i="5.98,230,1673942400"; d="scan'208";a="668660727" Received: from dev2 (HELO DEV2.igk.intel.com) ([10.237.148.94]) by orsmga007.jf.intel.com with ESMTP; 03 Mar 2023 05:49:26 -0800 From: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= To: Mark Brown Subject: [PATCH 3/5] ASoC: Intel: avs: rt5682: Explicitly define codec format Date: Fri, 3 Mar 2023 14:48:52 +0100 Message-Id: <20230303134854.2277146-4-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230303134854.2277146-1-amadeuszx.slawinski@linux.intel.com> References: <20230303134854.2277146-1-amadeuszx.slawinski@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: YQHAD5JUSJWWA6SNSGWJRUVU7KLCGRVA X-Message-ID-Hash: YQHAD5JUSJWWA6SNSGWJRUVU7KLCGRVA X-MailFrom: amadeuszx.slawinski@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Cezary Rojewski , Pierre-Louis Bossart , Takashi Iwai , alsa-devel@alsa-project.org, =?utf-8?q?Amade?= =?utf-8?q?usz_S=C5=82awi=C5=84ski?= X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: rt5682 is headset codec configured in 48000/2/S24_LE format regardless of front end format, so force it to be so. Reviewed-by: Cezary Rojewski Signed-off-by: Amadeusz Sławiński --- sound/soc/intel/avs/boards/rt5682.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/sound/soc/intel/avs/boards/rt5682.c b/sound/soc/intel/avs/boards/rt5682.c index 473e9fe5d0bf..b2c2ba93dcb5 100644 --- a/sound/soc/intel/avs/boards/rt5682.c +++ b/sound/soc/intel/avs/boards/rt5682.c @@ -169,6 +169,27 @@ static const struct snd_soc_ops avs_rt5682_ops = { .hw_params = avs_rt5682_hw_params, }; +static int +avs_rt5682_be_fixup(struct snd_soc_pcm_runtime *runtime, struct snd_pcm_hw_params *params) +{ + struct snd_interval *rate, *channels; + struct snd_mask *fmt; + + rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE); + channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); + fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT); + + /* The ADSP will convert the FE rate to 48k, stereo */ + rate->min = rate->max = 48000; + channels->min = channels->max = 2; + + /* set SSPN to 24 bit */ + snd_mask_none(fmt); + snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S24_LE); + + return 0; +} + static int avs_create_dai_link(struct device *dev, const char *platform_name, int ssp_port, struct snd_soc_dai_link **dai_link) { @@ -201,6 +222,7 @@ static int avs_create_dai_link(struct device *dev, const char *platform_name, in dl->id = 0; dl->init = avs_rt5682_codec_init; dl->exit = avs_rt5682_codec_exit; + dl->be_hw_params_fixup = avs_rt5682_be_fixup; dl->ops = &avs_rt5682_ops; dl->nonatomic = 1; dl->no_pcm = 1; From patchwork Fri Mar 3 13:48:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= X-Patchwork-Id: 658790 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id B07D8C678D4 for ; Fri, 3 Mar 2023 13:53:11 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 744CC86E; Fri, 3 Mar 2023 14:52:19 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 744CC86E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1677851589; bh=fr1TX/muqSKhj7unvsuELKJ9mleoeebLhIbGPOllTKo=; h=From:To:Subject:Date:In-Reply-To:References:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=GkJyDwSn0scqkuU8RIu2Zd0GktPZ3jpsXW+Cqp2M5hJKsRMVQYKky/hMpfEtC2cfy fF0tkwfeMnqOtxhECtno6XyZLq+eIdfSpDqo6uRMdQMcNBlrOtph/mvuj4csQ/CIG4 LaFJyYOAgA9WORIWo63UD6Jg0yHOeEcNe26v0hCg= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id B3FF2F80557; Fri, 3 Mar 2023 14:50:51 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7C73CF80542; Fri, 3 Mar 2023 14:50:46 +0100 (CET) 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 8D0A4F80533 for ; Fri, 3 Mar 2023 14:50:36 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8D0A4F80533 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=cEbkN7wQ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677851442; x=1709387442; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=fr1TX/muqSKhj7unvsuELKJ9mleoeebLhIbGPOllTKo=; b=cEbkN7wQRQXxPqRU5Ple+NGGaANHhArPV5VQOXRjQe/m6ZAn2wKE2uLP OKQH0UGxVjnGD2hjslbq8X3zjdY8RxCTN+oZSI2UpVZ/0fPyowL0nrM0B svi1Etnz+pYD8+rmt7eUcrUEM/uD8pkeyAQumjrt2bLEE+1h/zwk697ty dcVJGtescTLqWU7QHFO9x4UYlCRqNoGYNb2MxsXFqhy2N2LgriUbOwkpT 0/MN2lSp/TovIJuPhDc1Tv6hV6mmukBrgbZEhW0DpYyzb2rwYYvzIb8Qv BFzt41wuIIEDgUpLO/26LeMQ7q01uG6gQrOZuvsUMIvFPtpvMDgQ+Ajbt w==; X-IronPort-AV: E=McAfee;i="6500,9779,10637"; a="336564466" X-IronPort-AV: E=Sophos;i="5.98,230,1673942400"; d="scan'208";a="336564466" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2023 05:49:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10637"; a="668660744" X-IronPort-AV: E=Sophos;i="5.98,230,1673942400"; d="scan'208";a="668660744" Received: from dev2 (HELO DEV2.igk.intel.com) ([10.237.148.94]) by orsmga007.jf.intel.com with ESMTP; 03 Mar 2023 05:49:28 -0800 From: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= To: Mark Brown Subject: [PATCH 4/5] ASoC: Intel: avs: ssm4567: Remove nau8825 bits Date: Fri, 3 Mar 2023 14:48:53 +0100 Message-Id: <20230303134854.2277146-5-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230303134854.2277146-1-amadeuszx.slawinski@linux.intel.com> References: <20230303134854.2277146-1-amadeuszx.slawinski@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: GZ4G55OH4JADGCLTMEGLOV7GWWE2L7BK X-Message-ID-Hash: GZ4G55OH4JADGCLTMEGLOV7GWWE2L7BK X-MailFrom: amadeuszx.slawinski@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Cezary Rojewski , Pierre-Louis Bossart , Takashi Iwai , alsa-devel@alsa-project.org, =?utf-8?q?Amade?= =?utf-8?q?usz_S=C5=82awi=C5=84ski?= X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Cezary Rojewski Some of the nau8825 clock control got into the ssm4567, remove it. Signed-off-by: Cezary Rojewski Signed-off-by: Amadeusz Sławiński --- sound/soc/intel/avs/boards/ssm4567.c | 31 ---------------------------- 1 file changed, 31 deletions(-) diff --git a/sound/soc/intel/avs/boards/ssm4567.c b/sound/soc/intel/avs/boards/ssm4567.c index c5db69612762..2b7f5ad92aca 100644 --- a/sound/soc/intel/avs/boards/ssm4567.c +++ b/sound/soc/intel/avs/boards/ssm4567.c @@ -15,7 +15,6 @@ #include #include "../../../codecs/nau8825.h" -#define SKL_NUVOTON_CODEC_DAI "nau8825-hifi" #define SKL_SSM_CODEC_DAI "ssm4567-hifi" static struct snd_soc_codec_conf card_codec_conf[] = { @@ -34,41 +33,11 @@ static const struct snd_kcontrol_new card_controls[] = { SOC_DAPM_PIN_SWITCH("Right Speaker"), }; -static int -platform_clock_control(struct snd_soc_dapm_widget *w, struct snd_kcontrol *control, int event) -{ - struct snd_soc_dapm_context *dapm = w->dapm; - struct snd_soc_card *card = dapm->card; - struct snd_soc_dai *codec_dai; - int ret; - - codec_dai = snd_soc_card_get_codec_dai(card, SKL_NUVOTON_CODEC_DAI); - if (!codec_dai) { - dev_err(card->dev, "Codec dai not found\n"); - return -EINVAL; - } - - if (SND_SOC_DAPM_EVENT_ON(event)) { - ret = snd_soc_dai_set_sysclk(codec_dai, NAU8825_CLK_MCLK, 24000000, - SND_SOC_CLOCK_IN); - if (ret < 0) - dev_err(card->dev, "set sysclk err = %d\n", ret); - } else { - ret = snd_soc_dai_set_sysclk(codec_dai, NAU8825_CLK_INTERNAL, 0, SND_SOC_CLOCK_IN); - if (ret < 0) - dev_err(card->dev, "set sysclk err = %d\n", ret); - } - - return ret; -} - static const struct snd_soc_dapm_widget card_widgets[] = { SND_SOC_DAPM_SPK("Left Speaker", NULL), SND_SOC_DAPM_SPK("Right Speaker", NULL), SND_SOC_DAPM_SPK("DP1", NULL), SND_SOC_DAPM_SPK("DP2", NULL), - SND_SOC_DAPM_SUPPLY("Platform Clock", SND_SOC_NOPM, 0, 0, platform_clock_control, - SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), }; static const struct snd_soc_dapm_route card_base_routes[] = { From patchwork Fri Mar 3 13:48:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= X-Patchwork-Id: 658476 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id B7C93C64EC4 for ; Fri, 3 Mar 2023 13:53:14 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 486B9DF6; Fri, 3 Mar 2023 14:52:22 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 486B9DF6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1677851592; bh=sanC6Jt1tjQPITAda83dPQ89Fu2XuJu8kW31jwXgN24=; h=From:To:Subject:Date:In-Reply-To:References:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Oq6RdRvWpPB3kkL30eqD7Nemhe+ua8n+Za+5ev7Otc3c7gsXQJbvbsBueknIbil1t IDmv4JHIVBiUXloRPMdOv3FcaXbdnvLdLQQ2X23XF+b0M+VLVFHlzeHF1mKe+6iTc2 u9BfQWLjb8hrxZ36jOJtuXgJGPbejbMeTvZeGSv8= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 468CFF80567; Fri, 3 Mar 2023 14:50:53 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 37428F80542; Fri, 3 Mar 2023 14:50:48 +0100 (CET) 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 A8B34F80520 for ; Fri, 3 Mar 2023 14:50:36 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A8B34F80520 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=WtuNa7hx DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677851439; x=1709387439; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sanC6Jt1tjQPITAda83dPQ89Fu2XuJu8kW31jwXgN24=; b=WtuNa7hxA/7EOJZTyaVNsUdQTH4nYMUKY8piyV4R7ZuiMldSJmHRZUC+ Mz9SFzQP+dgbwuIYzMX3WwPLJ9JwbwvWpovCl8jnFQvkDg5wtDbyHIpLT XxIm81WGljQCKc29cXuvLKyxPEsJL++UM9kOLNuQpXcLndZ/nKtmyRubb 1Agd2JORCI87LeVAIFui9CAPVsEhJfZOTNZpIrT/EZMaAqfkx91r1OSMF yjUxr6NCTZ61CYmC8C7/zZePGMBxGiEM55EHfICGM+NsWTKK7dyTdsaVy WzflnDoONuJ7WJ3TJIV+tTIx4C+8mUj6kZCOH06lfhj2PMcrV4arNkvQZ g==; X-IronPort-AV: E=McAfee;i="6500,9779,10637"; a="336564485" X-IronPort-AV: E=Sophos;i="5.98,230,1673942400"; d="scan'208";a="336564485" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2023 05:49:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10637"; a="668660757" X-IronPort-AV: E=Sophos;i="5.98,230,1673942400"; d="scan'208";a="668660757" Received: from dev2 (HELO DEV2.igk.intel.com) ([10.237.148.94]) by orsmga007.jf.intel.com with ESMTP; 03 Mar 2023 05:49:30 -0800 From: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= To: Mark Brown Subject: [PATCH 5/5] ASoC: Intel: avs: nau8825: Adjust clock control Date: Fri, 3 Mar 2023 14:48:54 +0100 Message-Id: <20230303134854.2277146-6-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230303134854.2277146-1-amadeuszx.slawinski@linux.intel.com> References: <20230303134854.2277146-1-amadeuszx.slawinski@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: 2T7GSDRUPGJCVV2V6T4MVLMYCOCOOIL7 X-Message-ID-Hash: 2T7GSDRUPGJCVV2V6T4MVLMYCOCOOIL7 X-MailFrom: amadeuszx.slawinski@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Cezary Rojewski , Pierre-Louis Bossart , Takashi Iwai , alsa-devel@alsa-project.org, =?utf-8?q?Amade?= =?utf-8?q?usz_S=C5=82awi=C5=84ski?= X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Cezary Rojewski Internal clock shall be adjusted also in cases when DAPM event other than 'ON' is triggered. Signed-off-by: Cezary Rojewski Signed-off-by: Amadeusz Sławiński --- sound/soc/intel/avs/boards/nau8825.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sound/soc/intel/avs/boards/nau8825.c b/sound/soc/intel/avs/boards/nau8825.c index b31fa931ba8b..b69fc5567135 100644 --- a/sound/soc/intel/avs/boards/nau8825.c +++ b/sound/soc/intel/avs/boards/nau8825.c @@ -33,15 +33,15 @@ avs_nau8825_clock_control(struct snd_soc_dapm_widget *w, struct snd_kcontrol *co return -EINVAL; } - if (!SND_SOC_DAPM_EVENT_ON(event)) { + if (SND_SOC_DAPM_EVENT_ON(event)) + ret = snd_soc_dai_set_sysclk(codec_dai, NAU8825_CLK_MCLK, 24000000, + SND_SOC_CLOCK_IN); + else ret = snd_soc_dai_set_sysclk(codec_dai, NAU8825_CLK_INTERNAL, 0, SND_SOC_CLOCK_IN); - if (ret < 0) { - dev_err(card->dev, "set sysclk err = %d\n", ret); - return ret; - } - } + if (ret < 0) + dev_err(card->dev, "Set sysclk failed: %d\n", ret); - return 0; + return ret; } static const struct snd_kcontrol_new card_controls[] = {