From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) (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 DB18E222584 for ; Thu, 19 Jun 2025 10:26:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750328801; cv=none; b=MdXEibxp7vsu4Ksq3JqN7/udktehO8UKpzIuIxBhmABAMMdeExRAC68b69EQFYEDkckh2nSFrLL3XOdlDFOYI2NHMvjkukefCGJGxVpHfxNcBvS8V1/GBj1+9awgvFtfz6p/EoUCMO5vA4jphelmSmE3z3L+bpCAlOwS289vP6U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750328801; c=relaxed/simple; bh=z/AQOkQFF3YmlHZ0CJkuMwP+A3XSMo+mKkKoH6rWZkk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=vAwIaSFv5A9vQUR5LHAlgJAcPKoMg5FIjMf4S8Ua1ioVAs2BrcoSph6H7ERirvAfAlQL04IUOtR+oAUjJ19xUSK1WPNN3JyuM5GuVevty5rNlG6JR8gzrXKYvwsqO6dHZnhow2QnuxfGQTkkb5izE/vlAas0HULimIkcJEZ9YyY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=P8q8DLfy; arc=none smtp.client-ip=198.175.65.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="P8q8DLfy" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1750328800; x=1781864800; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=z/AQOkQFF3YmlHZ0CJkuMwP+A3XSMo+mKkKoH6rWZkk=; b=P8q8DLfyihjMr+/J6qnR5KNeB50pJ0m+eobZCIIoqBAX4DzHePd2PjJP 8x9unkDXmhXmaO4UbuEOj6BKhUsmxZsd5S0Day1Sf085HnADv37sEd2ss 28J5nyYAaX+n+b1IAx1jpPibfz7a1b5UHC2OX9eWVPgMPzVSwiJG2VM3k TQfaWy1PGXbt0om+t3K6HzhhnBbsXVXMljp0m8ku/aOEnTNpn8nII68U+ 6HxKWPJq3C8Sckr9Jp/5IUkwFRjrdblQsjXcWRDtnfcfxTyjL5Hxrtv/1 B1I4WqbwrRs4MxRZvPJZ7uxs+mtHZH0DqVIx9tGywvMhk/wsflCFNOgYA A==; X-CSE-ConnectionGUID: sf+RiEt/SMGRfYD6mkDwWw== X-CSE-MsgGUID: UVwADPoGRx+Zu6idmCnSrA== X-IronPort-AV: E=McAfee;i="6800,10657,11468"; a="64008399" X-IronPort-AV: E=Sophos;i="6.16,248,1744095600"; d="scan'208";a="64008399" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jun 2025 03:26:38 -0700 X-CSE-ConnectionGUID: eX/V4XWkTkyfauLjyDxs5A== X-CSE-MsgGUID: MzU6tFJ/T8eKpeRlq+/X1w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.16,248,1744095600"; d="scan'208";a="155174248" Received: from fdefranc-mobl3.ger.corp.intel.com (HELO pujfalus-desk.intel.com) ([10.245.246.182]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jun 2025 03:26:36 -0700 From: Peter Ujfalusi To: lgirdwood@gmail.com, broonie@kernel.org Cc: linux-sound@vger.kernel.org, kai.vehmanen@linux.intel.com, ranjani.sridharan@linux.intel.com, yung-chuan.liao@linux.intel.com, pierre-louis.bossart@linux.dev Subject: [PATCH] ASoC: SOF: topology: Parse the dapm_widget_tokens in case of DSPless mode Date: Thu, 19 Jun 2025 13:26:40 +0300 Message-ID: <20250619102640.12068-1-peter.ujfalusi@linux.intel.com> X-Mailer: git-send-email 2.49.0 Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Parsing the dapm_widget_tokens is also needed for DSPless mode as it is setting the snd_soc_dapm_widget.no_wname_in_kcontrol_name flag for the kcontrol creation from DAPM widgets. Without that flag set, the following warnings might appear because of long control names: ALSA: Control name 'eqiir.2.1 Post Mixer Analog Playback IIR Eq bytes' truncated to 'eqiir.2.1 Post Mixer Analog Playback IIR Eq' ALSA: Control name 'eqfir.2.1 Post Mixer Analog Playback FIR Eq bytes' truncated to 'eqfir.2.1 Post Mixer Analog Playback FIR Eq' ALSA: Control name 'drc.2.1 Post Mixer Analog Playback DRC bytes' truncated to 'drc.2.1 Post Mixer Analog Playback DRC byte' ALSA: Control name 'drc.2.1 Post Mixer Analog Playback DRC switch' truncated to 'drc.2.1 Post Mixer Analog Playback DRC swit' ALSA: Control name 'gain.15.1 Pre Mixer Deepbuffer HDA Analog Volume' truncated to 'gain.15.1 Pre Mixer Deepbuffer HDA Analog V' Signed-off-by: Peter Ujfalusi Reviewed-by: Liam Girdwood Reviewed-by: Ranjani Sridharan --- sound/soc/sof/topology.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c index d612d693efc3..b6d5c8024f8c 100644 --- a/sound/soc/sof/topology.c +++ b/sound/soc/sof/topology.c @@ -2378,14 +2378,25 @@ static int sof_dspless_widget_ready(struct snd_soc_component *scomp, int index, struct snd_soc_dapm_widget *w, struct snd_soc_tplg_dapm_widget *tw) { + struct snd_soc_tplg_private *priv = &tw->priv; + int ret; + + /* for snd_soc_dapm_widget.no_wname_in_kcontrol_name */ + ret = sof_parse_tokens(scomp, w, dapm_widget_tokens, + ARRAY_SIZE(dapm_widget_tokens), + priv->array, le32_to_cpu(priv->size)); + if (ret < 0) { + dev_err(scomp->dev, "failed to parse dapm widget tokens for %s\n", + w->name); + return ret; + } + if (WIDGET_IS_DAI(w->id)) { static const struct sof_topology_token dai_tokens[] = { {SOF_TKN_DAI_TYPE, SND_SOC_TPLG_TUPLE_TYPE_STRING, get_token_dai_type, 0}}; struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp); - struct snd_soc_tplg_private *priv = &tw->priv; struct snd_sof_widget *swidget; struct snd_sof_dai *sdai; - int ret; swidget = kzalloc(sizeof(*swidget), GFP_KERNEL); if (!swidget) -- 2.49.0