]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: rt1321: fix DMIC ch2/3 mask issue
authorShuming Fan <shumingf@realtek.com>
Wed, 25 Feb 2026 09:12:10 +0000 (17:12 +0800)
committerMark Brown <broonie@kernel.org>
Sun, 1 Mar 2026 23:48:08 +0000 (23:48 +0000)
This patch fixed the DMIC ch2/3 mask missing problem.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://patch.msgid.link/20260225091210.3648905-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/rt1320-sdw.c

index 50f65662e1433ed7475a86a9e312b4c326ba48f5..8bb7e8497c726edb9805f8fe53c6dad138423ab3 100644 (file)
@@ -2629,7 +2629,7 @@ static int rt1320_sdw_hw_params(struct snd_pcm_substream *substream,
        struct sdw_port_config port_config;
        struct sdw_port_config dmic_port_config[2];
        struct sdw_stream_runtime *sdw_stream;
-       int retval;
+       int retval, num_channels;
        unsigned int sampling_rate;
 
        dev_dbg(dai->dev, "%s %s", __func__, dai->name);
@@ -2661,7 +2661,8 @@ static int rt1320_sdw_hw_params(struct snd_pcm_substream *substream,
                                dmic_port_config[1].num = 10;
                                break;
                        case RT1321_DEV_ID:
-                               dmic_port_config[0].ch_mask = BIT(0) | BIT(1);
+                               num_channels = params_channels(params);
+                               dmic_port_config[0].ch_mask = GENMASK(num_channels - 1, 0);
                                dmic_port_config[0].num = 8;
                                break;
                        default: