Message ID | 20221223233200.26089-12-quic_wcheng@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6000:1b02:0:0:0:0 with SMTP id f2csp32710wrz; Fri, 23 Dec 2022 15:36:12 -0800 (PST) X-Google-Smtp-Source: AMrXdXtJw35cVM9ztfnMvoa/gfRGGEXQnczRjnbYHTSR75P0X/2QRYMJDGTs1LsOAzrvsZuckHog X-Received: by 2002:a17:907:c516:b0:7c1:e78:11ed with SMTP id tq22-20020a170907c51600b007c10e7811edmr9743522ejc.0.1671838572037; Fri, 23 Dec 2022 15:36:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671838572; cv=none; d=google.com; s=arc-20160816; b=0s6d6fzvCDUqv9ZdyneZqyYJkyE6CCMueBKto1dFdG+K5gJQ7GcihH10EYrhQCMZOK REG/x4F9jN1S/iadly3FRAuQB3J5H2PRjf6YwbnBWtovbXf1Z5HpbBeYhj6MGvAkkY4M Eu+5/hEKF8J/ZKCaOoRJpaIZGSdipPP1DuPg0UE8LcTClyvjVuM/CDxUUlB8hLZ5Lpd6 W+CtaGzxW9PND5yJKEh2R89m9khSRny7y0AvzyMPZYk4TSrXFYsg382zeOTDzYl+UEHj +V8C2NtY5096/cYMhFp1RWdD3iT1/4S6BPpg7mAWcUaeresbi9qa2CbAY/PWUoe4O1Zp l39g== 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=MbzKRBWZtSM2mW1OG2asvJd3zGd4KYoy90tUAmpa/ks=; b=cH02ytImKjolmkk9nvQL7u/eDJ6CdzizIL+PBvSoXa7eaUrpr1VCkW8R1Jh6ffgZK5 mjlOJwHBqnhFzRKINLzg0dkfhmOQRPAp4z2ftY1ANAZfqfwyqU4doY26Wv8q9759xSgm Sscw9rtRKx4x8R4VZaLOVtN+pwMOkgrJaeYrogQLEjwUtw5XEJl7GVkUorb2gJEjqfFt 2Lm2upsDnGrzyW2Un7UH4deaWp8TyeZMakKMpRdzVsXXGs0IFsG8KyXq58Dgs0Snt2oG iukxtBHqiX+OhQAdQQoRsrcw3Dm+EA7QLHNpbrKZ0u76icH9UOJWWeruhjXtHgg6kn4x GdWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=NhpykZ1S; 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 qb25-20020a1709077e9900b0084bbd97edc4si237242ejc.573.2022.12.23.15.35.48; Fri, 23 Dec 2022 15:36:12 -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=NhpykZ1S; 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 S236215AbiLWXeI (ORCPT <rfc822;pacteraone@gmail.com> + 99 others); Fri, 23 Dec 2022 18:34:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232389AbiLWXdP (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 23 Dec 2022 18:33:15 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6947A1146A; Fri, 23 Dec 2022 15:33:14 -0800 (PST) Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BNNT2pb013829; Fri, 23 Dec 2022 23:32:48 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=MbzKRBWZtSM2mW1OG2asvJd3zGd4KYoy90tUAmpa/ks=; b=NhpykZ1SCgZYP+fhRTc+331q9uM04f0Bwr9W1wGVojyVz5EBiOgbl2xJwu84lwXbrrKG 1LzAJa9Y0WfNlsD4SezU5aCeJGcej6L/obItuYvXbo4ldmrdbGm8eXU0GswNnlrYVGtt Ljg0xbeqDsTsKps4vy/61jhQPIuG9Oo2mo9MLeTBVMe6oMBYE6JRk3D3nBODGNPnGblT cHepr4veDs+MUWKdfyita8p62La+xYRK3lmhewrw0qs3o1uyecgqasS0fnao3C8O2vvV N3ANREgA9F5DBPCc99TCIGcwxRHlcq6+2sJf/aWReDmmdxpcUO7s0Em7A6k5TflEGXlD nQ== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3mncd0gy4d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 Dec 2022 23:32:47 +0000 Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 2BNNWlqN016918 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 Dec 2022 23:32:47 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.36; Fri, 23 Dec 2022 15:32:46 -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>, <andersson@kernel.org>, <krzysztof.kozlowski+dt@linaro.org>, <gregkh@linuxfoundation.org>, <Thinh.Nguyen@synopsys.com>, <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 11/14] sound: soc: soc-usb: Add PCM format check API for USB backend Date: Fri, 23 Dec 2022 15:31:57 -0800 Message-ID: <20221223233200.26089-12-quic_wcheng@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221223233200.26089-1-quic_wcheng@quicinc.com> References: <20221223233200.26089-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: 25O5TuV6qVUDlTonNbfXm45G_5ar5RkL X-Proofpoint-ORIG-GUID: 25O5TuV6qVUDlTonNbfXm45G_5ar5RkL X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-23_08,2022-12-23_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 impostorscore=0 suspectscore=0 adultscore=0 priorityscore=1501 lowpriorityscore=0 clxscore=1015 mlxscore=0 malwarescore=0 mlxlogscore=999 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212230197 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?1753049801991169181?= X-GMAIL-MSGID: =?utf-8?q?1753049801991169181?= |
Series |
Introduce QC USB SND audio offloading support
|
|
Commit Message
Wesley Cheng
Dec. 23, 2022, 11:31 p.m. UTC
Introduce a check for if a particular PCM format is supported by the USB
audio device connected. If the USB audio device does not have an audio
profile which can support the requested format, then notify the USB
backend.
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
---
include/sound/soc-usb.h | 3 +++
sound/soc/soc-usb.c | 13 +++++++++++++
2 files changed, 16 insertions(+)
diff --git a/include/sound/soc-usb.h b/include/sound/soc-usb.h index 7d52e5d2371c..36df6f4fe093 100644 --- a/include/sound/soc-usb.h +++ b/include/sound/soc-usb.h @@ -19,6 +19,9 @@ struct snd_soc_usb { void *priv_data; }; +int snd_soc_usb_find_format(int card_idx, struct snd_pcm_hw_params *params, + int direction); + int snd_soc_usb_connect(int card_idx); int snd_soc_usb_disconnect(void); void snd_soc_usb_set_priv_data(void *priv); diff --git a/sound/soc/soc-usb.c b/sound/soc/soc-usb.c index c6c376960e4d..021380a022bc 100644 --- a/sound/soc/soc-usb.c +++ b/sound/soc/soc-usb.c @@ -25,6 +25,19 @@ void snd_soc_usb_set_priv_data(void *priv) } EXPORT_SYMBOL_GPL(snd_soc_usb_set_priv_data); +int snd_soc_usb_find_format(int card_idx, struct snd_pcm_hw_params *params, + int direction) +{ + struct snd_usb_stream *as; + + as = snd_usb_find_suppported_substream(card_idx, params, direction); + if (!as) + return -EOPNOTSUPP; + + return 0; +} +EXPORT_SYMBOL_GPL(snd_soc_usb_find_format); + struct snd_soc_usb *snd_soc_usb_add_port(struct device *dev, int (*connection_cb)(struct snd_soc_usb *usb, int card_idx, int connected))