Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Cezary Rojewski <cezary.rojewski@intel.com>
To: broonie@kernel.org
Cc: tiwai@suse.com, perex@perex.cz,
	amadeuszx.slawinski@linux.intel.com, linux-sound@vger.kernel.org,
	Cezary Rojewski <cezary.rojewski@intel.com>
Subject: [PATCH 4/4] ASoC: Intel: avs: Streamline register-component function names
Date: Mon, 18 Aug 2025 12:41:26 +0200	[thread overview]
Message-ID: <20250818104126.526442-5-cezary.rojewski@intel.com> (raw)
In-Reply-To: <20250818104126.526442-1-cezary.rojewski@intel.com>

Word 'component' is commonly used in ASoC when referring to any
component, regardless if it is a platform-type or codec-type component.
Reword all avs_xxx_platform_register() to match the scheme present in
ASoC's core. In case of avs_soc_component_register(), the name is
simplified.

Summary:
- avs_xxx_platform_register() -> avs_register_xxx_component()
- avs_soc_component_register() -> avs_register_component()

Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
---
 sound/soc/intel/avs/avs.h             | 14 +++++++-------
 sound/soc/intel/avs/board_selection.c |  9 +++++----
 sound/soc/intel/avs/debug.h           |  4 ++--
 sound/soc/intel/avs/pcm.c             | 23 +++++++++++------------
 sound/soc/intel/avs/probes.c          |  2 +-
 5 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/sound/soc/intel/avs/avs.h b/sound/soc/intel/avs/avs.h
index 2be35c19d6ee..95f9ac2683c0 100644
--- a/sound/soc/intel/avs/avs.h
+++ b/sound/soc/intel/avs/avs.h
@@ -348,13 +348,13 @@ struct avs_soc_component {
 
 extern const struct snd_soc_dai_ops avs_dai_fe_ops;
 
-int avs_soc_component_register(struct device *dev, const char *name,
-			       struct snd_soc_component_driver *drv,
-			       struct snd_soc_dai_driver *cpu_dais, int num_cpu_dais);
-int avs_dmic_platform_register(struct avs_dev *adev, const char *name);
-int avs_i2s_platform_register(struct avs_dev *adev, const char *name, unsigned long port_mask,
-			      unsigned long *tdms);
-int avs_hda_platform_register(struct avs_dev *adev, const char *name);
+int avs_register_dmic_component(struct avs_dev *adev, const char *name);
+int avs_register_i2s_component(struct avs_dev *adev, const char *name, unsigned long port_mask,
+			       unsigned long *tdms);
+int avs_register_hda_component(struct avs_dev *adev, const char *name);
+int avs_register_component(struct device *dev, const char *name,
+			   struct snd_soc_component_driver *drv,
+			   struct snd_soc_dai_driver *cpu_dais, int num_cpu_dais);
 
 int avs_register_all_boards(struct avs_dev *adev);
 void avs_unregister_all_boards(struct avs_dev *adev);
diff --git a/sound/soc/intel/avs/board_selection.c b/sound/soc/intel/avs/board_selection.c
index 9eb59d5a73f7..e1d6fa344aa1 100644
--- a/sound/soc/intel/avs/board_selection.c
+++ b/sound/soc/intel/avs/board_selection.c
@@ -18,6 +18,7 @@
 #include <sound/soc-component.h>
 #include "avs.h"
 #include "debug.h"
+#include "pcm.h"
 #include "utils.h"
 
 static char *i2s_test;
@@ -410,7 +411,7 @@ static int __maybe_unused avs_register_probe_board(struct avs_dev *adev)
 	struct snd_soc_acpi_mach mach = {{0}};
 	int ret;
 
-	ret = avs_probe_platform_register(adev, "probe-platform");
+	ret = avs_register_probe_component(adev, "probe-platform");
 	if (ret < 0)
 		return ret;
 
@@ -455,7 +456,7 @@ static int avs_register_dmic_board(struct avs_dev *adev)
 		return ret;
 	}
 
-	ret = avs_dmic_platform_register(adev, "dmic-platform");
+	ret = avs_register_dmic_component(adev, "dmic-platform");
 	if (ret < 0)
 		return ret;
 
@@ -516,7 +517,7 @@ static int avs_register_i2s_board(struct avs_dev *adev, struct snd_soc_acpi_mach
 	if (!name)
 		return -ENOMEM;
 
-	ret = avs_i2s_platform_register(adev, name, mach->mach_params.i2s_link_mask, pdata->tdms);
+	ret = avs_register_i2s_component(adev, name, mach->mach_params.i2s_link_mask, pdata->tdms);
 	if (ret < 0)
 		return ret;
 
@@ -655,7 +656,7 @@ static int avs_register_hda_board(struct avs_dev *adev, struct hda_codec *codec)
 	pdata->obsolete_card_names = obsolete_card_names;
 	pdata->codec = codec;
 
-	ret = avs_hda_platform_register(adev, pname);
+	ret = avs_register_hda_component(adev, pname);
 	if (ret < 0)
 		return ret;
 
diff --git a/sound/soc/intel/avs/debug.h b/sound/soc/intel/avs/debug.h
index 9f0f6f3b2bde..94fe8729a5c1 100644
--- a/sound/soc/intel/avs/debug.h
+++ b/sound/soc/intel/avs/debug.h
@@ -50,7 +50,7 @@ static_assert(sizeof(struct avs_apl_log_buffer_layout) == 8);
 	(addr + sizeof(struct avs_apl_log_buffer_layout))
 
 #ifdef CONFIG_DEBUG_FS
-int avs_probe_platform_register(struct avs_dev *adev, const char *name);
+int avs_register_probe_component(struct avs_dev *adev, const char *name);
 
 #define AVS_SET_ENABLE_LOGS_OP(name) \
 	.enable_logs = avs_##name##_enable_logs
@@ -63,7 +63,7 @@ void avs_debugfs_init(struct avs_dev *adev);
 void avs_debugfs_exit(struct avs_dev *adev);
 
 #else
-static inline int avs_probe_platform_register(struct avs_dev *adev, const char *name)
+static inline int avs_register_probe_component(struct avs_dev *adev, const char *name)
 {
 	return -EOPNOTSUPP;
 }
diff --git a/sound/soc/intel/avs/pcm.c b/sound/soc/intel/avs/pcm.c
index e738deb2d314..d31058e2de5b 100644
--- a/sound/soc/intel/avs/pcm.c
+++ b/sound/soc/intel/avs/pcm.c
@@ -1379,9 +1379,9 @@ static struct snd_soc_component_driver avs_component_driver = {
 	.topology_name_prefix	= "intel/avs",
 };
 
-int avs_soc_component_register(struct device *dev, const char *name,
-			       struct snd_soc_component_driver *drv,
-			       struct snd_soc_dai_driver *cpu_dais, int num_cpu_dais)
+int avs_register_component(struct device *dev, const char *name,
+			   struct snd_soc_component_driver *drv,
+			   struct snd_soc_dai_driver *cpu_dais, int num_cpu_dais)
 {
 	struct avs_soc_component *acomp;
 	int ret;
@@ -1428,7 +1428,7 @@ static struct snd_soc_dai_driver dmic_cpu_dais[] = {
 },
 };
 
-int avs_dmic_platform_register(struct avs_dev *adev, const char *name)
+int avs_register_dmic_component(struct avs_dev *adev, const char *name)
 {
 	const struct snd_soc_dai_ops *ops;
 
@@ -1439,8 +1439,8 @@ int avs_dmic_platform_register(struct avs_dev *adev, const char *name)
 
 	dmic_cpu_dais[0].ops = ops;
 	dmic_cpu_dais[1].ops = ops;
-	return avs_soc_component_register(adev->dev, name, &avs_component_driver, dmic_cpu_dais,
-					  ARRAY_SIZE(dmic_cpu_dais));
+	return avs_register_component(adev->dev, name, &avs_component_driver, dmic_cpu_dais,
+				      ARRAY_SIZE(dmic_cpu_dais));
 }
 
 static const struct snd_soc_dai_driver i2s_dai_template = {
@@ -1472,8 +1472,8 @@ static const struct snd_soc_dai_driver i2s_dai_template = {
 	},
 };
 
-int avs_i2s_platform_register(struct avs_dev *adev, const char *name, unsigned long port_mask,
-			      unsigned long *tdms)
+int avs_register_i2s_component(struct avs_dev *adev, const char *name, unsigned long port_mask,
+			       unsigned long *tdms)
 {
 	struct snd_soc_dai_driver *cpus, *dai;
 	const struct snd_soc_dai_ops *ops;
@@ -1539,7 +1539,7 @@ int avs_i2s_platform_register(struct avs_dev *adev, const char *name, unsigned l
 	}
 
 plat_register:
-	return avs_soc_component_register(adev->dev, name, &avs_component_driver, cpus, cpu_count);
+	return avs_register_component(adev->dev, name, &avs_component_driver, cpus, cpu_count);
 }
 
 /* HD-Audio CPU DAI template */
@@ -1764,8 +1764,7 @@ static struct snd_soc_component_driver avs_hda_component_driver = {
 	.topology_name_prefix	= "intel/avs",
 };
 
-int avs_hda_platform_register(struct avs_dev *adev, const char *name)
+int avs_register_hda_component(struct avs_dev *adev, const char *name)
 {
-	return avs_soc_component_register(adev->dev, name,
-					  &avs_hda_component_driver, NULL, 0);
+	return avs_register_component(adev->dev, name, &avs_hda_component_driver, NULL, 0);
 }
diff --git a/sound/soc/intel/avs/probes.c b/sound/soc/intel/avs/probes.c
index 88c6d385c73c..c7b70006354a 100644
--- a/sound/soc/intel/avs/probes.c
+++ b/sound/soc/intel/avs/probes.c
@@ -291,7 +291,7 @@ static const struct snd_soc_component_driver avs_probe_component_driver = {
 	.module_get_upon_open	= 1, /* increment refcount when a stream is opened */
 };
 
-int avs_probe_platform_register(struct avs_dev *adev, const char *name)
+int avs_register_probe_component(struct avs_dev *adev, const char *name)
 {
 	struct snd_soc_component *component;
 	int ret;
-- 
2.25.1


  parent reply	other threads:[~2025-08-18 10:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-18 10:41 [PATCH 0/4] ASoC: Intel: avs: Code cleanups and separation Cezary Rojewski
2025-08-18 10:41 ` [PATCH 1/4] ASoC: Intel: avs: Separate debug symbols Cezary Rojewski
2025-08-18 10:41 ` [PATCH 2/4] ASoC: Intel: avs: Drop pcm.h dependency for probes Cezary Rojewski
2025-08-18 10:41 ` [PATCH 3/4] ASoC: Intel: avs: Do not share the name pointer between components Cezary Rojewski
2025-08-18 10:41 ` Cezary Rojewski [this message]
2025-08-19 19:46 ` [PATCH 0/4] ASoC: Intel: avs: Code cleanups and separation Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250818104126.526442-5-cezary.rojewski@intel.com \
    --to=cezary.rojewski@intel.com \
    --cc=amadeuszx.slawinski@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox