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 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 8974AC433F5 for ; Tue, 31 May 2022 15:16:41 +0000 (UTC) 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 B0A58204E; Tue, 31 May 2022 17:15:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B0A58204E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1654010199; bh=KzVObEc7Veab/GZreg6FyOROGy7YjFcSKS2Z9DBNJis=; h=Date:Subject:To:References:From:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=feLeXE/Upz1QttOduJYth6dzvh10I+6b+PpvKmxYxQrKLurdP3plqnP16O/1NRpDA G27qqHibK92Rd9xqAFI2pp8oRnCPzm8d8THmFO2VgnB3SM1VDn7haFETIhR2KWAbiK wkHXM8bFuLVcEzAZ5FPxUQUu4Jz5RRrByEJKEsOE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 42897F80525; Tue, 31 May 2022 17:15:06 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 24C17F8019B; Tue, 31 May 2022 17:15:05 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 84F9FF8019B for ; Tue, 31 May 2022 17:14:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 84F9FF8019B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="HB0No7rI" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654010099; x=1685546099; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=KzVObEc7Veab/GZreg6FyOROGy7YjFcSKS2Z9DBNJis=; b=HB0No7rIHULS+0bi4CSBwE5nzo+CIv1isgjNfy/FiSNjRdS/9i896wZQ sY2tuvNknLym7xy4AQ1szZWisbUg0Jx/bU9GNJ2L4lZPXaMS9a8bfbsu1 pkcoDRGYhwOPp/nUWoJrElPqAmanZWKOV8WdN4WkKUxhVgAs82EESvu7j s42x+K7EsbJ8DV9j5pkrR1zXrmbfTOmlRnEk2roL+3u//TGG757QJIlIn PBFqWSVXYfQkmIcV2PQ6W+COma4/nlqBWcarfTv6qwiyg9zrsC9r9aq+F o5gW8E1yrfl8SeMTnfwKOdM8dRxq+u1vrTG7avePHyG8re++dpb+PM5sD Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10364"; a="275369519" X-IronPort-AV: E=Sophos;i="5.91,265,1647327600"; d="scan'208";a="275369519" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2022 08:11:13 -0700 X-IronPort-AV: E=Sophos;i="5.91,265,1647327600"; d="scan'208";a="720349516" Received: from kmoorti-mobl.amr.corp.intel.com (HELO [10.212.153.18]) ([10.212.153.18]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2022 08:11:12 -0700 Message-ID: <8a8a6bd9-aabf-6f27-0422-a47b01556276@linux.intel.com> Date: Tue, 31 May 2022 09:51:36 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.5.0 Subject: Re: [PATCH] ASoC: Intel: cirrus-common: fix incorrect channel mapping Content-Language: en-US To: Brent Lu , alsa-devel@alsa-project.org References: <20220530125421.885236-1-brent.lu@intel.com> From: Pierre-Louis Bossart In-Reply-To: <20220530125421.885236-1-brent.lu@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Cezary Rojewski , linux-kernel@vger.kernel.org, Jie Yang , Takashi Iwai , Liam Girdwood , Mark Brown , xliu , Bard Liao 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" On 5/30/22 07:54, Brent Lu wrote: > From: xliu > > The default mapping of ASPRX1 Slot is left channel. Map the slots of > right amplifiers (WR and TR) to right channel. > > Signed-off-by: xliu > Signed-off-by: Brent Lu > --- > sound/soc/intel/boards/sof_cirrus_common.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/sound/soc/intel/boards/sof_cirrus_common.c b/sound/soc/intel/boards/sof_cirrus_common.c > index e71d74ec1b0b..64ca0e3991dc 100644 > --- a/sound/soc/intel/boards/sof_cirrus_common.c > +++ b/sound/soc/intel/boards/sof_cirrus_common.c > @@ -107,6 +107,7 @@ static int cs35l41_hw_params(struct snd_pcm_substream *substream, > struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); > struct snd_soc_dai *codec_dai; > int clk_freq, i, ret; > + int rx_ch[2] = {1, 0}; Should this be 'const'? I am also not clear on the mapping, how does this select the right channel? This selects slot0 and the left channel, what am I missing? > > clk_freq = sof_dai_get_bclk(rtd); /* BCLK freq */ > > @@ -134,6 +135,17 @@ static int cs35l41_hw_params(struct snd_pcm_substream *substream, > ret); > return ret; > } > + > + /* Setup for R channel Slot: WR and TR */ > + if (i % 2) { > + ret = snd_soc_dai_set_channel_map(codec_dai, 0, NULL, > + ARRAY_SIZE(rx_ch), rx_ch); > + if (ret < 0) { > + dev_err(codec_dai->dev, "fail to set channel map, ret %d\n", > + ret); > + return ret; > + } > + } Should we do this loop for the left channels as well to have an explicit setting? > } > > return 0;