[v3,18/28] sound: soc: qcom: qusb6: Ensure PCM format is supported by USB audio device
Message ID | 20230308235751.495-19-quic_wcheng@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:570d:b0:a1:2e52:cf23 with SMTP id h13csp883915dyk; Wed, 8 Mar 2023 16:07:44 -0800 (PST) X-Google-Smtp-Source: AK7set/6/k9waStVLPY02CsEybamoaYr91thm/yRTxQ1Fn8486eCNgOYyXWJnUNRCgA24oOAziWU X-Received: by 2002:aa7:9486:0:b0:5e1:255b:6fc4 with SMTP id z6-20020aa79486000000b005e1255b6fc4mr20187862pfk.30.1678320463987; Wed, 08 Mar 2023 16:07:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678320463; cv=none; d=google.com; s=arc-20160816; b=VFSxykQIVrRRSuS2NdYGgu4jgqzKYrEm7BiJxjUT7GVh9SAuF6Kax1jETGWibJRAqq ZXTR1UPe3z5KXysr42AV0sfnlczQmvkV4jjZDxu7Qr7AS6T0WV6oac1Iub22SUT4mV6g wH5ukrAMLTKMnShiDwqmPwlmmd6s8c2Xyvc5H5Yjr2QzbcKYoZn7IU3uVFPgYD7hbMww RvEdCXwuNfw7Rf2baXMY7K3vHfecyVXUVLOYe7YL8/Fntnr16VJDrsUQpfB/lXT7/ztV 6PP7mJOyybjfow/RTNiFvqiDVjqQCQ/8mw6ADtCq/nseTqEzQZMEjGEZ/cpfND1f37kT ADQA== 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=u1bskS+coAPgxmcQJWRc4goiRC86w0IEWDQbyUbTVmI=; b=C5JHSDFWOKVtdUW/KPtC7NCOzjnlz03b+ao3KI+XZP3ob+We11QIfStSPOfkGX4rpm 0TTA7dNwkO5mxLZoTgam25CM9kIJDIwR4zJFmQX0N+SB2pdF1A7CRm1OudGXC6kJQM8m 9NXaOZ5r4yVIh7M0KKb+EWM9T0iy6OW23y51Z5DGFcYIHwKUJL+WeCf2JLAGmY+GlMGd 554/XVAQd+wNr62ZLXSx6O6GfwoLOvqYX2aGCZijLXsdOfHkAXUU4gLqtpF34Yafd5tH VbTgbrxwriC9gNuYgd4I0HvNhLwcSAjWBdBZmZT8LD8PVengKas9/8doBby7yW8+cDXr HmeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=B+NzATos; 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 z188-20020a6265c5000000b00593b8c172d8si14477278pfb.200.2023.03.08.16.07.28; Wed, 08 Mar 2023 16:07:43 -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=qcppdkim1 header.b=B+NzATos; 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 S229845AbjCIABp (ORCPT <rfc822;carlos.wei.hk@gmail.com> + 99 others); Wed, 8 Mar 2023 19:01:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230412AbjCIABM (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 8 Mar 2023 19:01:12 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 322C0D49FF; Wed, 8 Mar 2023 15:59:18 -0800 (PST) Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 328EMfJM024719; Wed, 8 Mar 2023 23:58:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=qcppdkim1; bh=u1bskS+coAPgxmcQJWRc4goiRC86w0IEWDQbyUbTVmI=; b=B+NzATosdTNocRSaS3X2V0JCR64eaJcgXXKZDbTMnS7Tm2ZsW3P4GDj4ylvwYAT0YtZ1 dbQqs0wdxAhzwnfe8gnyFuhMBJM9H+0gLYTsb4blQh2TIM8toTEIOZYbrvJAc+fIKpuK cftOwhh/ErLOTbOwEkKHkTztzJt3MYAvWv9zrSB4/FQ8fZ2JJsyhzyZoIwwdfYfu7XLa UmwvS6PtJ1iDh+/XcBVpio6W94s7oHLgdJjTnYKNOjqevdU0FTKv2lZPHYFajKb4qW5a AN4aSAKiV/coUjDTxRrfEtM2oueLwfHzVMNET5K4rRjFVQhP1+QzW3tZnGZhSf+kSvT/ fQ== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3p6v2dsav1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Mar 2023 23:58:11 +0000 Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 328NwAop016729 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 8 Mar 2023 23:58:10 GMT Received: from hu-wcheng-lv.qualcomm.com (10.49.16.6) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Wed, 8 Mar 2023 15:58:10 -0800 From: Wesley Cheng <quic_wcheng@quicinc.com> To: <srinivas.kandagatla@linaro.org>, <mathias.nyman@intel.com>, <perex@perex.cz>, <broonie@kernel.org>, <lgirdwood@gmail.com>, <krzysztof.kozlowski+dt@linaro.org>, <agross@kernel.org>, <Thinh.Nguyen@synopsys.com>, <bgoswami@quicinc.com>, <andersson@kernel.org>, <robh+dt@kernel.org>, <gregkh@linuxfoundation.org>, <tiwai@suse.com> 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: [PATCH v3 18/28] sound: soc: qcom: qusb6: Ensure PCM format is supported by USB audio device Date: Wed, 8 Mar 2023 15:57:41 -0800 Message-ID: <20230308235751.495-19-quic_wcheng@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230308235751.495-1-quic_wcheng@quicinc.com> References: <20230308235751.495-1-quic_wcheng@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01a.na.qualcomm.com (10.47.209.196) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: T3tHoescRBV0_QkGssLA7xuCv7FWoiHS X-Proofpoint-ORIG-GUID: T3tHoescRBV0_QkGssLA7xuCv7FWoiHS X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-08_15,2023-03-08_03,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 malwarescore=0 phishscore=0 priorityscore=1501 impostorscore=0 adultscore=0 spamscore=0 mlxscore=0 suspectscore=0 bulkscore=0 clxscore=1015 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2303080200 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,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?1759846559021803514?= X-GMAIL-MSGID: =?utf-8?q?1759846559021803514?= |
Series |
Introduce QC USB SND audio offloading support
|
|
Commit Message
Wesley Cheng
March 8, 2023, 11:57 p.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 3d480550b3f3..c9d5c9eecf89 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 = { .hw_params = q6usb_hw_params,