Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp4047969rdg; Wed, 18 Oct 2023 13:22:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHtZF4iDCE2nXUvNCxYWvRHiyX0bamS/3RpNyt0cIGF7dR5m+3wjFv3QuGJ5z4JxREyH9Jb X-Received: by 2002:a17:903:1103:b0:1c3:ed30:ce04 with SMTP id n3-20020a170903110300b001c3ed30ce04mr526601plh.25.1697660529620; Wed, 18 Oct 2023 13:22:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697660529; cv=none; d=google.com; s=arc-20160816; b=oUYSOGMhBE3Nd7JkJOLPHOGywn5nhExRpAVZsZtdc9j05oVlUBkJNJKyo7fVIspAL3 gGMWUR1Zc7FGB28TZG+qTQncD6+g92zCGaKkYB8V3oUQygPzDX/0eqEC46yV557q0y/Y jI57R/dVHClEj9PFyILx4/ZUSaYep+o21d43fbLPLxADkJRe99ksD9BOn0VOiU64FaKM gEAxoFiVNEMS8AKw7GbZ+RzTTc6pDb1geGT85f+PiG5zAiWy13FSei6j8vsvdDT7a0vp /zc9/NvD3BUIVYFpxneS7D9jk54QCrvNDf0nNW3TnygJ56FJid37/C+p+XSjVvOFkjnc dPmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=MZK6pqj1ss77uI7PA+Fgrt/RZmQ8X/QTlxXNZEv5AKo=; fh=9+IEscr4WmNbE41gibPc+AZ0nx0+/tccCXbA5gmgnS8=; b=LZCBEuBttkcEs2Ey3P4t9Z3C6vnrwtIXmYQNjGMKfUb5yzMYvrgF7Ar9YXuVym+C3v 0dIXoJHr8Zup6pO2tpPcNrNuVZp954PGNN4HezXmvIbYefcFq04AoIhzBGHz8S/L/mjR 191HX+o/g5l0xLgyQ2S4VQ2LWSDVXI+lBKJe2w4rKUVqloiv/CHUkyFwOKZuWPXnp9gs 9nU/7lpG2LUICuObrdcNPVq37Gzql1UozG5daKG09/5JqgUwzvHSHyfcgvpVLI8AO9xc G10MvAB26vU+tacEmZU1+NhvWdafec9hT0qomTfrf8OkUL++a3myaTnA7EU4DRqUqgK0 /Ycw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="bhhDb/aH"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id ju21-20020a170903429500b001ca1bd194b4si590341plb.416.2023.10.18.13.22.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 13:22:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="bhhDb/aH"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 73AD081CC867; Wed, 18 Oct 2023 13:22:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231283AbjJRUWG (ORCPT + 99 others); Wed, 18 Oct 2023 16:22:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229726AbjJRUWE (ORCPT ); Wed, 18 Oct 2023 16:22:04 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34A62A4; Wed, 18 Oct 2023 13:22:03 -0700 (PDT) Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39IILcRX025958; Wed, 18 Oct 2023 20:21:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=MZK6pqj1ss77uI7PA+Fgrt/RZmQ8X/QTlxXNZEv5AKo=; b=bhhDb/aHD/FKRfI30ps4x9K/6Qf4QmWlDHPdYifAxLKyP9W1rEGEru+aEPWg333pITU5 YXWL3KDM4XQ5PDAkmHT4jv8UA1Tnqz766i1JZizJbePOCgTaUZ0To34E2ioqZDqTcDsL l+j2Yu+zlFpTuLwz5xHG/CDp5qWs0GCT3XTwTkS7i5Bvs0u/lNkBlfwTThxt8N48lyMs Oi1q+4gsVSfPFyoplc0xhK52S3ZeS4JrwlRJu1T5HD4qo2vjZk4tUVxdr19+7sncbGog xpp13+EuCDftUoXCDt3TgZy/h+pJXeyTTLuHxjj+t5yDo3xKk9aD4rxOlSf5+bjXTVtm Mw== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3ttg82s0kc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Oct 2023 20:21:46 +0000 Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 39IKLjTq000644 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Oct 2023 20:21:45 GMT Received: from [10.110.123.255] (10.80.80.8) 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.1118.39; Wed, 18 Oct 2023 13:21:44 -0700 Message-ID: <7184bb42-4159-8e99-3ab6-56c115873078@quicinc.com> Date: Wed, 18 Oct 2023 13:21:43 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v9 20/34] ALSA: usb-audio: Check for support for requested audio format Content-Language: en-US To: Pierre-Louis Bossart , , , , , , , , , , , , , , , CC: , , , , References: <20231017200109.11407-1-quic_wcheng@quicinc.com> <20231017200109.11407-21-quic_wcheng@quicinc.com> From: Wesley Cheng In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) 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: fFipZuSxrJahsBe5JduYXO9dpd0JE-n_ X-Proofpoint-ORIG-GUID: fFipZuSxrJahsBe5JduYXO9dpd0JE-n_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-18_18,2023-10-18_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 mlxlogscore=999 spamscore=0 priorityscore=1501 adultscore=0 bulkscore=0 mlxscore=0 suspectscore=0 lowpriorityscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310180167 X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,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: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 18 Oct 2023 13:22:08 -0700 (PDT) Hi Pierre, On 10/17/2023 3:29 PM, Pierre-Louis Bossart wrote: > > > On 10/17/23 15:00, Wesley Cheng wrote: >> Allow for checks on a specific USB audio device to see if a requested PCM >> format is supported. This is needed for support for when playback is > > This is needed for support when playback is > Will fix this typo >> initiated by the ASoC USB backend path. >> >> Signed-off-by: Wesley Cheng >> --- >> sound/usb/card.c | 40 ++++++++++++++++++++++++++++++++++++++++ >> sound/usb/card.h | 11 +++++++++++ >> 2 files changed, 51 insertions(+) >> >> diff --git a/sound/usb/card.c b/sound/usb/card.c >> index c0b312e264bf..88f431917c15 100644 >> --- a/sound/usb/card.c >> +++ b/sound/usb/card.c >> @@ -162,6 +162,46 @@ int snd_usb_unregister_platform_ops(void) >> } >> EXPORT_SYMBOL_GPL(snd_usb_unregister_platform_ops); >> >> +/* >> + * Checks to see if requested audio profile, i.e sample rate, # of >> + * channels, etc... is supported by the substream associated to the >> + * USB audio device. >> + */ >> +struct snd_usb_stream *snd_usb_find_suppported_substream(int card_idx, >> + struct snd_pcm_hw_params *params, int direction) >> +{ >> + struct snd_usb_audio *chip; >> + struct snd_usb_substream *subs = NULL; > > useless init? > Agreed. Thanks Wesley Cheng