mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: neil.armstrong@linaro.org
To: Danila Tikhonov <danila@jiaxyga.com>,
	srinivas.kandagatla@linaro.org, lgirdwood@gmail.com,
	broonie@kernel.org, perex@perex.cz, tiwai@suse.com
Cc: linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux@mainlining.org,
	~postmarketos/upstreaming@lists.sr.ht
Subject: Re: [PATCH] ASoC: qcom: sc8280xp: enable primary mi2s
Date: Mon, 3 Feb 2025 15:23:13 +0100	[thread overview]
Message-ID: <df4580ff-7b45-4485-9664-4cae731b7c53@linaro.org> (raw)
In-Reply-To: <20250203113857.34728-1-danila@jiaxyga.com>

On 03/02/2025 12:38, Danila Tikhonov wrote:
> When using primary mi2s on sc8280xp-compatible SoCs, the correct clock
> needs to get enabled to be able to use the mi2s interface.
> 
> Signed-off-by: Danila Tikhonov <danila@jiaxyga.com>
> ---
>   sound/soc/qcom/sc8280xp.c | 13 +++++++++++++
>   1 file changed, 13 insertions(+)
> 
> diff --git a/sound/soc/qcom/sc8280xp.c b/sound/soc/qcom/sc8280xp.c
> index 311377317176..03687de1ebb0 100644
> --- a/sound/soc/qcom/sc8280xp.c
> +++ b/sound/soc/qcom/sc8280xp.c
> @@ -14,6 +14,8 @@
>   #include "common.h"
>   #include "sdw.h"
>   
> +#define MI2S_BCLK_RATE	1536000
> +
>   struct sc8280xp_snd_data {
>   	bool stream_prepared[AFE_PORT_MAX];
>   	struct snd_soc_card *card;
> @@ -25,13 +27,24 @@ struct sc8280xp_snd_data {
>   
>   static int sc8280xp_snd_init(struct snd_soc_pcm_runtime *rtd)
>   {
> +	unsigned int codec_dai_fmt = SND_SOC_DAIFMT_BC_FC;
> +	unsigned int fmt = SND_SOC_DAIFMT_BP_FP;
>   	struct sc8280xp_snd_data *data = snd_soc_card_get_drvdata(rtd->card);
> +	struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
>   	struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
>   	struct snd_soc_card *card = rtd->card;
>   	struct snd_soc_jack *dp_jack  = NULL;
>   	int dp_pcm_id = 0;
>   
>   	switch (cpu_dai->id) {
> +	case PRIMARY_MI2S_RX:
> +		codec_dai_fmt |= SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_I2S;
> +		snd_soc_dai_set_sysclk(cpu_dai,
> +			Q6AFE_LPASS_CLK_ID_PRI_MI2S_IBIT,
> +			MI2S_BCLK_RATE, SNDRV_PCM_STREAM_PLAYBACK);

How is this possible ? sc8280xp uses the q6prm clock driver, and there's no
way this call sets the Q6PRM_LPASS_CLK_ID_PRI_MI2S_IBIT, or I totally missed
something.

And prm is neither a dai nor has the set_sysclk callback.

Neil

> +		snd_soc_dai_set_fmt(cpu_dai, fmt);
> +		snd_soc_dai_set_fmt(codec_dai, codec_dai_fmt);
> +		break;
>   	case WSA_CODEC_DMA_RX_0:
>   	case WSA_CODEC_DMA_RX_1:
>   		/*


  reply	other threads:[~2025-02-03 14:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-03 11:38 Danila Tikhonov
2025-02-03 14:23 ` neil.armstrong [this message]
2025-02-03 16:33   ` Danila Tikhonov
2025-02-03 23:27     ` Luca Weiss
2025-02-04  8:19       ` neil.armstrong
2025-02-04 10:04         ` Luca Weiss
2025-02-04 10:08           ` neil.armstrong
2025-02-04 10:09             ` Luca Weiss
2025-04-18 13:19               ` Luca Weiss

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=df4580ff-7b45-4485-9664-4cae731b7c53@linaro.org \
    --to=neil.armstrong@linaro.org \
    --cc=broonie@kernel.org \
    --cc=danila@jiaxyga.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=linux@mainlining.org \
    --cc=perex@perex.cz \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=tiwai@suse.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®