Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp598781rdb; Thu, 8 Feb 2024 15:33:04 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVgdlDJAfrqh6kBw5z6sCPewfYzzT0v/WdOin0uZTH9srGPAyBFdsClxHaX2c+8HZ6IiB6N6B0HNeL6wbgKKfFQEHEX2cTKW8CdzBpgwg== X-Google-Smtp-Source: AGHT+IFZQ3ax/N0drEY0+73oHWhls+lJbdo0nM4KkZHvuZexiat75ugQIT56oVmm6BCVbWe7iBWn X-Received: by 2002:a05:6a00:2da5:b0:6e0:503f:f506 with SMTP id fb37-20020a056a002da500b006e0503ff506mr7816pfb.7.1707435184215; Thu, 08 Feb 2024 15:33:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707435184; cv=pass; d=google.com; s=arc-20160816; b=rONL8Mxek0QTP81+rr4x+nJf1xZDtwWODbZPKdxivxzSq2OaYDILOfeplBdydi5g6O fBAmpxm1NY6b6hlse+OtOkfBOcRRs8Ho/HdM7tiB4EtoeWFzFEHsn5FjN8Ln1n8gQXAM 9/8JzBk9xYRVHXUMInS9r4h46ZwJDkTUc9yRgMHJA4SVuHdAK4BkwKoV2FWI+IZETbzP R32Jmmwj9lqSx8mMzn59Otoeh/wq5WbD++9FvfDUqHHAl8l+K8g6tZATEnfiuxIFbVkF CS78KzZQz6c5syrqW7tEdAkqGC2O055RYiU24GJpMt+J0vYdtcenllTCqRwv828sRAUH BOlg== 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=mHdiPkTwI77CBZDDQZov9L8GR88QH6aklc6UOLvrTO4=; b=hvdChSvYiOy5edqxbbjqUHyAk0jKS8Ph38RGfd7IUOgWoXAUDrbjqrPF7BSHl/AvQ1 6BlXERFv5ABn5Vqh952UtJWV+XuPOKPOFZFu8euMHn4VBPm6MQpdvU+ktgxrCgI3OIFE Ok2RMDH7yh0q6RLDxnOuK+ZRoK5Qe4q3oO+RKlMO93VreJjvLIAL2MLhxKM8mGAT37v4 IO9/OQPXh27/I6Hal27M5E77I8ZWD3ZIuypOnbA2SBsDi2Dxh0FWN9cfyXmP1CghojpL iV4a3NosmcMKUYTAMIyhPN/ltbNdwCHiNV2pu8ofp+vrEohcHMV4fEmFgah5ilSbyTMS dxqw==; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58857-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com X-Forwarded-Encrypted: i=2; AJvYcCXsbecQ2CobHXLRLl6jKhIojc8BUCH8ZWp6qHIQuJgRNwfjyF55BVr8CAbE7zGpBfUVFJDHYTVmg5+P4DOft5nB+B1k27LIwo//s6Q0dA== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id y12-20020a62ce0c000000b006e02672acafsi484948pfg.38.2024.02.08.15.33.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 15:33:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58857-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58857-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id A5A3D28160E for ; Thu, 8 Feb 2024 23:33:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E3AEC63512; Thu, 8 Feb 2024 23:15:10 +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 To: , , , , , , , , , , , , , , CC: , , , , , , , Wesley Cheng 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: List-Subscribe: List-Unsubscribe: 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 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; }