Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp831781lqo; Wed, 8 May 2024 17:14:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXyOEWLvHsLgObL3Vx9F6O5B526FhQxu3eCZyVUZENBK5CknzcDUJDoWqmctp05O8SGxSDKWT0u7ge43jWOICivzyQ3gP949tfHQFLfsg== X-Google-Smtp-Source: AGHT+IEHY29C06zIgg4Oa0PjTMWlA4sZpD+S4AIjEaHpSXdwE7F4yQcbwDxeiQvkVZndsi1jTsM2 X-Received: by 2002:a05:6e02:1b04:b0:36b:3c85:8b84 with SMTP id e9e14a558f8ab-36caed5a26cmr44837675ab.23.1715213662569; Wed, 08 May 2024 17:14:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715213662; cv=pass; d=google.com; s=arc-20160816; b=IbE3qMkcZlZUADGjq7G7sI+6uV17DFxlPn0fI5aUEO2zDFotQNxJq+x9Fx66Enucze LFdtMa31PtKa4fIReSgFe/bxfEasYAYjp7cMEQ5NkI9wq931fHMhOMKC9/q6Ewzgk0Ch FBcD/XUPBH8c3eErXm4kC0BgJtgbTVt11gTY+1y3v380554rkA90mgXhOZI6coqpI4bg ojui6i09FAzWEIE4PLycewoVFGU6Q884HimmtmDEzClxB2sQoY/tCGALR/493ZYEyieu VVHtSBlQTR2RStsZGeLkI50/Fe5gdiVY3swkR8vZlMoWXSuK5+ziQGaMg3OE+EBRtJPh Qw7w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=AAXVD9XaJFUX5Wr81xhDQdaAYb5w7UDfisvH2/cYKY0=; fh=iRZivtppW/TNTAfzyCFB4Ao7jKoLfwnwVSfzppsNZsY=; b=Nsw/MA1E2B67CckBb8NJapCoiBwSi15gLTxmC8Eaa7sL2fL2DDYfYXk5NZmLVxRU+/ m6t99y2Gr6DQSU9JKaZBPqyFrHurC9id1NL9isMQGXHuEGvdmF3ybRLj5phkRwqCZLw4 2ntXLMS8ChjLTcF3As9p3egEDX77xawlQ4WejuAjX9HGzDawnJ6PtV8ABrDQmGAgP/vt 3EmL8jf+8MdSE4DxKXCOr+eC4jC/M2CwlESseATXEQTQcGNtgFZ/8CPBizgfItykdy4a xHl6oSDa4HC1PFpHCJdbCE0JnuLmMe/GHVAKmQd0yE3Uci1xjksdxm9EGSJYbc8jH4mF VD4w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=kWjqrcdd; 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-173962-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-173962-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-63409e8262dsi216429a12.121.2024.05.08.17.14.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 17:14:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-173962-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=kWjqrcdd; 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-173962-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-173962-linux.lists.archive=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 C7231B21627 for ; Thu, 9 May 2024 00:14:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9EABA3232; Thu, 9 May 2024 00:14:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="kWjqrcdd" 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 5AC6436C; Thu, 9 May 2024 00:13:58 +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=1715213639; cv=none; b=UEtE6brLHOztMh26n1CQipU0Wo5Rk9VQ6fYNCaXg6E0jeLQKPdnYBRGKf7fYDo+d8yvmE3FgyydYym6O0P81Ik56iRvFQnBnKBC8QRAu4UXWPx61d2v8mXujjxv3W4bP4ox6TMqlcctqaA3pYGGL7btw60ctidsEd6FMJzOwHYw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715213639; c=relaxed/simple; bh=XEzh2rn2ODsLiWKQlzOInwm/aVuCxyWNxiDwhdI+Uzk=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=Ly203Fc4O0wShNIvcFsj1zY1RNlYXnYbsu2fVCYNBDd6T1kNItZ84OCodVRWgbRfEtUitv4B6IRjzij+pUxjxTsGOMeJKmoiSH9D1KgaplY4++q7JlqL8RcbMpApgevLsVfDvu1VYA2gtBWdaf1bKJZw9ZuR2yJsdMDHja5f5RM= 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=kWjqrcdd; 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 (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 448CVglG014162; Thu, 9 May 2024 00:13:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=AAXVD9XaJFUX5Wr81xhDQdaAYb5w7UDfisvH2/cYKY0=; b=kW jqrcdd9fuSjzWWHADFuJjfa3vwZ+V7UvEBsvScJi7Cz/s50h3OFpDyfTll7vl8Pu k39ALUUdVVNBzN7nwoJxZL64/PyiSc2zbzXag81dwTZ0iymoQcHR6GtDwBFLY1Ps vXP4nfqT19XZxLnJZBBKxC66yvNOIkuCOpxPSOYSqHjrlf3ZgmWOPtyXWVQV6j3t x+lpCsvVD2dwBHcvTw2ZvIHAVJhEIN1d/9z9QcZlokFdapuLk28m0RLMnZ0BbpGI /yZCspiHFnsI1ibupf6/eQ8C+FKTlJV5FvHsendivRwxuzxHL9MDhmA/ZfvEbWhx nPiFSGfoTkPLg2s9x3+A== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3y09fr9c80-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 May 2024 00:13:39 +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 4490Dcbh020525 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 9 May 2024 00:13:38 GMT Received: from [10.110.126.205] (10.80.80.8) 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.1544.9; Wed, 8 May 2024 17:13:37 -0700 Message-ID: <9d0ba8c8-9c8f-a45a-cf14-5d1829273cfa@quicinc.com> Date: Wed, 8 May 2024 17:13:37 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH v21 33/39] ASoC: usb: Fetch ASoC sound card information Content-Language: en-US To: Pierre-Louis Bossart , , , , , , , , , , , , , , , , CC: , , , , , , References: <20240507195116.9464-1-quic_wcheng@quicinc.com> <20240507195116.9464-34-quic_wcheng@quicinc.com> <6fe8f489-d8a2-4951-96fa-875ac9b29d23@linux.intel.com> From: Wesley Cheng In-Reply-To: <6fe8f489-d8a2-4951-96fa-875ac9b29d23@linux.intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) 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: kzMAdMNLzg3mhcRwkaYPQe_uL9MqPl7G X-Proofpoint-GUID: kzMAdMNLzg3mhcRwkaYPQe_uL9MqPl7G X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-05-08_09,2024-05-08_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 malwarescore=0 mlxscore=0 mlxlogscore=643 priorityscore=1501 clxscore=1015 spamscore=0 lowpriorityscore=0 bulkscore=0 phishscore=0 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405010000 definitions=main-2405090000 Hi Pierre, On 5/7/2024 2:33 PM, Pierre-Louis Bossart wrote: > >> +/** >> + * snd_soc_usb_device_offload_available() - Fetch BE DAI link sound card >> + * @dev: the device to find in SOC USB >> + * >> + * Finds the component linked to a specific SOC USB instance, and returns >> + * the sound card number for the platform card supporting offloading. >> + * >> + */ >> +int snd_soc_usb_device_offload_available(struct device *dev) >> +{ >> + struct snd_soc_usb *ctx; >> + >> + ctx = snd_soc_find_usb_ctx(dev); >> + if (!ctx) >> + return -ENODEV; >> + >> + return ctx->component->card->snd_card->number; >> +} > > Presumably there's a notification to help applications discard this > information on removal? If the platform/ASoC sound card is removed then the USB BE DAI is going to be unregistered from SOC USB. This would lead to the snd_soc_find_usb_ctx() to return with -ENODEV to the USB SND offload kcontrol call. Thanks Wesley Cheng