[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ce46c729-48de-4b71-ace3-9b88f95e8e28@linux.intel.com>
Date: Tue, 28 Nov 2023 11:39:57 -0600
From: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
Andy Gross <agross@...nel.org>,
Bjorn Andersson <andersson@...nel.org>,
Konrad Dybcio <konrad.dybcio@...aro.org>,
Vinod Koul <vkoul@...nel.org>,
Bard Liao <yung-chuan.liao@...ux.intel.com>,
Sanyog Kale <sanyog.r.kale@...el.com>,
Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
Banajit Goswami <bgoswami@...cinc.com>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>, linux-arm-msm@...r.kernel.org,
alsa-devel@...a-project.org, linux-kernel@...r.kernel.org,
linux-sound@...r.kernel.org
Subject: Re: [PATCH 1/2] ASoC: qcom: Add helper for allocating Soundwire
stream runtime
> +int qcom_snd_sdw_startup(struct snd_pcm_substream *substream)
> +{
> + struct snd_soc_pcm_runtime *rtd = substream->private_data;
> + struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
> + struct sdw_stream_runtime *sruntime;
> + struct snd_soc_dai *codec_dai;
> + int ret, i;
> +
> + sruntime = sdw_alloc_stream(cpu_dai->name);
> + if (!sruntime)
> + return -ENOMEM;
> +
> + for_each_rtd_codec_dais(rtd, i, codec_dai) {
> + ret = snd_soc_dai_set_stream(codec_dai, sruntime,
> + substream->stream);
> + if (ret < 0 && ret != -ENOTSUPP) {
I know this is existing code moved into a helper, but out of curiosity
why is -ENOTSUPP ignored? Isn't this problematic?
> + dev_err(rtd->dev, "Failed to set sdw stream on %s\n",
> + codec_dai->name);
> + goto err_set_stream;
> + }
> + }
Also should the CPU DAIs also be used to set the stream information?
it's not clear to me why only the CODEC DAIs are used.
> + return 0;
> +
> +err_set_stream:
> + sdw_release_stream(sruntime);
> +
> + return ret;
> +}
Powered by blists - more mailing lists