From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8F934214210; Tue, 11 Nov 2025 01:30:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762824640; cv=none; b=rBNcxr++7AxKniMb/itD+tJwxgpU8TuKguVIk1FFcq5aOFJj4twc3NHaKRGOUGahZ1BAQ2TsyknxhimIfvJjp8aQH5RBU/xarcrNK1Yo/4V4hEeBY7lzSrFmiBgTMHLl2SA242WLoZjYD7g7dnzwQLkMX1n1knERpVzwl5mEdJM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762824640; c=relaxed/simple; bh=APeFQIrCfPys4N1eC43CW+1wgSGDmIi58KqHQZKLkjc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IcTLUspZ1mlyWm6iQL87WBnbpmSwwoBRpiXGm7yp11kMo4ZWdZr6FhCjr8uojdtxdHcLWd6HdbYwh1KTC3iKVzN8zHe+ounKrQIFD9IYid7o/YG5FT442O0y8Z0xsJ5e1uf1l+ZoUSs4YDKqZmbPSetP75YmfaD9twSieoQPnHo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=jAVBXqNP; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="jAVBXqNP" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2235DC4CEFB; Tue, 11 Nov 2025 01:30:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1762824640; bh=APeFQIrCfPys4N1eC43CW+1wgSGDmIi58KqHQZKLkjc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jAVBXqNPpCvQdxOhR2mpI5Tp4kUXI/l/qtMzgqjGAEwnia5OXGRr+Jek1vx+rjbnZ aME8I9hNJ1o2ws8Q/EBIfTLkGWCmgzEwjcCn4NAC1TwEewgqk6NvUgQIKoLh7A1i4K BmbY/Wlv/m2yn1rkTk+5Jk3MWYVZrMq+wIIfnKmo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Valerio Setti , Jerome Brunet , Mark Brown , Sasha Levin Subject: [PATCH 6.12 490/565] ASoC: meson: aiu-encoder-i2s: fix bit clock polarity Date: Tue, 11 Nov 2025 09:45:46 +0900 Message-ID: <20251111004537.956655855@linuxfoundation.org> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20251111004526.816196597@linuxfoundation.org> References: <20251111004526.816196597@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Valerio Setti [ Upstream commit 4c4ed5e073a923fb3323022e1131cb51ad8df7a0 ] According to I2S specs audio data is sampled on the rising edge of the clock and it can change on the falling one. When operating in normal mode this SoC behaves the opposite so a clock polarity inversion is required in this case. This was tested on an OdroidC2 (Amlogic S905 SoC) board. Signed-off-by: Valerio Setti Reviewed-by: Jerome Brunet Tested-by: Jerome Brunet Link: https://patch.msgid.link/20251007-fix-i2s-polarity-v1-1-86704d9cda10@baylibre.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/meson/aiu-encoder-i2s.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sound/soc/meson/aiu-encoder-i2s.c b/sound/soc/meson/aiu-encoder-i2s.c index a0dd914c8ed13..3b4061508c180 100644 --- a/sound/soc/meson/aiu-encoder-i2s.c +++ b/sound/soc/meson/aiu-encoder-i2s.c @@ -236,8 +236,12 @@ static int aiu_encoder_i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) inv == SND_SOC_DAIFMT_IB_IF) val |= AIU_CLK_CTRL_LRCLK_INVERT; - if (inv == SND_SOC_DAIFMT_IB_NF || - inv == SND_SOC_DAIFMT_IB_IF) + /* + * The SoC changes data on the rising edge of the bitclock + * so an inversion of the bitclock is required in normal mode + */ + if (inv == SND_SOC_DAIFMT_NB_NF || + inv == SND_SOC_DAIFMT_NB_IF) val |= AIU_CLK_CTRL_AOCLK_INVERT; /* Signal skew */ @@ -328,4 +332,3 @@ const struct snd_soc_dai_ops aiu_encoder_i2s_dai_ops = { .startup = aiu_encoder_i2s_startup, .shutdown = aiu_encoder_i2s_shutdown, }; - -- 2.51.0