Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp1210371rdb; Fri, 2 Feb 2024 18:57:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IH5uNts3H7eXlme3+4C2WO9U42fGFRWTSA3xV8qpnjyRN54ppBLxNn0kOLGTENjXFkz7sU/ X-Received: by 2002:a17:906:4f:b0:a37:478a:929b with SMTP id 15-20020a170906004f00b00a37478a929bmr344998ejg.8.1706929071591; Fri, 02 Feb 2024 18:57:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706929071; cv=pass; d=google.com; s=arc-20160816; b=YCYwZr9zYQOx9SIyU1bzgxxEJK9l8c7NaYTIvYwoQfi8j4ctoUnn+2vFaO6LnBDgSM FMt/g1aPBngfjtxjXpqEPZzgYRSwE5LVMAoBP8gcOlGTYphTWTb0zr6qSoxcHS4sZ/Ve x4g6VZ/U9p0pvrRe9Jv6EeK7nJ4H6EO/TZNC2GXTmIKCDevxgNnY+oTWZ8OVuFT+ZN1N CGrmLrlHsruThcMJ/WxOZ+cS8LEJnULj+aVmqEtYI+Eq1lBiVhmhWJrJOC8I4BiP/RdQ pmfld7mrG94URXrNiEDBwdPXdQW4mPO2w1T3RjdCcq6V/VHq4mLZOty7LNSVOwNmpP8q Wsvg== 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=qevyAlAIGRfih9N/EZhCUAkqbXEDhaoHudNQKyXHMN4=; b=p1ka4zKUd6+ldb0mKwjdXSP+MM/QrfQac0KdVp6qo7GF3S8vhGYoTCRHe5TirJ6rlP esiqEk59U9Yew0MrrMpfGfNxXX7E4btxK9C7euxQ7q27VYbmoEjHJOK6oWZaB7nkHzUz JN+tN6LKNRqnhTw0HHo5dJpVdhxobHv6lKmq01/t3qKgTncFuzla5uGGZbLpz+DL1TLu WrhQTs9mt04TATAFXGlFHYmbwnXesDi5F90O1ou3cc823wUOJevXCAFeIOj0fjwLaoVM +JUgtvNUlZxW2TR+d7Wzu3xu6SnvYx2dnFP2P0K5lqby19XvdA0xIk9u45WEQfud+2VB z0zw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=bOvbcF9l; 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-50875-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50875-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com X-Forwarded-Encrypted: i=1; AJvYcCXHomMArY2tTWb4On6hfuUs25nOtb4TgxSaTZAdKeW9MPpqikpsM1SRl9Qds6fSeU+HK4m7dVf5F9f3hGC08t7CqegRjbcx59IeT9Yqhw== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id f9-20020a170906494900b00a363f2333b0si1415209ejt.359.2024.02.02.18.57.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 18:57:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-50875-linux.lists.archive=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=bOvbcF9l; 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-50875-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50875-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 592181F22D79 for ; Sat, 3 Feb 2024 02:57:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C7ED55B68C; Sat, 3 Feb 2024 02:38:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="bOvbcF9l" 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 3A7124501E; Sat, 3 Feb 2024 02:38:21 +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=1706927903; cv=none; b=KqktkJqpNwFG2EzTwCqpVCRlpaSiEP6CycJCIhh7cv+dWApWJlLocl7SYhhWYUBGg7I1g8UW2466oO6h27K686TYzq0x2iVlVYrNPX4VXd4Smq1oXZF/ztb+r22ZoOEYVkClAJoV631WNElAf511JJMU+0Uonvh6nbTA0OF1ggY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706927903; c=relaxed/simple; bh=UemOCUX9OC/jB7lWASuqhcBieye2GhhUA69QsoWo44I=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=q2sfTh1CxSpGyFWrR1k+l0dSRApG2x4zj90W/IO5vuxx4pz2n+G4XnWRFudHdKyPI6gYQfHgMd3v6AAKlP7vbEc+KmJrRCN4KbgifrWqXE+ApSOtTTHpJNFyOa+7FPrnn99YhGD1XrafC7VnBzf2E63c1Joibpv1i+QXxczLgYo= 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=bOvbcF9l; 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 (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 4132c63H024009; Sat, 3 Feb 2024 02:38:06 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=bOvbcF9lEfc2DnRmzYzQ5zh+DDW4e8DwKtTs mWTBMQpYUOdDF3ISJCNAu0G5i9QVCBDjB1A4cjq0n8tjIpUC7LIlemAO7DsRn5RI RMR3MgaqFm6y8KpZJi+VzbMQimdmGI4xvyzgRKFHCynzCh5EPqk8kqKqUj4ESKcv Tn0DpcGmWaLFOg5oTV2gsm0k92EDsU+Rrd5XpYDpkRAxL0oxVUMaofrMsyyero2L cw9DIa4rFzjXUJGI1CwOX25XMSv8y1oyd0tCwEuuInNdj1l3kI06iuTA3UWT/mKd 30O7uzJxSo9WKGdrxgYgB1KgkV6l4RY7qpCvF/ktSFjlgw3jTQ== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3w0pwjjujb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 03 Feb 2024 02:38:05 +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 4132bXsf008647 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 3 Feb 2024 02:37:33 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:32 -0800 From: Wesley Cheng To: , , , , , , , , , , , , , , CC: , , , , , , , Wesley Cheng Subject: [PATCH v13 52/53] ASoC: qcom: Populate SoC components string Date: Fri, 2 Feb 2024 18:36:44 -0800 Message-ID: <20240203023645.31105-53-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: List-Subscribe: List-Unsubscribe: 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: jjtMxWjlG0ucgCNvJnglWa15LLs-FZGM X-Proofpoint-ORIG-GUID: jjtMxWjlG0ucgCNvJnglWa15LLs-FZGM 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 impostorscore=0 lowpriorityscore=0 clxscore=1015 mlxscore=0 phishscore=0 mlxlogscore=999 malwarescore=0 suspectscore=0 adultscore=0 priorityscore=1501 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2401310000 definitions=main-2402030015 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 --- 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; }