Message ID | 20240208231406.27397-53-quic_wcheng@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-58857-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp518233dyd; Thu, 8 Feb 2024 15:35:28 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXauqfm/HVVfYaCSJbr4DgUOtMrSGyLTc0tUO6t72uIyuMCuCwkuv5bGFfb0uhhdsApWeFO15rqjyb2Yr84Kg133jyRUw== X-Google-Smtp-Source: AGHT+IFsQCEuZ7cxkTjVpQRmhUaNlMat/qOK4CVNpyCfU2J2HAhe0LP3HIXrm7joUPhKlV33dDMV X-Received: by 2002:ac2:52b4:0:b0:511:621a:5d5f with SMTP id r20-20020ac252b4000000b00511621a5d5fmr431662lfm.39.1707435327891; Thu, 08 Feb 2024 15:35:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707435327; cv=pass; d=google.com; s=arc-20160816; b=dnuCSWqJyOaI5puzmC/6Ggb/thG3EXNC9LBwlVbFcnnLrGRVn9dAGxSVZOtsgJ0+d/ Jp8yAtWbJs7OPOWTZavPxthSGJqRSUE2kBkrbaLR/Ijr5b7NTe7dwMX07DdmRSbZ3d9x z5VVfOnVVH73gAN1oxQ5fp99vncOu2ANVztBf+nwqJhq3YJzZ7EKd8GDCuBL3UzlOddu plrUCr4eOkL2lItqvjF9rnoEyiRFt31n9VvWjUaPdu00aJfnI6kLr1QuQXQmqDkMzvDB POqi04WtX68lHJLuVXuIZxX2kx8Wf4zJLHUCITkc2EdX7uG0VVmTtVtUv0Xq/KWMQjcf +CPg== 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=5vmvA/j8Eq+r73ofFDYJ664BV9DDh9rA330ASd5d/Rg=; fh=upVjUEHr+u/G1R6ZE8FxkqLqh2LqYLV17YihttNjauQ=; b=PaIIw9TtaCiVHhMTFXIxnvUSYKqlzsc6avjF2856W4hFyxZvZ6rzYholphZaHk8eud oVaK/MK94elhzhB/ZU4Jkmlp16xLU63CjFsHlEncAB0ufhVvEMuKwAV9EIyoHLTTeVoF 0s+MXL1jJwe236f2vBHfHiOTSK4GdVYDfQImScZUbHsFcFKJrxH9kC7FdKM+Ve9740OY dQEIec8+cGftMoCl6IRl/3wlTnyUsTMJxvj05etLtJpVBXfUIjkADdVzsUtDid/DPot1 nmPQy6zCBtpqLe5TbJWkKlJvbcjv99Ga2pkRjnzvE/ksdrXUmEbNoI3Q6a8Amqm7XWmz lP1Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=dGmQcKMt; 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-58857-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58857-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com X-Forwarded-Encrypted: i=2; AJvYcCVAyTyNnWEP9jwttNaDNN2otFfFeTXAAXGfCLmz0mnOzvEBhsOB2VU+hJmbFS8sC7MblnwK42zsXGeNAX7b69ex8qWiQQ== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id bq10-20020a170906d0ca00b00a37d03805afsi169441ejb.956.2024.02.08.15.35.27 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 15:35:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58857-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=dGmQcKMt; 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-58857-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58857-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 7CDDB1F2446A for <ouuuleilei@gmail.com>; Thu, 8 Feb 2024 23:35:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4EFDE664AA; Thu, 8 Feb 2024 23:15:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="dGmQcKMt" 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 42EA251000; Thu, 8 Feb 2024 23:14:48 +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=1707434095; cv=none; b=iDhqWPkn/y83nAbLkGC/NJ1+YSGs8FrW0jG4Zl4qndTdG0h3O9dawiYB2VP7gvMK7mZeQzawsTTei0DkxONtF+yXU8xAMuLn1qRA4oG/4xm4HaHa0FK1wwgyzTFU5SLR8DKdNm64+R65xvkSRLgk0Nq6OhXCjeb6GRrby+/N5qU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707434095; c=relaxed/simple; bh=UemOCUX9OC/jB7lWASuqhcBieye2GhhUA69QsoWo44I=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ucdeHMJ8Wgau97+PBbB1zRtM8s41efOyfIwRkSL/ADqjmVxtNOg+73a7R/kD9ZoXXtb4yRFwKzC2i/4BhC7a0yjT3lrr12OJjh7Ku6uNbn3ICoDHpyEMb/H5a6rH6iXs3em9dgpkOjIvZiD/FQTQPBMlmWXnLYySgUk4E59ob60= 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=dGmQcKMt; 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 (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 418MS3sl028342; Thu, 8 Feb 2024 23:14:31 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=5vmvA/j8Eq+r73ofFDYJ 664BV9DDh9rA330ASd5d/Rg=; b=dGmQcKMtJcdhs3o+6Hpx9Jvrrfbe+SomrysV o00oxhPC+A0MAe3kWfz20+FZbKBDzc1rpogD9wRMLKGkCrFW9aA403MwCPhlLr9r EV69Fy5i/aEO2Wvlb4AeI+g+vo37Zs1ORzwcset17KDuM9ktBAWYjXJ7u6K7v3th 9GplbiPKuaqZxhLALtlghazFgPKqQVqD+EVG2KL6AePfVb8jLhLzk317IX9QbUR8 FLT0NVWLZnEiFEAmnBfxESV5ihOnfZXKf/DCbkBCfksgWrnwrB87pi30pwZIgscS wGhF3Ytse3seUz0ky7KwTbJqOnGjS3Lunj8B/1d+WC6Tvmbx0Q== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3w4pavjs0h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Feb 2024 23:14:31 +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 418NEUgo005657 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 8 Feb 2024 23:14:30 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: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 v14 52/53] ASoC: qcom: Populate SoC components string Date: Thu, 8 Feb 2024 15:14:05 -0800 Message-ID: <20240208231406.27397-53-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: I7SvFsBNvBuvwcKKudjew83ifYcaV9Hb X-Proofpoint-GUID: I7SvFsBNvBuvwcKKudjew83ifYcaV9Hb 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 spamscore=0 priorityscore=1501 mlxscore=0 lowpriorityscore=0 malwarescore=0 mlxlogscore=999 phishscore=0 bulkscore=0 adultscore=0 clxscore=1015 suspectscore=0 impostorscore=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: 1790375706079925488 X-GMAIL-MSGID: 1790375706079925488 |
Series |
Introduce QC USB SND audio offloading support
|
|
Commit Message
Wesley Cheng
Feb. 8, 2024, 11:14 p.m. UTC
For userspace to know about certain capabilities of the current platform
card, add tags to the components string that it can use to enable support
for that audio path. In case of USB offloading, the "usboffldplybk: 1" tag
is added to the string.
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
---
sound/soc/qcom/common.c | 22 ++++++++++++++++++++++
sound/soc/qcom/common.h | 1 +
sound/soc/qcom/sm8250.c | 3 +++
3 files changed, 26 insertions(+)
diff --git a/sound/soc/qcom/common.c b/sound/soc/qcom/common.c index c81a52f64ef8..bd83ac3f2638 100644 --- a/sound/soc/qcom/common.c +++ b/sound/soc/qcom/common.c @@ -258,4 +258,26 @@ int qcom_snd_usb_offload_jack_setup(struct snd_soc_pcm_runtime *rtd, return 0; } EXPORT_SYMBOL_GPL(qcom_snd_usb_offload_jack_setup); + +int qcom_snd_add_components_string(struct snd_soc_pcm_runtime *rtd) +{ + struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0); + struct snd_soc_card *card = rtd->card; + const char *prev = card->components; + + switch (cpu_dai->id) { + case USB_RX: + card->components = devm_kasprintf(card->dev, GFP_KERNEL, "%s %s", + card->components, + snd_soc_usb_get_components_tag(true)); + default: + break; + } + + if (prev && prev != card->components) + devm_kfree(card->dev, prev); + + return 0; +} +EXPORT_SYMBOL_GPL(qcom_snd_add_components_string); MODULE_LICENSE("GPL"); diff --git a/sound/soc/qcom/common.h b/sound/soc/qcom/common.h index fca3046c8674..8546723e0aa8 100644 --- a/sound/soc/qcom/common.h +++ b/sound/soc/qcom/common.h @@ -11,4 +11,5 @@ int qcom_snd_wcd_jack_setup(struct snd_soc_pcm_runtime *rtd, struct snd_soc_jack *jack, bool *jack_setup); int qcom_snd_usb_offload_jack_setup(struct snd_soc_pcm_runtime *rtd, struct snd_soc_jack *jack, bool *jack_setup); +int qcom_snd_add_components_string(struct snd_soc_pcm_runtime *rtd); #endif diff --git a/sound/soc/qcom/sm8250.c b/sound/soc/qcom/sm8250.c index 52136897cc92..2a5384dd5988 100644 --- a/sound/soc/qcom/sm8250.c +++ b/sound/soc/qcom/sm8250.c @@ -38,6 +38,9 @@ static int sm8250_snd_init(struct snd_soc_pcm_runtime *rtd) &data->usb_offload_jack_setup); else ret = qcom_snd_wcd_jack_setup(rtd, &data->jack, &data->jack_setup); + + qcom_snd_add_components_string(rtd); + return ret; }