Message ID | 20240203023645.31105-40-quic_wcheng@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-50848-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:9bc1:b0:106:209c:c626 with SMTP id op1csp819556dyc; Fri, 2 Feb 2024 18:51:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IG3I12VNxZ9lEja4LgQ3bCQVaNkcbJLzDdXZXxgYv1VmUwKGb9ii1eXMC8ybDYBtRmeDBha X-Received: by 2002:a05:6a20:c78c:b0:19e:4ed7:127a with SMTP id hk12-20020a056a20c78c00b0019e4ed7127amr3783986pzb.46.1706928689023; Fri, 02 Feb 2024 18:51:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706928689; cv=pass; d=google.com; s=arc-20160816; b=IK3d+lhBjUCK5NFhYlTMkWrKGqJplkgYNqifo5RF5NBA9SbFtVzbjvtv9HYMB34EE5 LBsKLkHdtZ2u4xWwWFe1yp+0jUZOpUzP7lmxtFrpjLiik4ZCjn03lsuM4rrF7XA2oK6J mPKFFOegPaumvhplInO3cL9YQz975iAUdzRJ+HwhsgC0GXRe/3mM1qyF5xgKwzoG8MLs 28k7aHVnecFPCnFHNtwZcGL+ErBp6sD73QHTpQu+PdO5dTi5MWsueRnerXhEAXMZZ9LP Zd35KlPqW5kS3vPVOO3iUXLnXk4fv6deCh/5ZTjD+3FjNL6rqul1hLOOt5PTXQ9Q9ztB bKNA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DYlDaoMzMP8hhWYbnbuVllKnwKPUMw5nutuR92LPe2U=; fh=K+v9b1NircZG8JhzW0qKjfnZqcV09Nw4mFVtDl8RNrA=; b=s/SoWsXX17gIx4m7lB+wRr+QmCJHc0AEOfAsK16ZO+o8RSosG31ISECF9leWdJ3Rj3 /FBgyjc3VHF6QFEUj/VGftKHumLcELmc5tnzViGKQFRiqHIN9oWtAb1WlbUHeEobRp9z kpbd0bXohczzY0Py/n+Ga+wUHjdMxwyiWCPJGYMEH/NDo41yKcbKdSN5a4LSUcEUF2iC 2ictO1Y+Xp4L8d8rwFCbwbYsALkJz3cmoUsZAlWuWP1pc6+zqMdp8BZ0eD+Q4pFDfnzW nxOcmXc9ktOkFDkzwGahXOzc9+0Pe+rMdB+Xkg6RMWVtmpoL2cEULK1ZXvCuwwkTcjrn FOJg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Qry40knk; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-50848-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50848-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com X-Forwarded-Encrypted: i=1; AJvYcCXDGA/blyFdjYfxO/nbRuhM6FT1NuZt06LDYgmnkmvSuHoC5cbz5kWHue6Qmauifdb21dLYRXJXEfh1s8TfsgMepbQ0/g== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id y19-20020a62b513000000b006dbbae74070si2461628pfe.184.2024.02.02.18.51.28 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 18:51:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-50848-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Qry40knk; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-50848-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50848-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id BC9AC281996 for <ouuuleilei@gmail.com>; Sat, 3 Feb 2024 02:51:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8FB3750A68; Sat, 3 Feb 2024 02:38:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="Qry40knk" Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4AC381804F; Sat, 3 Feb 2024 02:37:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706927875; cv=none; b=oJoJKWrlNsKnuV0cz7+FPQY5p8XvzDTn964U42+WcfbiERfEwuRSPSD68sgdSOTZcgeTsgFNilJdoOwbAYf8FZwVX8oY3JCX+lbnr0EPdj++I1ZNV8Y61WHMAQ/bOENZza8wL/uxKWm+2E+Wf7kwyzV3YJUDMglM/lZbg07rgzA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706927875; c=relaxed/simple; bh=3t+oyyObCLNtDcTqp0pGT8TPY42C27S0xw+SlfeDuZ0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TdbrttVJ1NK9KlclDOQHJHlCfXAKO4ASjANi7HkcbBKX9GuB4SAt4cOMwcQ3AKkeaYQllhAnLdHaQ61qp2WBN7IOhgxtlZRBIXPwuI96XbBPu4OJnumHvdBoTDNAsBiU9K0+h1dObOaSwips0oSsnSROo7veoY6PWwhBJLR2dog= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=Qry40knk; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 4132HhgK013623; Sat, 3 Feb 2024 02:37:30 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=DYlDaoMzMP8hhWYbnbuV llKnwKPUMw5nutuR92LPe2U=; b=Qry40knkC+VM339hyR/sTXzUuHGvIql6Uwdk TU1QX6ZE3nMVSSKENVFLPvflQf0LIRZ2rcdakowZt9ESzhcvnbHe9t2OVEsBPrGZ fw5clth37TYdpmbAzwBTJWLJClYBxNSnS6/3vZBEXICSLmUOvrqzKe43MQMXYIjU ntLE1JFUBypZBr7NLvleaGyathkDtnQEELWvkqNM/7BZbD9rgMtfm+oSVKqEEG80 MMaxJ0akHCB8f5qUISf5RVgf/mdml+9+g8NPyqj+p1f+4XL7+W535o1990GbZ7Ni QrzvP56v6980cKzBkJF6DvTFB7iLtPV0MS5D8zeAc1D3Xph9Ug== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3w1ax4849k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 03 Feb 2024 02:37:30 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 4132bTNZ004279 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 3 Feb 2024 02:37:29 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.1118.40; Fri, 2 Feb 2024 18:37:29 -0800 From: Wesley Cheng <quic_wcheng@quicinc.com> To: <srinivas.kandagatla@linaro.org>, <mathias.nyman@intel.com>, <perex@perex.cz>, <conor+dt@kernel.org>, <corbet@lwn.net>, <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>, <konrad.dybcio@linaro.org> CC: <linux-kernel@vger.kernel.org>, <devicetree@vger.kernel.org>, <linux-sound@vger.kernel.org>, <linux-usb@vger.kernel.org>, <linux-arm-msm@vger.kernel.org>, <linux-doc@vger.kernel.org>, <alsa-devel@alsa-project.org>, Wesley Cheng <quic_wcheng@quicinc.com> Subject: [PATCH v13 39/53] ALSA: usb-audio: qcom: Populate PCM and USB chip information Date: Fri, 2 Feb 2024 18:36:31 -0800 Message-ID: <20240203023645.31105-40-quic_wcheng@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240203023645.31105-1-quic_wcheng@quicinc.com> References: <20240203023645.31105-1-quic_wcheng@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: nalasex01b.na.qualcomm.com (10.47.209.197) 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-ORIG-GUID: KFfVyGiOZkLvwQVNL5_O2SyOlb-d69Yz X-Proofpoint-GUID: KFfVyGiOZkLvwQVNL5_O2SyOlb-d69Yz X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-02_16,2024-01-31_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 clxscore=1015 bulkscore=0 phishscore=0 mlxlogscore=676 priorityscore=1501 impostorscore=0 malwarescore=0 spamscore=0 adultscore=0 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2401310000 definitions=main-2402030015 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789844456876883393 X-GMAIL-MSGID: 1789844456876883393 |
Series |
Introduce QC USB SND audio offloading support
|
|
Commit Message
Wesley Cheng
Feb. 3, 2024, 2:36 a.m. UTC
Currently, only the index to the USB SND card array is passed to the USB
backend. Pass through more information, specifically the USB SND card
number and the number of PCM devices available. This allows for the DPCM
backend to determine what USB resources are available during situations,
such as USB audio offloading.
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
---
sound/usb/qcom/qc_audio_offload.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/sound/usb/qcom/qc_audio_offload.c b/sound/usb/qcom/qc_audio_offload.c index 31c0cf5916a0..17cee0cf2ff5 100644 --- a/sound/usb/qcom/qc_audio_offload.c +++ b/sound/usb/qcom/qc_audio_offload.c @@ -172,6 +172,21 @@ enum usb_qmi_audio_format { USB_QMI_PCM_FORMAT_U32_BE, }; +static int usb_qmi_get_pcm_num(struct snd_usb_audio *chip, int direction) +{ + struct snd_usb_substream *subs = NULL; + struct snd_usb_stream *as; + int count = 0; + + list_for_each_entry(as, &chip->pcm_list, list) { + subs = &as->substream[direction]; + if (subs->ep_num) + count++; + } + + return count; +} + static enum usb_qmi_audio_device_speed_enum_v01 get_speed_info(enum usb_device_speed udev_speed) { @@ -1626,6 +1641,8 @@ static void qc_usb_audio_offload_probe(struct snd_usb_audio *chip) sdev->card_idx = chip->card->number; sdev->chip_idx = chip->index; + sdev->num_playback = usb_qmi_get_pcm_num(chip, 0); + sdev->num_capture = usb_qmi_get_pcm_num(chip, 1); uadev[chip->card->number].sdev = sdev; uaudio_qdev->last_card_num = chip->card->number;