Message ID | 20240102214549.22498-29-quic_wcheng@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-14869-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp4700232dyb; Tue, 2 Jan 2024 13:51:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IHuaX0K1+deQl0caB1qqQdTguKY33tkHciil1GGUA+0gIDOSdbloKvn3+U7GvZs9QjS9Tms X-Received: by 2002:a05:6a21:192:b0:197:6a98:297 with SMTP id le18-20020a056a21019200b001976a980297mr230385pzb.51.1704232268895; Tue, 02 Jan 2024 13:51:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704232268; cv=none; d=google.com; s=arc-20160816; b=tKctoQJjO7Q9IrO7Nn3fefItUovyLA/Nc7RW1ShaKzzlzTM513xMZkTrBEToW1rOxw 1MGWCEQu3jqI/6TbAgEp+BbK5evo1LuRIxX2LEB6qLavJ4G85al/LM23CotKIEqoB1fn LaCKl9VeKQkcCeEqpv3BVUxJhSAywSpXWYEsbkOKC+AQKFqjIQX+kt18ea3D3dfPVtap pqtxUBVsoBH42b2WfX+ULl8Tn1ADr3W2E6Vx1SCtNFe8G5PvLTQH6ZFIzWk61L0IPNjO PRsD0JiKK04YUZemZEjmypesw/Ph+WiibJzEixnJjPX6H5rw0grFOnc+RPHBlH4YQa4j X0IA== ARC-Message-Signature: i=1; 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=Rknx4yFlGtTVBQ/y80iNV/1i6qwGSOJ39GzerqlUVGA=; fh=0KzismZj+xI0Z//ZGdqKIH/FO9LtSZM7Yj4P0VtrCz0=; b=u3b+J1mJIOrjkpT3UFnHf9SXD2StZe5oD7jqZDcrT9/UZoELZpbCoC1809ifeHphHH WcqttUBwvzMDxhlAe8/i8yHzKF2fGPONq/YbcDKgyDIyKvrucmFtj6H2zUMg2uv6YXZ/ bSEkLTHp/KcZFmAFDWn19txZ0IavyqR/tJwEgZtu7ThATDh+DEqy5TfJJgiZPERHMNck Y41KRCf1bd+WStRR/D0paQNjwlwEQFUTpTKlahR8rDsQBcE1nxBhfphmGgLKvU/MSm42 k8T8sgX5wyFV2K/L6y3KNjKOOPMYg58ADSNjaCHqr8Ca9Wa588jJap61s2/w2aitBiJz M/RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=SXDCDh9+; spf=pass (google.com: domain of linux-kernel+bounces-14869-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-14869-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id u25-20020aa78499000000b006d3c35096dcsi8356450pfn.320.2024.01.02.13.51.08 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 13:51:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-14869-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=SXDCDh9+; spf=pass (google.com: domain of linux-kernel+bounces-14869-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-14869-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 7044B282194 for <ouuuleilei@gmail.com>; Tue, 2 Jan 2024 21:51:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 954CE199DE; Tue, 2 Jan 2024 21:46:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="SXDCDh9+" X-Original-To: linux-kernel@vger.kernel.org Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 15E8C1798E; Tue, 2 Jan 2024 21:46:43 +0000 (UTC) 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 (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 402LkROC001959; Tue, 2 Jan 2024 21:46:27 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=Rknx4yFlGtTVBQ/y80iN V/1i6qwGSOJ39GzerqlUVGA=; b=SXDCDh9+0dHjbUrqjJkk9RracVqEVOPb6gAV HP5KFsfaXrhFdHFHnuADwkpuFa6isbVWd/8o20gBG59XhcMQ32Ig/C6FU8vo0huB cw2ZKbW6Xb0scxwhvF8LUOIlWxKS9nhe0A4uL0EnaruE975pNm5yemUBKa3tDTKM N1IPIQ3ggq0ktIKx8s6IpOEMvXpi+D2k+LE33FQth63JXvcIVmkyIVkIYromSZAn iM0IvfoIMYd9jPZA5OnM6vKJzMB0c0Ms4O49yt034HIr6wKsRyolJO8OZOgR60He d5SKUxzY2nv5pFp/cZJx0bDrIhMCM35SDo0iJ3IFYU5yCgaSgQ== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vcg419bb1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 Jan 2024 21:46:27 +0000 (GMT) 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 402LkQiD009878 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 2 Jan 2024 21:46:26 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; Tue, 2 Jan 2024 13:46:26 -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>, <gregkh@linuxfoundation.org>, <lgirdwood@gmail.com>, <andersson@kernel.org>, <krzysztof.kozlowski+dt@linaro.org>, <konrad.dybcio@linaro.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>, <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 v12 28/41] ASoC: qcom: qdsp6: Add support to track available USB PCM devices Date: Tue, 2 Jan 2024 13:45:36 -0800 Message-ID: <20240102214549.22498-29-quic_wcheng@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240102214549.22498-1-quic_wcheng@quicinc.com> References: <20240102214549.22498-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: nalasex01c.na.qualcomm.com (10.47.97.35) 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: ylxqTlAdYE6W-33aAtk3I5kL8WLe0q8S X-Proofpoint-ORIG-GUID: ylxqTlAdYE6W-33aAtk3I5kL8WLe0q8S X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_01,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 mlxscore=0 phishscore=0 spamscore=0 bulkscore=0 adultscore=0 priorityscore=1501 impostorscore=0 mlxlogscore=903 malwarescore=0 suspectscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401020161 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787017055975837770 X-GMAIL-MSGID: 1787017055975837770 |
Series |
Introduce QC USB SND audio offloading support
|
|
Commit Message
Wesley Cheng
Jan. 2, 2024, 9:45 p.m. UTC
The USB backend should know about which sound resources are being shared
between the ASoC and USB SND paths. This can be utilized to properly
select and maintain the offloading devices.
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
---
sound/soc/qcom/qdsp6/q6usb.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/sound/soc/qcom/qdsp6/q6usb.c b/sound/soc/qcom/qdsp6/q6usb.c index 833a57deb321..e539b411c35e 100644 --- a/sound/soc/qcom/qdsp6/q6usb.c +++ b/sound/soc/qcom/qdsp6/q6usb.c @@ -27,11 +27,18 @@ #define Q6_USB_SID_MASK 0xF +struct q6usb_status { + struct snd_soc_usb_device *sdev; + unsigned int pcm_index; +}; + struct q6usb_port_data { struct q6afe_usb_cfg usb_cfg; struct snd_soc_usb *usb; struct q6usb_offload priv; int active_usb_chip_idx; + unsigned long available_card_slot; + struct q6usb_status status[SNDRV_CARDS]; }; static const struct snd_soc_dapm_widget q6usb_dai_widgets[] = { @@ -113,6 +120,12 @@ static int q6usb_alsa_connection_cb(struct snd_soc_usb *usb, if (connected) { /* We only track the latest USB headset plugged in */ data->active_usb_chip_idx = sdev->card_idx; + + set_bit(sdev->card_idx, &data->available_card_slot); + data->status[sdev->card_idx].sdev = sdev; + } else { + clear_bit(sdev->card_idx, &data->available_card_slot); + data->status[sdev->card_idx].sdev = NULL; } return 0;