Message ID | 20240208231406.27397-41-quic_wcheng@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-58823-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp526615dyd; Thu, 8 Feb 2024 15:56:45 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUlXKi6WHKMDCCoClWBu5eXZ+d+WD8EX1/8xd0a/09H+SvzjdWC1o4G+bFk5pHJkGRpkEx0btG9f/amuA7DnKXQjbdNlw== X-Google-Smtp-Source: AGHT+IEwH5+LTAvkGxRgxubHsu0/6hK5zJRns6bivdswQlCWapjg8cqjzTd9gFQrw1lafa0nvUCk X-Received: by 2002:a9d:6d05:0:b0:6dd:e264:f8fa with SMTP id o5-20020a9d6d05000000b006dde264f8famr1135816otp.28.1707436605396; Thu, 08 Feb 2024 15:56:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707436605; cv=pass; d=google.com; s=arc-20160816; b=jxEtnODPaYzmkI7rblsO/wCUhTKlxm5cx1bgfx6+pluczQhlJM+gX3JXWUhnunmVi0 ZUj3qhxYhYuFunaLpSdXeFPLwllY9srurBTGp9G5/wCPd8wUpdC5mShixqm9484Z5Pw5 KWmVeDo+q7s3gNPfEAspaGT0jVSYeLyTTIvueRbMG3Uro6xG0v8b52uWhh69bIPXnLBX T959anwb9pz6+Nt7DmTwZVMOrw1/1cce2Syu2tbNbk5B5QLkuGOUo+8y8ykP+Pq+7bou faYQwnVOC+m5KPVHTHMN+2kqmTrDdoozssumQ0SLb60TfFa/BAjTMIcC5n38lEv8yQNw zaog== 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=Rknx4yFlGtTVBQ/y80iNV/1i6qwGSOJ39GzerqlUVGA=; fh=l6MuCJVdYZdieZw/b2ooJ8TNWZJJdmWi4OSieNQBdSY=; b=dJ7HIs0q6lN03lkuqxjTdQla0CNJOWv9mAlhjSxO8sd2HftM06Z5rVdUzxYsSo3+js eAk2SlJlLukKW4gDegUvk9BZECb9jymvPADNeSERc5IGugl0Bi19/ulV7MK3/NFJ7F8/ WssOdb7NY4wfH+qn+4khC1a3pSqbOb8YHb3O8JVwls1UByR73omK16+ZFYh+Wpi2btRD FMurfWJLnzszrWuHvBAiaWAa0Alq92Hhv0qFL9A3Yvn262PtkhRhW6p0qgYQ7OScQ1Nb bhEkkho7L2yAyZnaanglbUmg3w4qoQvclG2SRDje4mjswKNxEIbUPnkW8tKJJ3L3Kz6w gQGw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=OK1BrHd9; 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-58823-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58823-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com X-Forwarded-Encrypted: i=2; AJvYcCV/Lji0LffQAE+l7KQEhQEG94YpDTf9DUedlWYJl6o+VVdZusEIX0Rija5i8U5qGjmcdMfdrOxIDXIvADj7eSyxqalvJA== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id bx32-20020a056a02052000b005ce3c33c303si683915pgb.301.2024.02.08.15.56.44 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 15:56:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58823-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=OK1BrHd9; 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-58823-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58823-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 56352B2EA09 for <ouuuleilei@gmail.com>; Thu, 8 Feb 2024 23:28:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B517160DD4; Thu, 8 Feb 2024 23:15:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="OK1BrHd9" 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 5619750261; Thu, 8 Feb 2024 23:14:39 +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=1707434082; cv=none; b=d0gjq0h8D1IWWaScSapGYgHRYAIqKTSAdAzmKbrYPjdyiOSSmbkS4oZ/F4cBrJCd5v8m7BgTX1RvRIMzhNZCf6/x+yctHMiKf+3JKgsD4y1esDTQudKBcPG2e29WKAbVof/JBtlpD/l2xkx3fp3k46aI96JMfqg5Yh3/Ux535UI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707434082; c=relaxed/simple; bh=/CBCu7xtzLoC6vN95Vv2nxS4gvDbU4mm+K3QyU75FAU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=GYczLZ+x7Ac8GENKP2y4OL60TtRqKe+KIYzGcKd3rUj74aBLNSIutbyZn3BPe2HS688HV9c1AeXdxgTZjrTSbfT5rCAAdQtd9D3QyVrzS7FXgmW0t6qfdGOxGT2UQlEL4721nuBJjCKsWsCAny67xj6TDKBT9qarQuwEFKo2cWg= 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=OK1BrHd9; 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 418LjXpA014636; Thu, 8 Feb 2024 23:14:28 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=OK1BrHd98bfwPkoB79hobZEgVs0p9mRtRsQV z4HLm2TRhkOhReFbV+Shth8h7mD9bgpwuEUj76hHIN6FS+zHrcT5K0SH9UgpkGaT oxsdMS6m7BDryrVxFoZ537plt3snDyrXaHqbSV+wb7J/CkYtq6PyBW0zOjx1f38x qNktygGXUnSaG8WLVvEJzVE96Bdq/OghW5vD5n4rQndfXQ2b9RV+OU6CjGV/P1xV aLyVAdIPJdkD5T+Gx/UB5CYNtsqtOKb2Zuw7n+xAtkq2Lp19mMBEvNouoKuBHmSK VFTnXoWtJm9iSiD331cANCt+qodNjDofZsfcCTQdn9gqN2Udxw== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3w4frwuju7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Feb 2024 23:14:28 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 418NERT1012282 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 8 Feb 2024 23:14:27 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; Thu, 8 Feb 2024 15:14: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>, <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 v14 40/53] ASoC: qcom: qdsp6: Add support to track available USB PCM devices Date: Thu, 8 Feb 2024 15:13:53 -0800 Message-ID: <20240208231406.27397-41-quic_wcheng@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240208231406.27397-1-quic_wcheng@quicinc.com> References: <20240208231406.27397-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: w4lg_aZAydkbR-tEtmWgoeKrn3jhZpVc X-Proofpoint-GUID: w4lg_aZAydkbR-tEtmWgoeKrn3jhZpVc 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-08_11,2024-02-08_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 malwarescore=0 spamscore=0 suspectscore=0 bulkscore=0 phishscore=0 clxscore=1015 lowpriorityscore=0 mlxlogscore=948 adultscore=0 priorityscore=1501 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2401310000 definitions=main-2402080131 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790377045595250847 X-GMAIL-MSGID: 1790377045595250847 |
Series |
Introduce QC USB SND audio offloading support
|
|
Commit Message
Wesley Cheng
Feb. 8, 2024, 11:13 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;