Message ID | 20231215214955.12110-29-quic_wcheng@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-1713-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp9603626dys; Fri, 15 Dec 2023 14:03:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IFp+2CY0DPkpZue7F/zAKiMHSPN9cgdOt6zWTZ8BAKMZVWK5oWAph4dPOk6dHRQHjOiTh5D X-Received: by 2002:a05:6a00:2d04:b0:6cd:f35d:afb8 with SMTP id fa4-20020a056a002d0400b006cdf35dafb8mr8148792pfb.11.1702677808607; Fri, 15 Dec 2023 14:03:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702677808; cv=none; d=google.com; s=arc-20160816; b=By/BupFWf4shsOv6qxcMUOOA10v8iDCXuLFvpp3V3e7maf9jg4ysBSrajfT/A+phMj Zl+7fHpjs+ZjQaee+ws88pXRfByUFzYCvU5TPTuK17nx0m1QiRbyDMUz5GAXiCgEVCW8 2/2WiaUJct2DHJMC5T4cTq//1Hxw4wWYkexm+ZxQcgdtMUg1c9PXMFVia1sA5quMJvWL rs3MxxznV5P8SZ01BrmsCyelGGSWpQqgCpXxiGOIygc6ciH51jC5bUNJXWgg43+t7V0m y+9O7+Lrh1CODKlBKSCSAfSwRpXZE8p3AEUwDQYh6ZZ6qfqjU75O3Z291ZztHHYLXwX6 GO6A== 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=7+oH4vq654e/uqtAvDV8jnspT+jzvUavpKihEBcmUog=; fh=0KzismZj+xI0Z//ZGdqKIH/FO9LtSZM7Yj4P0VtrCz0=; b=iJYnilQHhChft5nVCuOajuNLsfX43Fp2/90W+XS/8bsfmFs/UC0PYlX1uLSrLbC9Yw AwQW7yOtap8b2Bugw3SUMDT0EPp7o+rHpXT81KE8KlvW/tFxVV0RKQtoyD1a0yboXxdN wO8/d7HV/achTbqht9GxCagynldxmUSvac8jSgtUzphGonn/U92YLUWtTJcDsKIZjRzZ g236qBL00vmh5/YGz7POhoqrV35H35Y/Xi7v1TXS//Fa11nlhdXC2S7Hx0DtHxHfzUSi slsuBWxPR0Jp22B03SfsG26lAGSljwa/dLqwrELUkwBb4TZot0vF9WxmOFBZw2IIHaxN ZBpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=FWNcxwpJ; spf=pass (google.com: domain of linux-kernel+bounces-1713-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1713-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. [139.178.88.99]) by mx.google.com with ESMTPS id kp8-20020a056a00464800b006cddd0d9820si13522168pfb.72.2023.12.15.14.03.28 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 14:03:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1713-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=FWNcxwpJ; spf=pass (google.com: domain of linux-kernel+bounces-1713-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1713-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 5CCC8280DF2 for <ouuuleilei@gmail.com>; Fri, 15 Dec 2023 22:03:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B9D80137251; Fri, 15 Dec 2023 21:50:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="FWNcxwpJ" 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 7F9696BB56; Fri, 15 Dec 2023 21:50:32 +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 (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BFICZCI031796; Fri, 15 Dec 2023 21:50:15 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=7+oH4vq654e/uqtAvDV8 jnspT+jzvUavpKihEBcmUog=; b=FWNcxwpJnoajkVGO9VRdRSo+yFMnDseivXHI XK7w3VgLYHv4y9giUta3pC38hSi5REbusy69DfCywIypSFhl2GkdX48i6uui8h+7 KgStTAEMXoPNehFv3MLEaeItnYpJR1ofFxYXEbGHgvWGCBNOW/zPo3hxURkcjYRB m11iCjkiJzcjLLodp5T/hXPEXURuvtyxLesjOXY4D7xbkxc0XPCGRvtZHZPXdLbP UjTFwpdn0OK4UN5V3aX4/sYEtnY3I+zzBaPK+TpW6lsl4ba/lngipHgRXobJDSev TC8D5xdGCuXiOIwT2Hava93k9R776QBJJrHFHGdR3TwiktzTSA== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3v0hdfa7e2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Dec 2023 21:50:15 +0000 (GMT) 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 3BFLoE2n008368 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Dec 2023 21:50:14 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, 15 Dec 2023 13:50:14 -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 v10 28/41] ASoC: qcom: qdsp6: Add support to track available USB PCM devices Date: Fri, 15 Dec 2023 13:49:42 -0800 Message-ID: <20231215214955.12110-29-quic_wcheng@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231215214955.12110-1-quic_wcheng@quicinc.com> References: <20231215214955.12110-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-ORIG-GUID: v2vayrf3aeT5qmCNob8ywTDmbrX8sYR0 X-Proofpoint-GUID: v2vayrf3aeT5qmCNob8ywTDmbrX8sYR0 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 malwarescore=0 mlxlogscore=913 impostorscore=0 spamscore=0 lowpriorityscore=0 adultscore=0 clxscore=1015 priorityscore=1501 mlxscore=0 phishscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312150152 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785387085398023221 X-GMAIL-MSGID: 1785387085398023221 |
Series |
Introduce QC USB SND audio offloading support
|
|
Commit Message
Wesley Cheng
Dec. 15, 2023, 9:49 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 a3893ec96fe6..0f3cf0ac28aa 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;