]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
ASoC: sdw_utils: Remove num_platforms from simple DAI helper
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Mon, 5 May 2025 14:14:08 +0000 (15:14 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 5 May 2025 22:48:39 +0000 (07:48 +0900)
There is no point in passing num_platforms into
asoc_sdw_init_simple_dai_link(). Firstly, as a single pointer for the
component name is passed in only a single string can be passed and
secondly if it is a complex DAI with multiple platforms it would make
more sense to use asoc_sdw_init_dai_link().

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250505141409.2614010-2-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/soc_sdw_utils.h
sound/soc/amd/acp/acp-sdw-legacy-mach.c
sound/soc/amd/acp/acp-sdw-sof-mach.c
sound/soc/intel/boards/sof_sdw.c
sound/soc/sdw_utils/soc_sdw_utils.c

index d8bd5d37131aa0751110b98a5642b429ff191336..b63021f5afafa02103ade57e688e259f5694dfd0 100644 (file)
@@ -159,9 +159,8 @@ void asoc_sdw_init_dai_link(struct device *dev, struct snd_soc_dai_link *dai_lin
 int asoc_sdw_init_simple_dai_link(struct device *dev, struct snd_soc_dai_link *dai_links,
                                  int *be_id, char *name, int playback, int capture,
                                  const char *cpu_dai_name, const char *platform_comp_name,
-                                 int num_platforms, const char *codec_name,
-                                 const char *codec_dai_name, int no_pcm,
-                                 int (*init)(struct snd_soc_pcm_runtime *rtd),
+                                 const char *codec_name, const char *codec_dai_name,
+                                 int no_pcm, int (*init)(struct snd_soc_pcm_runtime *rtd),
                                  const struct snd_soc_ops *ops);
 
 int asoc_sdw_count_sdw_endpoints(struct snd_soc_card *card, int *num_devs, int *num_ends);
index 2020c5cfb3d5d773349f5c0c4ca847c6cfe7202f..0bb06cb7d0f91e556f3282c73c7ccb6ee937efee 100644 (file)
@@ -321,7 +321,7 @@ static int create_dmic_dailinks(struct snd_soc_card *card,
        *be_id = ACP_DMIC_BE_ID;
        ret = asoc_sdw_init_simple_dai_link(dev, *dai_links, be_id, "acp-dmic-codec",
                                            0, 1, // DMIC only supports capture
-                                           pdm_cpu->name, pdm_platform->name, 1,
+                                           pdm_cpu->name, pdm_platform->name,
                                            "dmic-codec.0", "dmic-hifi", no_pcm,
                                            asoc_sdw_dmic_init, NULL);
        if (ret)
index c09b1f118a6cc1d0626fcb7542c6ea437aeeb275..2141ccb8329d3efbc917365a677d28e3e4e9ea2a 100644 (file)
@@ -245,7 +245,6 @@ static int create_dmic_dailinks(struct snd_soc_card *card,
        ret = asoc_sdw_init_simple_dai_link(dev, *dai_links, be_id, "acp-dmic-codec",
                                            0, 1, // DMIC only supports capture
                                            "acp-sof-dmic", platform_component->name,
-                                           ARRAY_SIZE(platform_component),
                                            "dmic-codec", "dmic-hifi", no_pcm,
                                            asoc_sdw_dmic_init, NULL);
        if (ret)
index 095d08b3fc8249429cc7cbab6ed843879a3fcf6b..29b813943cccbf9ca41b03235cfd2bce3db2c4ab 100644 (file)
@@ -994,8 +994,7 @@ static int create_ssp_dailinks(struct snd_soc_card *card,
 
                ret = asoc_sdw_init_simple_dai_link(dev, *dai_links, be_id, name,
                                                    playback, capture, cpu_dai_name,
-                                                   platform_component->name,
-                                                   ARRAY_SIZE(platform_component), codec_name,
+                                                   platform_component->name, codec_name,
                                                    ssp_info->dais[0].dai_name, 1, NULL,
                                                    ssp_info->ops);
                if (ret)
@@ -1020,7 +1019,6 @@ static int create_dmic_dailinks(struct snd_soc_card *card,
        ret = asoc_sdw_init_simple_dai_link(dev, *dai_links, be_id, "dmic01",
                                            0, 1, // DMIC only supports capture
                                            "DMIC01 Pin", platform_component->name,
-                                           ARRAY_SIZE(platform_component),
                                            "dmic-codec", "dmic-hifi", 1,
                                            asoc_sdw_dmic_init, NULL);
        if (ret)
@@ -1031,7 +1029,6 @@ static int create_dmic_dailinks(struct snd_soc_card *card,
        ret = asoc_sdw_init_simple_dai_link(dev, *dai_links, be_id, "dmic16k",
                                            0, 1, // DMIC only supports capture
                                            "DMIC16k Pin", platform_component->name,
-                                           ARRAY_SIZE(platform_component),
                                            "dmic-codec", "dmic-hifi", 1,
                                            /* don't call asoc_sdw_dmic_init() twice */
                                            NULL, NULL);
@@ -1075,7 +1072,6 @@ static int create_hdmi_dailinks(struct snd_soc_card *card,
                ret = asoc_sdw_init_simple_dai_link(dev, *dai_links, be_id, name,
                                                    1, 0, // HDMI only supports playback
                                                    cpu_dai_name, platform_component->name,
-                                                   ARRAY_SIZE(platform_component),
                                                    codec_name, codec_dai_name, 1,
                                                    i == 0 ? sof_sdw_hdmi_init : NULL, NULL);
                if (ret)
@@ -1102,7 +1098,6 @@ static int create_bt_dailinks(struct snd_soc_card *card,
 
        ret = asoc_sdw_init_simple_dai_link(dev, *dai_links, be_id, name,
                                            1, 1, cpu_dai_name, platform_component->name,
-                                           ARRAY_SIZE(platform_component),
                                            snd_soc_dummy_dlc.name, snd_soc_dummy_dlc.dai_name,
                                            1, NULL, NULL);
        if (ret)
index 5175818ff2c1f825d56f1150c3b40915cbc1a115..77b0eeb3e2f7f02cc8f21409d0b2fefb2629a497 100644 (file)
@@ -1059,9 +1059,8 @@ EXPORT_SYMBOL_NS(asoc_sdw_init_dai_link, "SND_SOC_SDW_UTILS");
 int asoc_sdw_init_simple_dai_link(struct device *dev, struct snd_soc_dai_link *dai_links,
                                  int *be_id, char *name, int playback, int capture,
                                  const char *cpu_dai_name, const char *platform_comp_name,
-                                 int num_platforms, const char *codec_name,
-                                 const char *codec_dai_name, int no_pcm,
-                                 int (*init)(struct snd_soc_pcm_runtime *rtd),
+                                 const char *codec_name, const char *codec_dai_name,
+                                 int no_pcm, int (*init)(struct snd_soc_pcm_runtime *rtd),
                                  const struct snd_soc_ops *ops)
 {
        struct snd_soc_dai_link_component *dlc;
@@ -1078,8 +1077,8 @@ int asoc_sdw_init_simple_dai_link(struct device *dev, struct snd_soc_dai_link *d
        dlc[2].dai_name = codec_dai_name;
 
        asoc_sdw_init_dai_link(dev, dai_links, be_id, name, playback, capture,
-                              &dlc[0], 1, &dlc[1], num_platforms,
-                              &dlc[2], 1, no_pcm, init, ops);
+                              &dlc[0], 1, &dlc[1], 1, &dlc[2], 1,
+                              no_pcm, init, ops);
 
        return 0;
 }