All of lore.kernel.org
 help / color / mirror / Atom feed
From: Val Packett <val@packett.cool>
To: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>,
	Srinivas Kandagatla <srini@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>
Cc: Bhushan Shah <bhushan.shah@machinesoul.in>,
	Luca Weiss <luca.weiss@fairphone.com>,
	Antoine Bernard <zalnir@proton.me>,
	~postmarketos/upstreaming@lists.sr.ht,
	phone-devel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 5/6] ASoC: qcom: sm8250: shut down MI2S/TDM AFE port clocks
Date: Thu, 7 May 2026 17:44:17 -0300	[thread overview]
Message-ID: <f090337e-e817-41d3-8fc6-0c64cd71fba4@packett.cool> (raw)
In-Reply-To: <dd0e22ed-e464-4d61-b354-b396f9694976@oss.qualcomm.com>


On 5/7/26 5:57 AM, Srinivas Kandagatla wrote:
> On 5/6/26 8:33 PM, Val Packett wrote:
>> These port clocks were never being turned off, leading to increased
>> power consumption after a sound was played through any of these ports
>> for the first time. Use enable counters to disable the clocks in the
>> shutdown callback, similar to how it's done for sdm845.
>>
>> Signed-off-by: Val Packett <val@packett.cool>
>> ---
>>   sound/soc/qcom/sm8250.c | 150 +++++++++++++++++++++++++++++++---------
>>   1 file changed, 119 insertions(+), 31 deletions(-)
>>
>> diff --git a/sound/soc/qcom/sm8250.c b/sound/soc/qcom/sm8250.c
>> index b64fd3970ba1..9f0f846a14bb 100644
>> --- a/sound/soc/qcom/sm8250.c
>> +++ b/sound/soc/qcom/sm8250.c
>> @@ -24,6 +24,7 @@ static unsigned int tdm_slot_offset[8] = {0, 4, 8, 12, 16, 20, 24, 28};
>>   
>>   struct sm8250_snd_data {
>>   	bool stream_prepared[AFE_PORT_MAX];
>> +	uint32_t clk_count[AFE_PORT_MAX];
> In your setup are you sharing BE dais to multiple FE?
>
> if not you would really not need the count, startup and shutdown are
> paired for single PCM stream.
>
> If yes, then you need some protection against these counters.

Hmm, possibly not? I don't entirely understand how the q6 hardware 
works, sorry.. Who's the BE in this situation?

Basically what we have is e.g.:

- a dai-link between speakers (<&aw88261_l>, <&aw88261_r>) and the 
digital interface they're connected to (<&q6afedai SENARY_MI2S_RX>) 
defined in the device tree
- one q6asmdai frontend (MultiMedia1) connected to it in the mixer, i.e. 
cset name='QUIN_MI2S_RX Audio Mixer MultiMedia1' 1
- VoiceMMode1 (currently only via an out-of-tree hacky patchset but 
someone's reworking that) also connected to it like that during voice 
calls, but we can definitely "unplug" the MultiMedia when that happens

> [..]

Thanks,
~val


  reply	other threads:[~2026-05-07 20:44 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-06 20:33 [PATCH v2 0/6] ASoC: qcom: fixes and improvements Val Packett
2026-05-06 20:33 ` [PATCH v2 1/6] ASoC: qcom: qdsp6: q6afe: fix clk vote response type mismatch Val Packett
2026-05-07  0:02   ` Mark Brown
2026-05-07  1:46     ` Val Packett
2026-05-07  2:16       ` Mark Brown
2026-05-07  8:03         ` Konrad Dybcio
2026-05-07  8:23           ` Mark Brown
2026-05-06 20:33 ` [PATCH v2 2/6] ASoC: qcom: qdsp6: q6routing: add Senary MI2S ports Val Packett
2026-05-07  8:31   ` Srinivas Kandagatla
2026-05-06 20:33 ` [PATCH v2 3/6] ASoC: qcom: sm8250: add Senary MI2S RX support Val Packett
2026-05-07  8:34   ` Srinivas Kandagatla
2026-05-06 20:33 ` [PATCH v2 4/6] ASoC: qcom: sm8250: add TDM " Val Packett
2026-05-07  8:51   ` Srinivas Kandagatla
2026-05-07 20:24     ` Val Packett
2026-05-06 20:33 ` [PATCH v2 5/6] ASoC: qcom: sm8250: shut down MI2S/TDM AFE port clocks Val Packett
2026-05-07  8:57   ` Srinivas Kandagatla
2026-05-07 20:44     ` Val Packett [this message]
2026-11-27 12:52       ` Demeter Barna
2026-05-06 20:33 ` [PATCH v2 6/6] ASoC: qcom: sm8250: apply codec_fmt to all codec DAIs Val Packett
2026-05-07  9:02   ` Srinivas Kandagatla

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=f090337e-e817-41d3-8fc6-0c64cd71fba4@packett.cool \
    --to=val@packett.cool \
    --cc=bhushan.shah@machinesoul.in \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=luca.weiss@fairphone.com \
    --cc=perex@perex.cz \
    --cc=phone-devel@vger.kernel.org \
    --cc=srini@kernel.org \
    --cc=srinivas.kandagatla@oss.qualcomm.com \
    --cc=tiwai@suse.com \
    --cc=zalnir@proton.me \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.