lkml.org 
[lkml]   [2023]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[RFC PATCH v2 19/22] sound: soc: qcom: qusb6: Ensure PCM format is supported by USB audio device
    Date
    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@quicinc.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 afbff66108bc..0d3693c967ac 100644
    --- a/sound/soc/qcom/qdsp6/q6usb.c
    +++ b/sound/soc/qcom/qdsp6/q6usb.c
    @@ -42,7 +42,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 = {
    .hw_params = q6usb_hw_params,
    \
     
     \ /
      Last update: 2023-03-26 23:56    [W:7.205 / U:0.060 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site