[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231017200109.11407-23-quic_wcheng@quicinc.com>
Date: Tue, 17 Oct 2023 13:00:57 -0700
From: Wesley Cheng <quic_wcheng@...cinc.com>
To: <mathias.nyman@...el.com>, <gregkh@...uxfoundation.org>,
<lgirdwood@...il.com>, <broonie@...nel.org>, <perex@...ex.cz>,
<tiwai@...e.com>, <agross@...nel.org>, <andersson@...nel.org>,
<konrad.dybcio@...aro.org>, <robh+dt@...nel.org>,
<krzysztof.kozlowski+dt@...aro.org>, <conor+dt@...nel.org>,
<srinivas.kandagatla@...aro.org>, <bgoswami@...cinc.com>,
<Thinh.Nguyen@...opsys.com>
CC: <linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<alsa-devel@...a-project.org>, <linux-arm-msm@...r.kernel.org>,
<devicetree@...r.kernel.org>,
Wesley Cheng <quic_wcheng@...cinc.com>
Subject: [PATCH v9 22/34] ASoC: qcom: qdsp6: Ensure PCM format is supported by USB audio device
Check for if the PCM format is supported during the hw_params callback. If
the profile is not supported then the userspace ALSA entity will receive an
error, and can take further action.
Signed-off-by: Wesley Cheng <quic_wcheng@...cinc.com>
---
sound/soc/qcom/qdsp6/q6usb.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sound/soc/qcom/qdsp6/q6usb.c b/sound/soc/qcom/qdsp6/q6usb.c
index dd664ad41668..329a7d4a3c01 100644
--- a/sound/soc/qcom/qdsp6/q6usb.c
+++ b/sound/soc/qcom/qdsp6/q6usb.c
@@ -44,7 +44,10 @@ static int q6usb_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{
- return 0;
+ struct q6usb_port_data *data = dev_get_drvdata(dai->dev);
+ int direction = substream->stream;
+
+ return snd_soc_usb_find_format(data->active_idx, params, direction);
}
static const struct snd_soc_dai_ops q6usb_ops = {
Powered by blists - more mailing lists