From: "Péter Ujfalusi" <peter.ujfalusi@gmail.com>
To: Sen Wang <sen@ti.com>,
broonie@kernel.org, lgirdwood@gmail.com, perex@perex.cz,
tiwai@suse.com, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org
Cc: linux-sound@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/4] ASoC: ti: davinci-mcasp: Streamline pdir behavior across rx & tx streams
Date: Mon, 2 Feb 2026 18:49:40 +0200 [thread overview]
Message-ID: <ffcbbe3b-3a1b-4986-8b4c-b0f7e309ccbb@gmail.com> (raw)
In-Reply-To: <20260130051045.1898892-4-sen@ti.com>
On 30/01/2026 07:10, Sen Wang wrote:
> 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>
> ---
> sound/soc/ti/davinci-mcasp.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c
> index aa14fc1c8011..4f8a2ce6ce78 100644
> --- a/sound/soc/ti/davinci-mcasp.c
> +++ b/sound/soc/ti/davinci-mcasp.c
> @@ -235,8 +235,8 @@ static void mcasp_start_rx(struct davinci_mcasp *mcasp)
> if (mcasp_is_frame_producer(mcasp) && mcasp_is_synchronous(mcasp)) {
> mcasp_set_ctl_reg(mcasp, DAVINCI_MCASP_GBLCTLX_REG, TXHCLKRST);
> mcasp_set_ctl_reg(mcasp, DAVINCI_MCASP_GBLCTLX_REG, TXCLKRST);
> - mcasp_set_clk_pdir(mcasp, true);
> }
> + mcasp_set_clk_pdir(mcasp, true);
>
> /* Activate serializer(s) */
> mcasp_set_reg(mcasp, DAVINCI_MCASP_RXSTAT_REG, 0xFFFFFFFF);
> @@ -311,10 +311,10 @@ static void mcasp_stop_rx(struct davinci_mcasp *mcasp)
> * In synchronous mode stop the TX clocks if no other stream is
> * running
> */
> - if (mcasp_is_frame_producer(mcasp) && mcasp_is_synchronous(mcasp) && !mcasp->streams) {
> - mcasp_set_clk_pdir(mcasp, false);
> + if (mcasp_is_frame_producer(mcasp) && mcasp_is_synchronous(mcasp) && !mcasp->streams)
> mcasp_set_reg(mcasp, DAVINCI_MCASP_GBLCTLX_REG, 0);
> - }
> + if (!mcasp->streams)
> + mcasp_set_clk_pdir(mcasp, false);
I'm not sure about this, but the sequence should be preserved, PDIR
change first.
>
> mcasp_set_reg(mcasp, DAVINCI_MCASP_GBLCTLR_REG, 0);
> mcasp_set_reg(mcasp, DAVINCI_MCASP_RXSTAT_REG, 0xFFFFFFFF);
> @@ -340,7 +340,7 @@ static void mcasp_stop_tx(struct davinci_mcasp *mcasp)
> */
> if (mcasp_is_frame_producer(mcasp) && mcasp_is_synchronous(mcasp) && mcasp->streams)
> val = TXHCLKRST | TXCLKRST | TXFSRST;
> - else
> + if (!mcasp->streams)
> mcasp_set_clk_pdir(mcasp, false);
>
>
--
Péter
next prev parent reply other threads:[~2026-02-02 16:48 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-30 5:10 [PATCH 0/4] ASoC: ti: davinci-mcasp: Add asynchronous mode support for McASP Sen Wang
2026-01-30 5:10 ` [PATCH 1/4] dt-bindings: sound: davinci-mcasp: Add optional properties for asynchronous mode Sen Wang
2026-02-02 12:44 ` Mark Brown
2026-02-02 20:18 ` Sen Wang
2026-01-30 5:10 ` [PATCH 2/4] ASoC: ti: davinci-mcasp: Disambiguate mcasp_is_synchronous function Sen Wang
2026-02-02 16:42 ` Péter Ujfalusi
2026-01-30 5:10 ` [PATCH 3/4] ASoC: ti: davinci-mcasp: Streamline pdir behavior across rx & tx streams Sen Wang
2026-02-02 16:49 ` Péter Ujfalusi [this message]
2026-02-02 21:22 ` Sen Wang
2026-01-30 5:10 ` [PATCH 4/4] ASoC: ti: davinci-mcasp: Add asynchronous mode support Sen Wang
2026-02-02 17:02 ` Péter Ujfalusi
2026-02-02 21:47 ` Sen Wang
2026-02-05 11:04 ` [PATCH 0/4] ASoC: ti: davinci-mcasp: Add asynchronous mode support for McASP Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ffcbbe3b-3a1b-4986-8b4c-b0f7e309ccbb@gmail.com \
--to=peter.ujfalusi@gmail.com \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=robh@kernel.org \
--cc=sen@ti.com \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox