mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com>
To: Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com>,
	Srinivas Kandagatla <srini@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>
Cc: linux-arm-msm@vger.kernel.org, linux-sound@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
	Mohammad Rafi Shaik <mohammad.rafi.shaik@oss.qualcomm.com>
Subject: Re: [PATCH v2 2/5] ASoC: qcom: sc8280xp: Extend hw_params for QAIF backends
Date: Wed, 28 Oct 2026 18:15:04 +0530	[thread overview]
Message-ID: <dd81646e-a30b-46a9-84a1-bc39d71ec748@oss.qualcomm.com> (raw)
In-Reply-To: <20260910-shikra-machine-v2-v2-2-9bf6bad589d8@oss.qualcomm.com>

> diff --git a/sound/soc/qcom/sc8280xp.c b/sound/soc/qcom/sc8280xp.c
> index 4d48e1012cd4..452296a9e67d 100644
> --- a/sound/soc/qcom/sc8280xp.c
> +++ b/sound/soc/qcom/sc8280xp.c
> @@ -67,6 +67,7 @@ struct qcom_snd_soc_common {
>   	const struct snd_kcontrol_new *controls;
>   	int num_controls;
>   	unsigned int codec_dai_fmt;
> +	unsigned int cpu_dai_fmt;
>   	bool codec_sysclk_set;
>   	bool mi2s_mclk_enable;
>   	bool mi2s_bclk_enable;
> @@ -126,9 +127,15 @@ static int sc8280xp_tdm_hw_params(struct snd_pcm_substream *substream,
>   	if (!cpu_cfg.slots)
>   		return 0;
>   
> -	ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_BP_FP);
> -	if (ret && ret != -ENOTSUPP)
> -		return ret;
> +	if (data->priv->cpu_dai_fmt) {

Could this be simplified by selecting the format first and keeping a single call and error path?
Same in sc8280xp_snd_hw_params().

fmt = data->priv->cpu_dai_fmt ?: SND_SOC_DAIFMT_BP_FP;
ret = snd_soc_dai_set_fmt(cpu_dai, fmt);
	if (ret && ret != -ENOTSUPP)
		return ret;

> +		ret = snd_soc_dai_set_fmt(cpu_dai, data->priv->cpu_dai_fmt);
> +		if (ret && ret != -ENOTSUPP)
> +			return ret;
> +	} else {
> +		ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_BP_FP);
> +		if (ret && ret != -ENOTSUPP)
> +			return ret;
> +	}
>   
>   	if (data->priv->codec_dai_fmt) {
>   		for_each_rtd_codec_dais(rtd, i, codec_dai) {
> @@ -234,6 +241,7 @@ static int sc8280xp_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
>   	case TX_CODEC_DMA_TX_1:
>   	case TX_CODEC_DMA_TX_2:
>   	case TX_CODEC_DMA_TX_3:
> +	case VA_CODEC_DMA_TX_1:
>   		channels->min = 1;
>   		break;
>   	default:
> @@ -260,9 +268,16 @@ static int sc8280xp_snd_hw_params(struct snd_pcm_substream *substream,
>   	case QUINARY_MI2S_RX ... QUINARY_MI2S_TX:
>   	case SENARY_MI2S_RX ... SENARY_MI2S_TX:
>   	case LPI_MI2S_RX_0 ... LPI_MI2S_TX_4:
> -		ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_BP_FP);
> -		if (ret && ret != -ENOTSUPP)
> -			return ret;
> +	case AIF_MI2S_RX_0 ... AIF_MI2S_TX_12:
> +		if (data->priv->cpu_dai_fmt) {
> +			ret = snd_soc_dai_set_fmt(cpu_dai, data->priv->cpu_dai_fmt);
> +			if (ret && ret != -ENOTSUPP)
> +				return ret;
> +		} else {
> +			ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_BP_FP);
> +			if (ret && ret != -ENOTSUPP)
> +				return ret;
> +		}
>   
>   		if (data->priv->codec_dai_fmt) {
>   			ret = snd_soc_dai_set_fmt(codec_dai,
> @@ -296,6 +311,7 @@ static int sc8280xp_snd_hw_params(struct snd_pcm_substream *substream,
>   		}
>   		break;
>   	case PRIMARY_TDM_RX_0 ... QUINARY_TDM_TX_7:
> +	case AIF_TDM_RX_0 ... AIF_TDM_TX_12:
>   		return sc8280xp_tdm_hw_params(substream, params);
>   	default:
>   		break;
> @@ -382,7 +398,7 @@ static void sc8280xp_add_be_ops(struct snd_soc_card *card)
>   	int i;
>   
>   	for_each_card_prelinks(card, i, link) {
> -		if (link->no_pcm == 1) {
> +		if (link->no_pcm == 1 || link->num_codecs > 0) {

Can num_codecs > 0 also match DPCM frontends using the dummy codec?
If so, would this unintentionally apply the BE ops/fixup to existing frontend links?

Thanks,
Prasad


  reply	other threads:[~2026-10-28 12:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-10 15:02 [PATCH v2 0/5] ASoC: qcom: Shikra machine driver and DT binding support Ajay Kumar Nandam
2026-09-10 15:02 ` [PATCH v2 1/5] ASoC: dt-bindings: qcom,sm8250: add Shikra sound card compatibles Ajay Kumar Nandam
2026-10-28 12:51   ` Prasad Kumpatla
2026-09-10 15:02 ` [PATCH v2 2/5] ASoC: qcom: sc8280xp: Extend hw_params for QAIF backends Ajay Kumar Nandam
2026-10-28 12:45   ` Prasad Kumpatla [this message]
2026-09-10 15:02 ` [PATCH v2 3/5] ASoC: qcom: sc8280xp: Add shikra-cqm-evk compatible support Ajay Kumar Nandam
2026-10-28 12:47   ` Prasad Kumpatla
2026-09-10 15:02 ` [PATCH v2 4/5] ASoC: qcom: sc8280xp: Add shikra-cqs-evk " Ajay Kumar Nandam
2026-10-28 12:57   ` Prasad Kumpatla
2026-09-10 15:02 ` [PATCH v2 5/5] ASoC: qcom: sc8280xp: Add shikra-iqs-evk " Ajay Kumar Nandam
2026-10-28 12:49   ` Prasad Kumpatla

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=dd81646e-a30b-46a9-84a1-bc39d71ec748@oss.qualcomm.com \
    --to=prasad.kumpatla@oss.qualcomm.com \
    --cc=ajay.nandam@oss.qualcomm.com \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=krzk+dt@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=mohammad.rafi.shaik@oss.qualcomm.com \
    --cc=perex@perex.cz \
    --cc=robh@kernel.org \
    --cc=srini@kernel.org \
    --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

all inboxes | Powered by JetHome®