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 D695E25E470; Mon, 3 Mar 2025 16:31:16 +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=1741019477; cv=none; b=WxKiZ+k0D83bMB/Dt9X2oETirfAZKujjEqJiJK5kckc9RT+Vq3vvaDnhP+rD5E44xdxsf7T4uVtzhZ760ASHqbZ/VCHCVBJNMmGnrRygCm4oE/iXy1oGoiSVJ2HnsZaGFKpGFjeXXw3kqF2xy6Xr4aX5aUSWsd6kml6goH212to= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741019477; c=relaxed/simple; bh=GJgPGRE9pDnHvPmxAHFHzTLTrNPsxNr62otSflZ099A=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rFjeTZXMFbzJo403tclWetplsZr7C2MJ6V1/g1WQGEzc2A8RVN/4jSBk/3pwvZQ9bBl7DWrTJI7vlzliUypnDZCpbfDpZ0ceMUX64bOi8fsG3bn6of0hDR8cjByjiZF9BjNl5Ni5bHoLesrtJe/Rypdh9uR8NgLXIQN/GeEjZNs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kxmaF+QH; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kxmaF+QH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0D13C4CED6; Mon, 3 Mar 2025 16:31:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1741019476; bh=GJgPGRE9pDnHvPmxAHFHzTLTrNPsxNr62otSflZ099A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kxmaF+QHVaZERaS2VWXi6kD+tpVx9wLlbzoC/HqiIeliOExCkBUT+rvAyxmYGv8pR I9v2cDi5GWISVek5Z38fCgwKfZLjk/EOhM9U+vxbCtEz69ILiO97dazzFvzF2uKBtm i+ka6VbGGXj1cp6ooRkK4cFjlNi1DjTCyKUeGYoyApj7NxZnlaHob4+HLq5R2yER2E ge3GRweLWmmg1dRGuoMkzy5tlgcVxZHuiP+v9aGv3INAcXCpN3XYoQnPBHbyvcE+y9 Mzjb/4SsdSxqRlqUiZtdpAeBY7ro5nPmjS5KZdcH9zoFL5W5ltze2oVzEXNRv+RYD8 0CC3mov651xGA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Hector Martin , Neal Gompa , James Calligeros , Mark Brown , Sasha Levin , shenghao-ding@ti.com, kevin-lu@ti.com, baojun.xu@ti.com, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, linux-sound@vger.kernel.org Subject: [PATCH AUTOSEL 6.6 03/11] ASoC: tas2764: Set the SDOUT polarity correctly Date: Mon, 3 Mar 2025 11:31:01 -0500 Message-Id: <20250303163109.3763880-3-sashal@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250303163109.3763880-1-sashal@kernel.org> References: <20250303163109.3763880-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.6.80 Content-Transfer-Encoding: 8bit From: Hector Martin [ Upstream commit f5468beeab1b1adfc63c2717b1f29ef3f49a5fab ] TX launch polarity needs to be the opposite of RX capture polarity, to generate the right bit slot alignment. Reviewed-by: Neal Gompa Signed-off-by: Hector Martin Signed-off-by: James Calligeros Link: https://patch.msgid.link/20250218-apple-codec-changes-v2-28-932760fd7e07@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/tas2764.c | 10 +++++++++- sound/soc/codecs/tas2764.h | 6 ++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/tas2764.c b/sound/soc/codecs/tas2764.c index a9838e0738cc1..e87a07eee9737 100644 --- a/sound/soc/codecs/tas2764.c +++ b/sound/soc/codecs/tas2764.c @@ -367,7 +367,7 @@ static int tas2764_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) { struct snd_soc_component *component = dai->component; struct tas2764_priv *tas2764 = snd_soc_component_get_drvdata(component); - u8 tdm_rx_start_slot = 0, asi_cfg_0 = 0, asi_cfg_1 = 0; + u8 tdm_rx_start_slot = 0, asi_cfg_0 = 0, asi_cfg_1 = 0, asi_cfg_4 = 0; int ret; switch (fmt & SND_SOC_DAIFMT_INV_MASK) { @@ -376,12 +376,14 @@ static int tas2764_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) fallthrough; case SND_SOC_DAIFMT_NB_NF: asi_cfg_1 = TAS2764_TDM_CFG1_RX_RISING; + asi_cfg_4 = TAS2764_TDM_CFG4_TX_FALLING; break; case SND_SOC_DAIFMT_IB_IF: asi_cfg_0 ^= TAS2764_TDM_CFG0_FRAME_START; fallthrough; case SND_SOC_DAIFMT_IB_NF: asi_cfg_1 = TAS2764_TDM_CFG1_RX_FALLING; + asi_cfg_4 = TAS2764_TDM_CFG4_TX_RISING; break; } @@ -391,6 +393,12 @@ static int tas2764_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) if (ret < 0) return ret; + ret = snd_soc_component_update_bits(component, TAS2764_TDM_CFG4, + TAS2764_TDM_CFG4_TX_MASK, + asi_cfg_4); + if (ret < 0) + return ret; + switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { case SND_SOC_DAIFMT_I2S: asi_cfg_0 ^= TAS2764_TDM_CFG0_FRAME_START; diff --git a/sound/soc/codecs/tas2764.h b/sound/soc/codecs/tas2764.h index d13ecae9c9c2f..9490f2686e389 100644 --- a/sound/soc/codecs/tas2764.h +++ b/sound/soc/codecs/tas2764.h @@ -79,6 +79,12 @@ #define TAS2764_TDM_CFG3_RXS_SHIFT 0x4 #define TAS2764_TDM_CFG3_MASK GENMASK(3, 0) +/* TDM Configuration Reg4 */ +#define TAS2764_TDM_CFG4 TAS2764_REG(0X0, 0x0d) +#define TAS2764_TDM_CFG4_TX_MASK BIT(0) +#define TAS2764_TDM_CFG4_TX_RISING 0x0 +#define TAS2764_TDM_CFG4_TX_FALLING BIT(0) + /* TDM Configuration Reg5 */ #define TAS2764_TDM_CFG5 TAS2764_REG(0X0, 0x0e) #define TAS2764_TDM_CFG5_VSNS_MASK BIT(6) -- 2.39.5