Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795050459; b=z24TLgWrzTTculO+jxIpNSq6zdx/jF+nA0/dDFCgph33BZc5P/fVwk92NTdLVTzj/ZBK udo5MNAhGRymP3vKBGiiwZY26dXjGqHpecRjE004nNKWjEPrckaxFVEyPXW5kmv1s+TO1 fBYtHz16JH5Xemohtq0EeQUSgCx6P+IoEzEdSSwJ0IwCsj/wOdc+2nDTFkdUeNKuB0fSs vvUNKhTTwGIP5Qi6urKV+gQCcQaxDrl5TDBw0hS/TiV4UyCgKWNKHNVMeysGGqxXqNSt3 aWkCJDGhrJUw2c3cpkglP5J6KoSdaKHRg0Rd7NtCR2LJ0RMZGmgTZxisPr2trOnYqWA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795050459; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=lJDYSJEgxX7NU2XquBtTL0NqPAUq33pj93ZpSm6UwQk=; b=mGJyIwNf+QG0EbO4NunQg8hTPSdOo30IisEWBhmmevm7KMVfLsXeQNCZtCjM1I8WIYgf TRXpg7ewhnXipHFTr6Gwp/T3q//OgCntrJ7EbL9ghNxprFIYbUddGXLCeXeLKZpYReKov t9BcUVeguQ4anE5RbgR+fG/UWbIUkigOU/2KmMpxN1SLWWSNr0saHbI0VJtgvVhJbdX3L 5zIefnaDBpXvq5zf52wYAi2LzxrHJY2lZU5mrk0I11q7DJGtsiT+8EZO6+Jv8cWZrq3sp OZOfkCuFavvHJMNNNdHW4f/SXid/XElLyMvK3wYYt07yvu8nF/B/ai8sdb/zIUSiP7A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=a0VbErJv; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 45AA4606A31C; Thu, 19 Nov 2026 01:07:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=a0VbErJv Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9557B1F000C4; Thu, 19 Nov 2026 01:07:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795050459; bh=lJDYSJEgxX7NU2XquBtTL0NqPAUq33pj93ZpSm6UwQk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=a0VbErJvkBVvtO4ljEcAJypahguh0TndAG6vMRreVLmiosNwNqQpALrLgPLMYr9T6 HvoFbqqJ/fpJX8ujoSnidK6fbjF/zNkN789Qczlv5Oiq8xg2StzLePkeZC406RLZwE anhXwuf2WqRrEGdkJHaxMHrYvK+HnSlQZoOOyQwo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Marek Szyprowski , Charles Keepax , Sylwester Nawrocki , Mark Brown , Sasha Levin Subject: [PATCH 6.1 2675/2857] ASoC: wm8994: fix MCLK index used for setting MCLK rate Date: Wed, 18 Nov 2026 16:01:49 +0100 Message-ID: <20261118150337.889991060@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150201.293410965@linuxfoundation.org> References: <20261118150201.293410965@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Marek Szyprowski [ Upstream commit 7916b55b100973b5fb5b974e8f7c8ae9f3ac1d2e ] wm8994_set_dai_sysclk() passes the AIF index (dai->id - 1) to wm8994_set_mclk_rate(), which uses it to index the MCLK clocks and their cached rates. As a result, selecting MCLK2 as the AIF1 clock source sets and reads back the rate of MCLK1 instead, and the rate of MCLK1 is then stored as the MCLK2 rate. On the Exynos4412 Trats2 board, where MCLK1 is a fixed 24MHz clock and MCLK2 a 32768Hz clock used when the codec is idle, this gives: wm8994-codec wm8994-codec: AIF1 using MCLK2 at 24000000Hz so the driver assumes a 12MHz SYSCLK while it actually runs at 32kHz. This skips the 128fs AIF clock ratio setup for low SYSCLK rates and makes the mic detection rate configuration use the wrong clock rate. Pass the MCLK index matching the selected clock source instead. Fixes: 419e2f508336 ("ASoC: wm8994: Add support for setting MCLK clock rate") Signed-off-by: Marek Szyprowski Reviewed-by: Charles Keepax Reviewed-by: Sylwester Nawrocki Link: https://patch.msgid.link/20261021101750.3297770-4-m.szyprowski@samsung.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/wm8994.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index 88d738978be64..99f4ae86c7796 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c @@ -2542,7 +2542,7 @@ static int wm8994_set_dai_sysclk(struct snd_soc_dai *dai, case WM8994_SYSCLK_MCLK1: wm8994->sysclk[dai->id - 1] = WM8994_SYSCLK_MCLK1; - ret = wm8994_set_mclk_rate(wm8994, dai->id - 1, &freq); + ret = wm8994_set_mclk_rate(wm8994, WM8994_MCLK1, &freq); if (ret < 0) return ret; @@ -2555,7 +2555,7 @@ static int wm8994_set_dai_sysclk(struct snd_soc_dai *dai, /* TODO: Set GPIO AF */ wm8994->sysclk[dai->id - 1] = WM8994_SYSCLK_MCLK2; - ret = wm8994_set_mclk_rate(wm8994, dai->id - 1, &freq); + ret = wm8994_set_mclk_rate(wm8994, WM8994_MCLK2, &freq); if (ret < 0) return ret; -- 2.53.0