Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp346960lqo; Wed, 8 May 2024 01:17:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUKkuKNl9pPELGGwhtaHsvAG6cwROAHxsUMAMKCkae36CPWdRYX4SZeBBUnDddri61eBty9wUJefURxLxdqtdO0vNMUIkY2cifM4llcfQ== X-Google-Smtp-Source: AGHT+IHuxujGR6pb6+QW1weDI+7RsEddEMS2sEHrIAhqFHQAyJollbhNzCdDiXSvGMYnBHHHhBsz X-Received: by 2002:a05:620a:1912:b0:792:b254:640f with SMTP id af79cd13be357-792b2868c62mr246775785a.57.1715156228344; Wed, 08 May 2024 01:17:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715156228; cv=pass; d=google.com; s=arc-20160816; b=0gKhKE99Cv3wPkKulPY3k+q+mSCyJr5M8d2M9qw7uNbKxE0uiKXj6on5aqhwvTLJ0/ v8qJ67qdyWd/WIUPADWaR6V5xlD6mnDpx9IjIi2U+CFOXTR+bnhbUrM0IYJkEeXnoJiS kIe2XSSgTSsXWo2L8ZEANcS4TxKf65sDeqguIBFG/v9+f+wyd6j1dKoxHPyPf+DPruSG qkxn0F/ZjhwKIleaTExN1TnXRdJ+nmw7OHEVxLk5PZ4/aQ47IfLWXUZqCoiYEBBeffWz GCt/mqtyj55nZVftpZ3LTOTCejMemdLkOnncXJL+db0zGLE2dvkf/fdR2pjFb8NoV7pq EXQg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=0J7Cge03mHzKytqfe46M5SWmiJDYT6L/0iD5WUZ2XNk=; fh=DS360G6FTkZOzhzfvLfObqDJVT3wWb+BD/6TW85dnmw=; b=Lks8ufQebhASsqJxCxeSFqxn1J5cUGz8CkXoh2bZL/8+fssSmf7H7KZW1eWLQff5S1 QjRvvTNSDMl6hyBvRKIDsQsegYK8CM6KRYHJ4YFFJ+k0BM5bSglPyFpYkt3ldiZ/vsfo WFYUpQC3iCdiol/uesxJsRWKzX0A3GhKW6h+F8qCUOfFsbx+6kqDscN1RRG1LOLwWJLf YEpwsZwk0jXS415bDY1YqviQfltHVrvhx75iET2I3Aqozgu2oQsp2KFDm0jz5rSYgURe SBE85VktKyJMzVWoQ2nZ7uFSU/PLR11xxnj+NTkCOQySaDt/TJ1tKGfhXat1a5sToBTL bLxw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=f7vbQN84; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-172897-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172897-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id bm4-20020a05620a198400b00790f15ddc2csi14442590qkb.166.2024.05.08.01.17.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 01:17:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172897-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=f7vbQN84; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-172897-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172897-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 06A2A1C20B43 for ; Wed, 8 May 2024 08:17:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9458A4EB37; Wed, 8 May 2024 08:16:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="f7vbQN84" Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EB4213D96D for ; Wed, 8 May 2024 08:16:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715156204; cv=none; b=qfImd2iKd9grjLmR2j3+Lq/2sT5Kg481cV4YdufTiqnMaVrToUcVzV2J245aLT/uWV2E9YaKRJ0dWYMckka2sP+I2Fx5HbXE4MZtN9tk+HBBrC7D4tkz/RwBTu0ZA4+56+Gp9GpCaNpwO4kulzWCFpht+SNayDxo9x2WD1nEvkA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715156204; c=relaxed/simple; bh=d+whTvaCUFBkWJxrgaqvE8kSJoAykKqRo1KOv90DlbU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UPSOom0UrtLCBvcEaH2VuhaSX7w4hb+vNCfXagoVFbBAUNp94Mc6/lEGSGtYBVXNwDlXK1XsIhEdnv5RhEXlsokFnTwFK5U2HA2Qx0inmpyBDvdSG/HmAsjN65h+SAIs64WYMEUud+UQADgSD8JpkMnlQpXOFsWm94wziOip/RU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=f7vbQN84; arc=none smtp.client-ip=209.85.218.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-a599c55055dso983298766b.0 for ; Wed, 08 May 2024 01:16:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715156201; x=1715761001; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=0J7Cge03mHzKytqfe46M5SWmiJDYT6L/0iD5WUZ2XNk=; b=f7vbQN84MmEXa6zfdIQXTCMOu/cdgPlHNYqaT1scThHruAPl6lBcFx0uMY44aNwHkl zjIjP3Acd8niiTc93Y2c5RlaMY3o3pbT4H43ujxJwoAu2HqaZgwD6Z9JJ5LaECwJua+f QF6nNtCUqQfNfpNx4CXIE7smNJO7PkGjt0e3ViNqfwK+w25y9rRuj2L7pP06WsvPin+O us3Vfz0oqiUFTaxb27FiOeMtZdJM6o+67xNBBfZtfhoo39ljw2shXPBwBTOn2s52NkeP E2EViKQPKLfL8FdZHsnuwDO92xOBU/so6F6UOjH8OhvXwIzjwunh9KJ7E8e5l26SBN96 MUFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715156201; x=1715761001; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0J7Cge03mHzKytqfe46M5SWmiJDYT6L/0iD5WUZ2XNk=; b=hZncXJKmp8U5u5RSDLdjovSqEFZUfk1gJ93SdXbipw5SvrtGORro28f9KQcq0tH9jp zREA5Ac8NOZpkdKCQdg/BTTQfRP2YDjY2kZ5tDLdIyIZHxz649Dbw9FarrP7YYEKgbbx 4TkEsarFnhPEIJZnM7w5zCOwKctKMdFwNydD6hVrRk5mrpcO7IEbywsa96pk65A4ckLZ NnhyZZe70b80w/AQb8kqie92Dg1t0WV6IZiKz75kA8B5c6EXNYD0G8pW8ZnGRnVI7WFW RMIEqKhxX7Igps/iUxRCz+EhIUhLE76fF/3VZWXCZsM1wHPrNV7hh7ua14kyltiknZet pFjQ== X-Forwarded-Encrypted: i=1; AJvYcCWEbNTU9LtcYqAfU2abefUq0ITnk249XY/JU7o3Rt+QypYrN/hBcuK6zUwkYiqGt4LthTVCa6TVwfonnhcujGmKO2r6skQ90NkDN2Cv X-Gm-Message-State: AOJu0YzrKdBD+Rpe0+ysvGPTv7/MSh4otXRq+dSXoQaa1Hs5PEECsKF6 iJ5a+lDrXRscJISH67HMXbPlMwRqdhFS5yvLl0fNEpJCaTnrod0jPCWc1BA5azE= X-Received: by 2002:a17:906:4a01:b0:a59:afdd:5911 with SMTP id a640c23a62f3a-a59fb9cf8ebmr117229466b.61.1715156201334; Wed, 08 May 2024 01:16:41 -0700 (PDT) Received: from [127.0.1.1] ([178.197.206.169]) by smtp.gmail.com with ESMTPSA id va28-20020a17090711dc00b00a59b87dd0d7sm4564734ejb.147.2024.05.08.01.16.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 01:16:40 -0700 (PDT) From: Krzysztof Kozlowski Date: Wed, 08 May 2024 10:16:28 +0200 Subject: [PATCH v2 2/4] ASoC: qcom: q6apm-lpass-dais: Implement proper channel mapping Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240508-asoc-x1e80100-4-channel-mapping-v2-2-ccef9a66a572@linaro.org> References: <20240508-asoc-x1e80100-4-channel-mapping-v2-0-ccef9a66a572@linaro.org> In-Reply-To: <20240508-asoc-x1e80100-4-channel-mapping-v2-0-ccef9a66a572@linaro.org> To: James Schulman , David Rhodes , Richard Fitzgerald , Jaroslav Kysela , Takashi Iwai , Liam Girdwood , Mark Brown , Lars-Peter Clausen , =?utf-8?q?Nuno_S=C3=A1?= , Srinivas Kandagatla , Banajit Goswami Cc: alsa-devel@alsa-project.org, patches@opensource.cirrus.com, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2494; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=d+whTvaCUFBkWJxrgaqvE8kSJoAykKqRo1KOv90DlbU=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmOzTi8NEsdlADISPfQf36sKPevu5VsjGLqs0hx kDZ6uc8tH+JAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZjs04gAKCRDBN2bmhouD 11aOD/9s1WsoAA6B5DobpnjGcCX7UuSSk/NL0D87AYUsJWiNfkbfnVALM79q2oh77xiICczVoTc F+UQ2l/Z7dybuXatUoPdSrs0jzy3aAhh4Cq85245TWhfmAVzAEwKGLUAXYGMNiWSkGhr8PF0AMl w0XyISwuUL5jS9yjcycHy2Y8xd2GWrJN5BjrEOz85WR8W+lWoietfVaE+HeFcwXXDNcXgSkSuae ndEbcKiJ01RB4rqL1ka/dn8Dvz6/S+ddEU2NlPUttdvaLsWK+MEYg+4v7VlJvm3VBlh5Uy4pmuW 3rNPNsQ6iqIH4UQ+JCiLd5Z5gTNLSAsZ9gAslAd/2AlLmYr6VeohJvMCWU3jGYjndWs3ypoHGf4 h5mnWpYgylDE94yfPG8kSiEuWRKFrKEmfGLLMzKr1NP6dR1d6pHQXZvZcV8Ge4NQkmPmHtT7sOs bMSPaJN1T0S3K0xwx/dDOFE/Tm+n5oxBYX6HyfHkgXMoF3RO0679nax4RQyea+7a6f13hrBXQEW D4cc2QND4Omhz3v7sq5pYnhMTAN3CujXiL9/dYigdLg0RXCScmuTZFtpWMWZBFHGPBbiPJsp529 BrdEQZBQHuNK38RvxE8pY72CYAJbZrUKUiXPj29rASjjCprRepydfG/Vlp60j7OnImnt+p7zFCG d85DyJDwvsMneqQ== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B The set_channel_map() implementation in q6apm-lpass-dais driver was copying older pre-Audioreach code from q6afe-dai driver, but not really using it. The code sets active channel mask based on passed channel mapping, but Audioreach code does not use that mask ever. Audioreach module configuration does have on the other hand proper channel mapping field, which should supersed that active channel mask. Drop the unused active channel mask and implement proper mapping of channels in q6apm-lpass-dais driver. Signed-off-by: Krzysztof Kozlowski --- Changes in v2: 1. Entirely replaced - now channel mapping is implemented in q6apm-lpass-dais. --- sound/soc/qcom/qdsp6/audioreach.h | 1 - sound/soc/qcom/qdsp6/q6apm-lpass-dais.c | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/sound/soc/qcom/qdsp6/audioreach.h b/sound/soc/qcom/qdsp6/audioreach.h index 2c82917b7162..eb9306280988 100644 --- a/sound/soc/qcom/qdsp6/audioreach.h +++ b/sound/soc/qcom/qdsp6/audioreach.h @@ -755,7 +755,6 @@ struct audioreach_module_config { u16 data_format; u16 num_channels; - u16 active_channels_mask; u16 dp_idx; u32 channel_allocation; u32 sd_line_mask; diff --git a/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c b/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c index 6bfbb52345e1..a4ad1d0e6abd 100644 --- a/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c +++ b/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c @@ -33,7 +33,7 @@ static int q6dma_set_channel_map(struct snd_soc_dai *dai, struct q6apm_lpass_dai_data *dai_data = dev_get_drvdata(dai->dev); struct audioreach_module_config *cfg = &dai_data->module_config[dai->id]; - int ch_mask; + int i; switch (dai->id) { case WSA_CODEC_DMA_TX_0: @@ -58,7 +58,8 @@ static int q6dma_set_channel_map(struct snd_soc_dai *dai, tx_num); return -EINVAL; } - ch_mask = *tx_ch_mask; + for (i = 0; i < tx_num; i++) + cfg->channel_map[i] = tx_ch_mask[i]; break; case WSA_CODEC_DMA_RX_0: @@ -81,7 +82,8 @@ static int q6dma_set_channel_map(struct snd_soc_dai *dai, rx_num); return -EINVAL; } - ch_mask = *rx_ch_mask; + for (i = 0; i < rx_num; i++) + cfg->channel_map[i] = rx_ch_mask[i]; break; default: @@ -90,8 +92,6 @@ static int q6dma_set_channel_map(struct snd_soc_dai *dai, return -EINVAL; } - cfg->active_channels_mask = ch_mask; - return 0; } -- 2.43.0