From nobody Mon Jun 8 06:36:41 2026 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 3A4154192F3; Fri, 5 Jun 2026 09:28:27 +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=1780651708; cv=none; b=DPeGgAyMPoZXAJa4ecapddonXWRIdqV3OHMkkKqu5azm36BBu9jVsHjKzylf3ANtt1A+2kZMruJr7q0GPdAcAY/8JbUrB26GnRSRybd8wAZPujvX9kfhLABrN4d4GeO72DcJfKg1tHbje4jz0C3B6fYI4HCdDu0auuWUqU7/GPQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780651708; c=relaxed/simple; bh=g8AbOkSXcU/8GItxMeSd2As/AfiC03vjCGKOW/TEu6w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=YPaUqD9r1VxuT+H7xIFg07nvVu2lnSHX4tpVspterGfBMNoOg4JrORfaHjRQeoectIaqgF67cyFrS0kzImRvnj6XYoQzcRrUxLk3yzBxuO62wcisPG8BLD5VqJH86miVFJzyFCji4S5YBl3PjCL6wdq0onNX25yUjwHtJ84j9tA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=DozL1slw; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="DozL1slw" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6555q8KS2427809; Fri, 5 Jun 2026 09:28:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=dxvZiMITXar Y2Wg7jDIvSuF9WeIimNknXWUyES4VKvQ=; b=DozL1slwAOrbeNno2XIYZ1E0S5f EclMmpVoEZk0vf0eFOFSOFh3ua9kwkk2cTN8P4lRig4oN7Dv7Cqo3jzJAg9yuH/o 1tQaxVD5Vho9cJj3kMZ7teuuszOttOZJ0uEP5O3MMNtWwOGyj3FUFosWK0UbPJB3 NgzbfdNGEZk0AGOyPEgddJUvcZ1TZ5t+MVUSnbbvPGVOjoz9ZohIYFXkxyP7Mtm5 SyU0opFiqwsTyUN9IxL//uCUr+XK3vy56S3/WvXC3MVdpDkLt0jtMGKNUaSXT8N6 wElefNBjiGfd5ZJ4pMx2x3onUveoUogKHBvi8I1YpUxqJ6vNYUbN6sG2fPA== Received: from apblrppmta02.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ekrphgtu5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 05 Jun 2026 09:28:23 +0000 (GMT) Received: from hu-hgautam-hyd.qualcomm.com (hu-hgautam-hyd.qualcomm.com [10.147.247.91]) by APBLRPPMTA02.qualcomm.com (8.18.1.7/8.18.1.7) with ESMTP id 6559SFKA004866; Fri, 5 Jun 2026 09:28:17 GMT From: Harendra Gautam To: Srinivas Kandagatla Cc: Mark Brown , Liam Girdwood , linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] ASoC: qcom: Add generic of_xlate_dai_name helper to common Date: Fri, 5 Jun 2026 14:58:11 +0530 Message-Id: <20260605092812.3495852-2-harendra.gautam@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260605092812.3495852-1-harendra.gautam@oss.qualcomm.com> References: <20260605092812.3495852-1-harendra.gautam@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-QCInternal: smtphost X-Proofpoint-ORIG-GUID: EJCOxAhQoUkDYIRm4BfEPTkYoSmtYkCc X-Proofpoint-GUID: EJCOxAhQoUkDYIRm4BfEPTkYoSmtYkCc X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjA1MDA5MSBTYWx0ZWRfX0zon4syN9EAR 7JvumUdghPLEj2iEBoHUKWo0gB9wUXqlDXbUkeyEYCFbw55iHGHH+4jxmRW9pEadeRSywg7EF/F yOfr2ZADwQUPf3RUwlPE+0wKMBaL7qKGLkDUjsTfB9/q2t69ZbjBmx7UEdmIaXzd7v3swjV+T8K 6otP4cF+hca6DxA7i12o6M7V7keTorbWpv064gTfPTi1gE/60AW723U4qyyK3b7omms8qPRJrqx 10rsqqgRimuz8lAtmPXnchKUlgIJ/hIf/8VREo1KDeydgiuKHOZtyozUmBOA01tl0lnP9hCXjx0 zyWEnrDEMWDlnCLX/A6wkYWBy8xqN5rYfn8meCTYIohpD0RSeqDrtqsROQu3h1SzbUBGlK0pjpZ 6tk/OW0r0qRZwfYzPrkzdD8IEd6T0m0wb/3yHvPsTP3cA2BiUeHP/SZch3qX4sBWtMOFCTabDbN PIuk3qDl2Eh0JtBIHtA== X-Authority-Analysis: v=2.4 cv=T9a8ifKQ c=1 sm=1 tr=0 ts=6a2296b8 cx=c_pps a=Ou0eQOY4+eZoSc0qltEV5Q==:117 a=Ou0eQOY4+eZoSc0qltEV5Q==:17 a=FelO9ux0wxsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=EUspDBNiAAAA:8 a=oUFy9JDnOWMlxJQm5LIA:9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-05_01,2026-05-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 clxscore=1011 bulkscore=0 adultscore=0 priorityscore=1501 phishscore=0 spamscore=0 lowpriorityscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606050091 Content-Type: text/plain; charset="utf-8" Multiple Qualcomm ASoC CPU DAI drivers need to resolve a sound-dai phandle argument to a DAI name by searching the component's DAI driver array by ID. Each driver currently implements this identically. Extract the common logic into asoc_qcom_of_xlate_dai_name() in common.c so it can be shared across drivers without duplication. Signed-off-by: Harendra Gautam --- sound/soc/qcom/common.c | 34 ++++++++++++++++++++++++++++++++++ sound/soc/qcom/common.h | 5 +++++ 2 files changed, 39 insertions(+) diff --git a/sound/soc/qcom/common.c b/sound/soc/qcom/common.c index cf1f3a767cee..46569290d44c 100644 --- a/sound/soc/qcom/common.c +++ b/sound/soc/qcom/common.c @@ -23,6 +23,40 @@ static const struct snd_soc_dapm_widget qcom_jack_snd_wi= dgets[] =3D { SND_SOC_DAPM_SPK("DP7 Jack", NULL), }; =20 +/** + * asoc_qcom_of_xlate_dai_name - Resolve a sound-dai phandle argument to a + * DAI name by searching the DAI driver arra= y. + * @dai_drv: Array of DAI drivers registered by the component. + * @num_dai: Number of entries in @dai_drv. + * @args: Phandle arguments from the sound-dai property; args[0] is the + * DAI ID. + * @dai_name: Output pointer set to the matched DAI name on success. + * + * Returns 0 on success, -EINVAL if args_count !=3D 1 or no match is found. + */ +int asoc_qcom_of_xlate_dai_name(const struct snd_soc_dai_driver *dai_drv, + int num_dai, + const struct of_phandle_args *args, + const char **dai_name) +{ + int id, i; + + if (args->args_count !=3D 1) + return -EINVAL; + + id =3D args->args[0]; + + for (i =3D 0; i < num_dai; i++) { + if (dai_drv[i].id =3D=3D id) { + *dai_name =3D dai_drv[i].name; + return 0; + } + } + + return -EINVAL; +} +EXPORT_SYMBOL_GPL(asoc_qcom_of_xlate_dai_name); + int qcom_snd_parse_of(struct snd_soc_card *card) { struct device_node *np; diff --git a/sound/soc/qcom/common.h b/sound/soc/qcom/common.h index ee6662885593..5baf51a39c97 100644 --- a/sound/soc/qcom/common.h +++ b/sound/soc/qcom/common.h @@ -6,6 +6,7 @@ =20 #include #include +#include =20 #define LPASS_MAX_PORT (SENARY_MI2S_TX + 1) =20 @@ -15,5 +16,9 @@ int qcom_snd_wcd_jack_setup(struct snd_soc_pcm_runtime *r= td, int qcom_snd_dp_jack_setup(struct snd_soc_pcm_runtime *rtd, struct snd_soc_jack *dp_jack, int id); =20 +int asoc_qcom_of_xlate_dai_name(const struct snd_soc_dai_driver *dai_drv, + int num_dai, + const struct of_phandle_args *args, + const char **dai_name); =20 #endif --=20 2.34.1 From nobody Mon Jun 8 06:36:41 2026 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 AD8DF4192EA; Fri, 5 Jun 2026 09:28:26 +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=1780651707; cv=none; b=eTSUgfOK20nyrQwCbBToBuLUbB3FDb4YAqvzGJBPJ2CctQBO3YJzbRYWtLpdF08C21wE55PUhN9qSn90FKV1OpNcrcL0QB9uA/vkrALJdIlFXNNiTZrF8ausSwVAxDPgBufnQbBVRcEM/hXDZ3fXWZpbHDsOQ2WBfeq31JSJaOU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780651707; c=relaxed/simple; bh=nF1bRL+0i+sdOb4OP2N9xnfU/mirbjvsHliu1OlK+mg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=nrK67N5J4goPDywph1TFBb1XwdrF9SqkyGmT8HvLT6eyVLUWoryDwyxixCWBktJ3T5gOOzk4W5OiKrN9A7ZH64LpvdJ5H9youXezetDuEuRds1KV2ifr8wa+M80zzKlERL9lY+00CzMI7xXOipNmQBUkisWYA2m4GhvdPwyxSWU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=TRD1+2CJ; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="TRD1+2CJ" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 655757PK3529092; Fri, 5 Jun 2026 09:28:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=pkfnQ/nPGko XdiZ9aGhJnWQ3C2t7kl778gfFKiG53m0=; b=TRD1+2CJRW7h9DikViofCGRvPDz jG6U0VQ8tM2mgF3xdrTg06eXOpd/fTkxT4rRAUTVwvFuhnnR5gMa7HRl3fW8ZeDU k2vsRdKiHD7e59DiqQhStzFExLhUZegsohsT6XDJPv6eAItKvZ1BnrNAhqy2dr47 diRGEQmO0Br91T/7oSVIRqELxQUXDKLu4FhsbNR7F6o5mSxwGihdqvIW9jQjilab eiW8tMi0fP7dJJLYWS8LWZlX1AFhFlWxa2NTnge5mafFG+r5yMjpUgEBm7s3+a9q tTOvLtXkuFpyzzyg6hudYmo+Vkdrc8Dte1fiYyZzKp4HET21tuVLwV1Ps/w== Received: from apblrppmta02.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4eksrp8hpf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 05 Jun 2026 09:28:23 +0000 (GMT) Received: from hu-hgautam-hyd.qualcomm.com (hu-hgautam-hyd.qualcomm.com [10.147.247.91]) by APBLRPPMTA02.qualcomm.com (8.18.1.7/8.18.1.7) with ESMTP id 6559SFKB004866; Fri, 5 Jun 2026 09:28:20 GMT From: Harendra Gautam To: Srinivas Kandagatla Cc: Mark Brown , Liam Girdwood , linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] ASoC: qcom: lpass-cpu: Use asoc_qcom_of_xlate_dai_name helper Date: Fri, 5 Jun 2026 14:58:12 +0530 Message-Id: <20260605092812.3495852-3-harendra.gautam@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260605092812.3495852-1-harendra.gautam@oss.qualcomm.com> References: <20260605092812.3495852-1-harendra.gautam@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-QCInternal: smtphost X-Proofpoint-GUID: rp6NMYJ0jFYm2hTWmaOG-LAdZF1iEqiE X-Proofpoint-ORIG-GUID: rp6NMYJ0jFYm2hTWmaOG-LAdZF1iEqiE X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjA1MDA5MSBTYWx0ZWRfX1lgyItRhPDln qSQk7K+jCX4xIDT1DqnkBH9DVrWKDVl4qowbYE1D/TXqH8ligYdXrLO/UgoFErDy9AToMy5cNwQ CVf+Fxklh/W5hQfQDty9C/qnUIU7XlArv0GNdikGQbxvsI915S3jtfIAoMdV3v8lc396fWKbpvu sIgyFGp1mczRPgBFfBB7RzQVrfQ9y6Z/MSMRSWACqHHiEt34vxz+htIJ3/ps8WIDvlHQH8zII1b r2OeAk0CXyQXH7woC4H35VdgTgpgqKYQf/c61lb0gvc5+5+TiF6cYlS+oizQB4JqewJpGZDnUmw 44YP+5tjKcgRMrDpDh5SQW+DeuLxekz5rhZ16H6o/+4YUPuclSNNbqf7m9cTM0RN6Cb1lRnhxBD GIDWzUeQ5vKQm66zE3P/cNi3OCV3iR812fPXfxhGuHO06C1X1zQKMGR55WQJXk48Rsf/kizBl9I OVvKdb4ujEh5MmFZEgw== X-Authority-Analysis: v=2.4 cv=bJEm5v+Z c=1 sm=1 tr=0 ts=6a2296b8 cx=c_pps a=Ou0eQOY4+eZoSc0qltEV5Q==:117 a=Ou0eQOY4+eZoSc0qltEV5Q==:17 a=FelO9ux0wxsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=EUspDBNiAAAA:8 a=Hfps_RfwFyUEpd0PCboA:9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-05_01,2026-05-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 spamscore=0 impostorscore=0 adultscore=0 clxscore=1011 malwarescore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606050091 Content-Type: text/plain; charset="utf-8" Replace the private static asoc_qcom_of_xlate_dai_name() implementation in lpass-cpu.c with a thin wrapper that calls the new shared helper from common.c. This removes the duplicate implementation. Signed-off-by: Harendra Gautam --- sound/soc/qcom/lpass-cpu.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c index 242bc16da36d..35c2c8030024 100644 --- a/sound/soc/qcom/lpass-cpu.c +++ b/sound/soc/qcom/lpass-cpu.c @@ -18,6 +18,7 @@ #include #include "lpass-lpaif-reg.h" #include "lpass.h" +#include "common.h" =20 #define LPASS_CPU_MAX_MI2S_LINES 4 #define LPASS_CPU_I2S_SD0_MASK BIT(0) @@ -458,30 +459,20 @@ const struct snd_soc_dai_ops asoc_qcom_lpass_cpu_dai_= ops2 =3D { }; EXPORT_SYMBOL_GPL(asoc_qcom_lpass_cpu_dai_ops2); =20 -static int asoc_qcom_of_xlate_dai_name(struct snd_soc_component *component, +static int lpass_cpu_of_xlate_dai_name(struct snd_soc_component *component, const struct of_phandle_args *args, const char **dai_name) { struct lpass_data *drvdata =3D snd_soc_component_get_drvdata(component); const struct lpass_variant *variant =3D drvdata->variant; - int id =3D args->args[0]; - int ret =3D -EINVAL; - int i; =20 - for (i =3D 0; i < variant->num_dai; i++) { - if (variant->dai_driver[i].id =3D=3D id) { - *dai_name =3D variant->dai_driver[i].name; - ret =3D 0; - break; - } - } - - return ret; + return asoc_qcom_of_xlate_dai_name(variant->dai_driver, + variant->num_dai, args, dai_name); } =20 static const struct snd_soc_component_driver lpass_cpu_comp_driver =3D { .name =3D "lpass-cpu", - .of_xlate_dai_name =3D asoc_qcom_of_xlate_dai_name, + .of_xlate_dai_name =3D lpass_cpu_of_xlate_dai_name, .legacy_dai_naming =3D 1, }; =20 --=20 2.34.1