[RFC,v2,19/22] sound: soc: qcom: qusb6: Ensure PCM format is supported by USB audio device
Message ID | 20230126031424.14582-20-quic_wcheng@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp69261wrn; Wed, 25 Jan 2023 19:16:02 -0800 (PST) X-Google-Smtp-Source: AMrXdXvq3qUmLOSKaNqCw3ZRVtKdddDfj3+S8EgLRfnWapN3KpVqnT7b93FQWZqPJhXlAnd3g2pb X-Received: by 2002:a05:6a20:45b:b0:b9:5fc4:6e3b with SMTP id b27-20020a056a20045b00b000b95fc46e3bmr22475987pzb.34.1674702962687; Wed, 25 Jan 2023 19:16:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674702962; cv=none; d=google.com; s=arc-20160816; b=EnEyCRqRo67Z4jljQqvAVOMh2e177KHQc8bRYayKMGrVAjcr/D61ptNrbZjg2jnOxC LTh7v7LeugAuC61UMp3wyR4YOqFYDey4WmBh3LW86ptk7inNPY7DL6RUxF7SnD+PqHy6 DBQVph6LcwSXtRiaH7wuM7xGkMc6F/wO4yl2bheEgzyfc/wmD+K8fV1z/RHCcVcPIPDX TJEHwsIA1VvzZLNdsz54ne9JDArVfj1BxtzVHIpWDWpMzSLqD0rSvz9TSbirFIdt4PQc oiMD3SGS/WEJuFCNHLB19D+8okvYOQE0JQA0g320zAyi3xgM89UKg+srA0+FKeVMMZ4d 1aXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=1txMaotSHPsWFowBJzGiwKSG1+X0+lF7DacLGIuLInw=; b=RbUC3wsnhg+MGc5dK4wx+HuTtniuyrEoflPyxob1qC5mDvZ2VV6CiFTNmiZuY993rb 0uMllbkJDjskq3kMBekb7HORaFUaNv8wwGBwmlFvHDNgsP5qnpNHzO3CV7lR5ZPZN5Yp pnsHw7zMo4Vr1x/jeuHHJLVDvWSCvxGI2uvPXPxg/qNYQgNOfNlkmuLBIw0ehaV8a2sS P6nfgMzafrLvMcwieoi8s+GrmnUA01uethWCQREa8vclGt3K7y74v3rc1/xPOFRRsr0H LJ9hh3/QWa74u9QMwpF8dltnQDbiiKwiikHHH9o2kQiM2GxCF8TjzI7QQ6nIsKRGKbzA UjWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=E9ULC8nn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x16-20020a170902b41000b0019441960a48si298830plr.236.2023.01.25.19.15.50; Wed, 25 Jan 2023 19:16:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=E9ULC8nn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236223AbjAZDPK (ORCPT <rfc822;lekhanya01809@gmail.com> + 99 others); Wed, 25 Jan 2023 22:15:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236127AbjAZDOv (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 25 Jan 2023 22:14:51 -0500 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B992C65F02; Wed, 25 Jan 2023 19:14:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1674702889; x=1706238889; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=1txMaotSHPsWFowBJzGiwKSG1+X0+lF7DacLGIuLInw=; b=E9ULC8nn52pZyjtxobWzWw+vcC2MeLL+lRTwvjFJI0+jHTO9hyko6VWx KOOthXXlpXJDZ3IveJ0yMI3C/YMgqcBkjhXVYNiGwiiS9KWQRaJJPgqSH 6rgp5+QRy/9/0MVaDOmWJD5Ggr5yRsTnDl5tonJjGycIPD6ws6fHJMTou 0=; Received: from unknown (HELO ironmsg04-sd.qualcomm.com) ([10.53.140.144]) by alexa-out-sd-02.qualcomm.com with ESMTP; 25 Jan 2023 19:14:49 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.45.79.139]) by ironmsg04-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2023 19:14:49 -0800 Received: from hu-wcheng-lv.qualcomm.com (10.49.16.6) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Wed, 25 Jan 2023 19:14:48 -0800 From: Wesley Cheng <quic_wcheng@quicinc.com> To: <srinivas.kandagatla@linaro.org>, <mathias.nyman@intel.com>, <perex@perex.cz>, <lgirdwood@gmail.com>, <andersson@kernel.org>, <krzysztof.kozlowski+dt@linaro.org>, <gregkh@linuxfoundation.org>, <Thinh.Nguyen@synopsys.com>, <broonie@kernel.org>, <bgoswami@quicinc.com>, <tiwai@suse.com>, <robh+dt@kernel.org>, <agross@kernel.org> CC: <linux-kernel@vger.kernel.org>, <linux-arm-msm@vger.kernel.org>, <alsa-devel@alsa-project.org>, <devicetree@vger.kernel.org>, <linux-usb@vger.kernel.org>, <quic_jackp@quicinc.com>, <quic_plai@quicinc.com>, Wesley Cheng <quic_wcheng@quicinc.com> Subject: [RFC PATCH v2 19/22] sound: soc: qcom: qusb6: Ensure PCM format is supported by USB audio device Date: Wed, 25 Jan 2023 19:14:21 -0800 Message-ID: <20230126031424.14582-20-quic_wcheng@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230126031424.14582-1-quic_wcheng@quicinc.com> References: <20230126031424.14582-1-quic_wcheng@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01c.na.qualcomm.com (10.47.97.35) To nasanex01c.na.qualcomm.com (10.45.79.139) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756053333630295550?= X-GMAIL-MSGID: =?utf-8?q?1756053333630295550?= |
Series |
Introduce QC USB SND audio offloading support
|
|
Commit Message
Wesley Cheng
Jan. 26, 2023, 3:14 a.m. UTC
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,