summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2021-06-14 02:58:35 +0200
committerMark Brown <broonie@kernel.org>2021-06-21 14:05:22 +0200
commit8439c5861cf0c88037f6e9cdd3ba5f1c472f847a (patch)
tree889ad75b6ce4393965d727b546771194d1025782 /sound
parentASoC: simple-card-utils: switch to use snd_soc_daifmt_parse_format/clock_prov... (diff)
downloadlinux-8439c5861cf0c88037f6e9cdd3ba5f1c472f847a.tar.xz
linux-8439c5861cf0c88037f6e9cdd3ba5f1c472f847a.zip
ASoC: soc-core: remove snd_soc_of_parse_daifmt()
No driver is using snd_soc_of_parse_daifmt(). This patch removes it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87zgvtuuro.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/soc-core.c104
1 files changed, 0 insertions, 104 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index c22e8b547821..11974d27060e 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3169,110 +3169,6 @@ unsigned int snd_soc_daifmt_parse_clock_provider_raw(struct device_node *np,
}
EXPORT_SYMBOL_GPL(snd_soc_daifmt_parse_clock_provider_raw);
-unsigned int snd_soc_of_parse_daifmt(struct device_node *np,
- const char *prefix,
- struct device_node **bitclkmaster,
- struct device_node **framemaster)
-{
- int ret, i;
- char prop[128];
- unsigned int format = 0;
- int bit, frame;
- const char *str;
- struct {
- char *name;
- unsigned int val;
- } of_fmt_table[] = {
- { "i2s", SND_SOC_DAIFMT_I2S },
- { "right_j", SND_SOC_DAIFMT_RIGHT_J },
- { "left_j", SND_SOC_DAIFMT_LEFT_J },
- { "dsp_a", SND_SOC_DAIFMT_DSP_A },
- { "dsp_b", SND_SOC_DAIFMT_DSP_B },
- { "ac97", SND_SOC_DAIFMT_AC97 },
- { "pdm", SND_SOC_DAIFMT_PDM},
- { "msb", SND_SOC_DAIFMT_MSB },
- { "lsb", SND_SOC_DAIFMT_LSB },
- };
-
- if (!prefix)
- prefix = "";
-
- /*
- * check "dai-format = xxx"
- * or "[prefix]format = xxx"
- * SND_SOC_DAIFMT_FORMAT_MASK area
- */
- ret = of_property_read_string(np, "dai-format", &str);
- if (ret < 0) {
- snprintf(prop, sizeof(prop), "%sformat", prefix);
- ret = of_property_read_string(np, prop, &str);
- }
- if (ret == 0) {
- for (i = 0; i < ARRAY_SIZE(of_fmt_table); i++) {
- if (strcmp(str, of_fmt_table[i].name) == 0) {
- format |= of_fmt_table[i].val;
- break;
- }
- }
- }
-
- /*
- * check "[prefix]continuous-clock"
- * SND_SOC_DAIFMT_CLOCK_MASK area
- */
- snprintf(prop, sizeof(prop), "%scontinuous-clock", prefix);
- if (of_property_read_bool(np, prop))
- format |= SND_SOC_DAIFMT_CONT;
- else
- format |= SND_SOC_DAIFMT_GATED;
-
- /*
- * check "[prefix]bitclock-inversion"
- * check "[prefix]frame-inversion"
- * SND_SOC_DAIFMT_INV_MASK area
- */
- snprintf(prop, sizeof(prop), "%sbitclock-inversion", prefix);
- bit = !!of_get_property(np, prop, NULL);
-
- snprintf(prop, sizeof(prop), "%sframe-inversion", prefix);
- frame = !!of_get_property(np, prop, NULL);
-
- switch ((bit << 4) + frame) {
- case 0x11:
- format |= SND_SOC_DAIFMT_IB_IF;
- break;
- case 0x10:
- format |= SND_SOC_DAIFMT_IB_NF;
- break;
- case 0x01:
- format |= SND_SOC_DAIFMT_NB_IF;
- break;
- default:
- /* SND_SOC_DAIFMT_NB_NF is default */
- break;
- }
-
- /*
- * check "[prefix]bitclock-master"
- * check "[prefix]frame-master"
- * SND_SOC_DAIFMT_MASTER_MASK area
- */
- snprintf(prop, sizeof(prop), "%sbitclock-master", prefix);
- bit = !!of_get_property(np, prop, NULL);
- if (bit && bitclkmaster)
- *bitclkmaster = of_parse_phandle(np, prop, 0);
-
- snprintf(prop, sizeof(prop), "%sframe-master", prefix);
- frame = !!of_get_property(np, prop, NULL);
- if (frame && framemaster)
- *framemaster = of_parse_phandle(np, prop, 0);
-
- format |= snd_soc_daifmt_clock_provider_from_bitmap((bit << 4) + frame);
-
- return format;
-}
-EXPORT_SYMBOL_GPL(snd_soc_of_parse_daifmt);
-
int snd_soc_get_dai_id(struct device_node *ep)
{
struct snd_soc_component *component;