Message ID | 20240203023645.31105-41-quic_wcheng@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-50843-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:9bc1:b0:106:209c:c626 with SMTP id op1csp819433dyc; Fri, 2 Feb 2024 18:51:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IFtmQ70rryKzxmyuj0JaaOYh6dH7DrLmK6BuN3qCiFz0H4KrOMR4W5Aq0BMaC4hn+knbvOP X-Received: by 2002:a2e:9e52:0:b0:2cc:fc52:df9e with SMTP id g18-20020a2e9e52000000b002ccfc52df9emr6986552ljk.12.1706928661065; Fri, 02 Feb 2024 18:51:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706928661; cv=pass; d=google.com; s=arc-20160816; b=vCnZRP6y4PGEg2jTUClX/30oheiXet0TVlA8CTwgbn9no4/4toLd/ptiDBRIv88HN2 TxV9yZBwSIsGmMHqjFy1NxZ0b0YalZRgF8+1qGB8zVgshd4bnHIIcP00Ci5cyi4eks+u /jYU27MfAWuEAZHb/lFJAfdiic4SI6l5hltDsPVLtQnm8I/dPPtfwn4+wCkYP+qQGVBz IHWpzJBHf7pe+1hTO54pugfHwyiMgF5ziXHp3Sz9/OlgHItQ1TNXcKX1zvmnTrHlxXyr gSBOwI+y9pX1E1glXKu1kljHLlDqXZNKmYino+QhN2Cfo3/Yxd5zvGij45qtjTJ4cxkg QG4A== 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=ZxEpbXSUhkFvFlXqc0ZM4zfCEoAncxVufS2u5Cax9Uw=; b=j8tkNrC3+NvEoOVNte3cQKH0YI1xXzu78DNppJ/obXjGXhrnDkF+RtUDIS0z3YovsD AW3Bdt5+WF/hgFtKFrk+pmv5HgHqAjay6P/IZzk6gfP5ZVbnbhSbpZV5jcvLypESOniw D4gptlMp+/nhCoMddBRBPlEjAESVqciWwrChUhY5uJ5QIb7gJTS5sK/T36MEwkKC8Swf TCTQbZy9gPXUcIg8lBKF4sx4jf4gzLgOEwSLtVAACNzNWa351y/fL/i9rNerrB6VYy93 c+AQUsZpKO86YIlAWY8JzrAFMwpa9JrW94t8clSVo7hWzTT0a1nS4akEsUvYyGLg/Uex fk9g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=gbq9OadA; 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-50843-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50843-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com X-Forwarded-Encrypted: i=1; AJvYcCX3kI4RvpyiakZ1YuUMHEW9miYfatrLbqNyMm1EpjCBUU8zYa2bW4A9ton07oE5OMoOvMIgll9/2kGKudeXtNqxUjSLew== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id g35-20020a056402322300b0055ffb4c182asi326619eda.614.2024.02.02.18.51.00 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 18:51:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-50843-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=gbq9OadA; 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-50843-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50843-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 am.mirrors.kernel.org (Postfix) with ESMTPS id A1C661F21BD8 for <ouuuleilei@gmail.com>; Sat, 3 Feb 2024 02:51:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DA3644F8B8; Sat, 3 Feb 2024 02:38:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="gbq9OadA" 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 8C92A168BC; Sat, 3 Feb 2024 02:37:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706927873; cv=none; b=tnfJq2KHeNT2RFw2qW4ErGwHDMqOHtk/jt4K+GGz+knJAIlVaf1YOnWFM+pvRWreKz4iI09U3pJlW6Gu0cAzJaVjc/JWB88X8RzV/NSkMzxPGySv9q1APW2y98Z77Ef5CXMam5NOxKNyR5QDKJ1WwkmXAto4Qw+L/0LQkAyAyIA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706927873; c=relaxed/simple; bh=/CBCu7xtzLoC6vN95Vv2nxS4gvDbU4mm+K3QyU75FAU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VUSrqfGh0hx/eXz2uTGy8aulnB6AoQ9BvE6T4c75ddBvznXYS07V7gsajQEKI/GTl0Fa7WB9i/29Thx0G80VdwGb2YmNtCyhpX3XQWCh2YfrMLxxO6YCUk1WL5XeddLr+6vnw7Ebf6KVK8tufBHhz2efxvNRQfN2tMuIObpRr5w= 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=gbq9OadA; arc=none smtp.client-ip=205.220.168.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 (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 4132Rk8E000365; 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=Rknx4yFlGtTVBQ/y80iN V/1i6qwGSOJ39GzerqlUVGA=; b=gbq9OadAmJM6yYdwDe1Osyk0seAXkWpJnXX8 NeAB2jd5Kt5D3LV+bHWHlvkPevtbReeuuqhm4ELW/sJTLAbFtqDGgm5JU16otD65 /+q/hG0Q8wirZOUKvnqlIc9P9XS2fMquQCKIEwqiF/csIJtefEl4/MvuGguORorH kWUwDT8rQmSYNxkcZE4EpA9o2xqYVyL/0ojPIrhpCYwjE0dmf2JORkX2Wg1Cqegx h6RjOD6H3svrwVyK/gPLBiihZ7rx/00UG/Tzny01/ZoJ0qcownYWUPtGtXocJi+T wtUQAjmK69DD7vJl1wcbW+WF7DSPm3hyBWDdvTqVYCqmhiZXgg== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3w17yegd4n-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 NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 4132bTCl008222 (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 40/53] ASoC: qcom: qdsp6: Add support to track available USB PCM devices Date: Fri, 2 Feb 2024 18:36:32 -0800 Message-ID: <20240203023645.31105-41-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-GUID: e4Sha0PuKhedkZo3jg_hWyJNOMvAGudi X-Proofpoint-ORIG-GUID: e4Sha0PuKhedkZo3jg_hWyJNOMvAGudi 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 clxscore=1015 malwarescore=0 suspectscore=0 mlxscore=0 lowpriorityscore=0 phishscore=0 spamscore=0 mlxlogscore=944 impostorscore=0 priorityscore=1501 adultscore=0 bulkscore=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: 1789844427665296975 X-GMAIL-MSGID: 1789844427665296975 |
Series |
Introduce QC USB SND audio offloading support
|
|
Commit Message
Wesley Cheng
Feb. 3, 2024, 2:36 a.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;