Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: ti: davinci-mcasp: Streamline pdir behavior across rx & tx streams

Simplify the mcasp_set_clk_pdir caller convention in start/stop stream
function, to make it so that set_clk_pdir gets called regardless when
stream starts and also disables when stream ends.

Functionality-wise, everything remains the same as the previously skipped
calls are now either correctly configured
(when McASP is SND_SOC_DAIFMT_BP_FC - pdir needs to be enabled)
or called with a bitmask of zero (when McASP is SND_SOC_DAIFMT_BC_FC - pdir
gets disabled).

On brief regarding McASP Clock and Frame sync configurations, refer to [0].

[0]:TRM Section 12.1.1.4.2 https://www.ti.com/lit/ug/sprujd4a/sprujd4a.pdf

Signed-off-by: Sen Wang <sen@ti.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Tested-by: Paresh Bhagat <p-bhagat@ti.com>
Link: https://patch.msgid.link/20260203003703.2334443-4-sen@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Sen Wang and committed by
Mark Brown
016efcaa e683cb08

+4 -4
+4 -4
sound/soc/ti/davinci-mcasp.c
··· 236 236 if (mcasp_is_frame_producer(mcasp) && mcasp_is_synchronous(mcasp)) { 237 237 mcasp_set_ctl_reg(mcasp, DAVINCI_MCASP_GBLCTLX_REG, TXHCLKRST); 238 238 mcasp_set_ctl_reg(mcasp, DAVINCI_MCASP_GBLCTLX_REG, TXCLKRST); 239 - mcasp_set_clk_pdir(mcasp, true); 240 239 } 240 + mcasp_set_clk_pdir(mcasp, true); 241 241 242 242 /* Activate serializer(s) */ 243 243 mcasp_set_reg(mcasp, DAVINCI_MCASP_RXSTAT_REG, 0xFFFFFFFF); ··· 312 312 * In synchronous mode stop the TX clocks if no other stream is 313 313 * running 314 314 */ 315 - if (mcasp_is_frame_producer(mcasp) && mcasp_is_synchronous(mcasp) && !mcasp->streams) { 315 + if (!mcasp->streams) 316 316 mcasp_set_clk_pdir(mcasp, false); 317 + if (mcasp_is_frame_producer(mcasp) && mcasp_is_synchronous(mcasp) && !mcasp->streams) 317 318 mcasp_set_reg(mcasp, DAVINCI_MCASP_GBLCTLX_REG, 0); 318 - } 319 319 320 320 mcasp_set_reg(mcasp, DAVINCI_MCASP_GBLCTLR_REG, 0); 321 321 mcasp_set_reg(mcasp, DAVINCI_MCASP_RXSTAT_REG, 0xFFFFFFFF); ··· 341 341 */ 342 342 if (mcasp_is_frame_producer(mcasp) && mcasp_is_synchronous(mcasp) && mcasp->streams) 343 343 val = TXHCLKRST | TXCLKRST | TXFSRST; 344 - else 344 + if (!mcasp->streams) 345 345 mcasp_set_clk_pdir(mcasp, false); 346 346 347 347