Commit 1d5a2b5d authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: soc.h: convert asoc_xxx() to snd_soc_xxx()

ASoC is using 2 type of prefix (asoc_xxx() vs snd_soc_xxx()), but there
is no particular reason about that [1].
To reduce confusing, standarding these to snd_soc_xxx() is sensible.

This patch adds asoc_xxx() macro to keep compatible for a while.
It will be removed if all drivers were switched to new style.

Link: https://lore.kernel.org/r/87h6td3hus.wl-kuninori.morimoto.gx@renesas.com [1]
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87fs3ks26i.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 39fce972
...@@ -115,8 +115,8 @@ struct snd_soc_dai *snd_soc_card_get_codec_dai(struct snd_soc_card *card, ...@@ -115,8 +115,8 @@ struct snd_soc_dai *snd_soc_card_get_codec_dai(struct snd_soc_card *card,
struct snd_soc_pcm_runtime *rtd; struct snd_soc_pcm_runtime *rtd;
for_each_card_rtds(card, rtd) { for_each_card_rtds(card, rtd) {
if (!strcmp(asoc_rtd_to_codec(rtd, 0)->name, dai_name)) if (!strcmp(snd_soc_rtd_to_codec(rtd, 0)->name, dai_name))
return asoc_rtd_to_codec(rtd, 0); return snd_soc_rtd_to_codec(rtd, 0);
} }
return NULL; return NULL;
......
...@@ -775,37 +775,42 @@ struct snd_soc_dai_link { ...@@ -775,37 +775,42 @@ struct snd_soc_dai_link {
#endif #endif
}; };
/* REMOVE ME */
#define asoc_link_to_cpu snd_soc_link_to_cpu
#define asoc_link_to_codec snd_soc_link_to_codec
#define asoc_link_to_platform snd_soc_link_to_platform
static inline struct snd_soc_dai_link_component* static inline struct snd_soc_dai_link_component*
asoc_link_to_cpu(struct snd_soc_dai_link *link, int n) { snd_soc_link_to_cpu(struct snd_soc_dai_link *link, int n) {
return &(link)->cpus[n]; return &(link)->cpus[n];
} }
static inline struct snd_soc_dai_link_component* static inline struct snd_soc_dai_link_component*
asoc_link_to_codec(struct snd_soc_dai_link *link, int n) { snd_soc_link_to_codec(struct snd_soc_dai_link *link, int n) {
return &(link)->codecs[n]; return &(link)->codecs[n];
} }
static inline struct snd_soc_dai_link_component* static inline struct snd_soc_dai_link_component*
asoc_link_to_platform(struct snd_soc_dai_link *link, int n) { snd_soc_link_to_platform(struct snd_soc_dai_link *link, int n) {
return &(link)->platforms[n]; return &(link)->platforms[n];
} }
#define for_each_link_codecs(link, i, codec) \ #define for_each_link_codecs(link, i, codec) \
for ((i) = 0; \ for ((i) = 0; \
((i) < link->num_codecs) && \ ((i) < link->num_codecs) && \
((codec) = asoc_link_to_codec(link, i)); \ ((codec) = snd_soc_link_to_codec(link, i)); \
(i)++) (i)++)
#define for_each_link_platforms(link, i, platform) \ #define for_each_link_platforms(link, i, platform) \
for ((i) = 0; \ for ((i) = 0; \
((i) < link->num_platforms) && \ ((i) < link->num_platforms) && \
((platform) = asoc_link_to_platform(link, i)); \ ((platform) = snd_soc_link_to_platform(link, i)); \
(i)++) (i)++)
#define for_each_link_cpus(link, i, cpu) \ #define for_each_link_cpus(link, i, cpu) \
for ((i) = 0; \ for ((i) = 0; \
((i) < link->num_cpus) && \ ((i) < link->num_cpus) && \
((cpu) = asoc_link_to_cpu(link, i)); \ ((cpu) = snd_soc_link_to_cpu(link, i)); \
(i)++) (i)++)
/* /*
...@@ -891,8 +896,11 @@ asoc_link_to_platform(struct snd_soc_dai_link *link, int n) { ...@@ -891,8 +896,11 @@ asoc_link_to_platform(struct snd_soc_dai_link *link, int n) {
#define COMP_CODEC_CONF(_name) { .name = _name } #define COMP_CODEC_CONF(_name) { .name = _name }
#define COMP_DUMMY() { .name = "snd-soc-dummy", .dai_name = "snd-soc-dummy-dai", } #define COMP_DUMMY() { .name = "snd-soc-dummy", .dai_name = "snd-soc-dummy-dai", }
/* REMOVE ME */
#define asoc_dummy_dlc snd_soc_dummy_dlc
extern struct snd_soc_dai_link_component null_dailink_component[0]; extern struct snd_soc_dai_link_component null_dailink_component[0];
extern struct snd_soc_dai_link_component asoc_dummy_dlc; extern struct snd_soc_dai_link_component snd_soc_dummy_dlc;
struct snd_soc_codec_conf { struct snd_soc_codec_conf {
...@@ -1110,8 +1118,8 @@ struct snd_soc_pcm_runtime { ...@@ -1110,8 +1118,8 @@ struct snd_soc_pcm_runtime {
* dais = cpu_dai + codec_dai * dais = cpu_dai + codec_dai
* see * see
* soc_new_pcm_runtime() * soc_new_pcm_runtime()
* asoc_rtd_to_cpu() * snd_soc_rtd_to_cpu()
* asoc_rtd_to_codec() * snd_soc_rtd_to_codec()
*/ */
struct snd_soc_dai **dais; struct snd_soc_dai **dais;
...@@ -1137,10 +1145,16 @@ struct snd_soc_pcm_runtime { ...@@ -1137,10 +1145,16 @@ struct snd_soc_pcm_runtime {
int num_components; int num_components;
struct snd_soc_component *components[]; /* CPU/Codec/Platform */ struct snd_soc_component *components[]; /* CPU/Codec/Platform */
}; };
/* REMOVE ME */
#define asoc_rtd_to_cpu snd_soc_rtd_to_cpu
#define asoc_rtd_to_codec snd_soc_rtd_to_codec
#define asoc_substream_to_rtd snd_soc_substream_to_rtd
/* see soc_new_pcm_runtime() */ /* see soc_new_pcm_runtime() */
#define asoc_rtd_to_cpu(rtd, n) (rtd)->dais[n] #define snd_soc_rtd_to_cpu(rtd, n) (rtd)->dais[n]
#define asoc_rtd_to_codec(rtd, n) (rtd)->dais[n + (rtd)->dai_link->num_cpus] #define snd_soc_rtd_to_codec(rtd, n) (rtd)->dais[n + (rtd)->dai_link->num_cpus]
#define asoc_substream_to_rtd(substream) \ #define snd_soc_substream_to_rtd(substream) \
(struct snd_soc_pcm_runtime *)snd_pcm_substream_chip(substream) (struct snd_soc_pcm_runtime *)snd_pcm_substream_chip(substream)
#define for_each_rtd_components(rtd, i, component) \ #define for_each_rtd_components(rtd, i, component) \
...@@ -1149,11 +1163,11 @@ struct snd_soc_pcm_runtime { ...@@ -1149,11 +1163,11 @@ struct snd_soc_pcm_runtime {
(i)++) (i)++)
#define for_each_rtd_cpu_dais(rtd, i, dai) \ #define for_each_rtd_cpu_dais(rtd, i, dai) \
for ((i) = 0; \ for ((i) = 0; \
((i) < rtd->dai_link->num_cpus) && ((dai) = asoc_rtd_to_cpu(rtd, i)); \ ((i) < rtd->dai_link->num_cpus) && ((dai) = snd_soc_rtd_to_cpu(rtd, i)); \
(i)++) (i)++)
#define for_each_rtd_codec_dais(rtd, i, dai) \ #define for_each_rtd_codec_dais(rtd, i, dai) \
for ((i) = 0; \ for ((i) = 0; \
((i) < rtd->dai_link->num_codecs) && ((dai) = asoc_rtd_to_codec(rtd, i)); \ ((i) < rtd->dai_link->num_codecs) && ((dai) = snd_soc_rtd_to_codec(rtd, i)); \
(i)++) (i)++)
#define for_each_rtd_dais(rtd, i, dai) \ #define for_each_rtd_dais(rtd, i, dai) \
for ((i) = 0; \ for ((i) = 0; \
......
...@@ -225,12 +225,12 @@ int snd_soc_component_is_dummy(struct snd_soc_component *component) ...@@ -225,12 +225,12 @@ int snd_soc_component_is_dummy(struct snd_soc_component *component)
(component->driver == &dummy_codec)); (component->driver == &dummy_codec));
} }
struct snd_soc_dai_link_component asoc_dummy_dlc = { struct snd_soc_dai_link_component snd_soc_dummy_dlc = {
.of_node = NULL, .of_node = NULL,
.dai_name = "snd-soc-dummy-dai", .dai_name = "snd-soc-dummy-dai",
.name = "snd-soc-dummy", .name = "snd-soc-dummy",
}; };
EXPORT_SYMBOL_GPL(asoc_dummy_dlc); EXPORT_SYMBOL_GPL(snd_soc_dummy_dlc);
static int snd_soc_dummy_probe(struct platform_device *pdev) static int snd_soc_dummy_probe(struct platform_device *pdev)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment