diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2008-11-24 18:01:05 +0000 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2008-11-24 18:01:31 +0000 |
commit | 3ba9e10a6d3b6abf5f5952572cff8f8d5a35ae54 (patch) | |
tree | 855569d0aeee6fc06a35928f3b6e351918c9bea6 /sound/soc/soc-core.c | |
parent | b0bd53a7399f65e2d1b37cd44c5003e55b886c1e (diff) |
ASoC: Remove DAI type information
DAI type information is only ever used within ASoC in order to special
case AC97 and for diagnostic purposes. Since modern CPUs and codecs
support multi function DAIs which can be configured for several modes
it is more trouble than it's worth to maintain anything other than a
flag identifying AC97 DAIs so remove the type field and replace it with
an ac97_control flag.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r-- | sound/soc/soc-core.c | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 43f4060dbe7..0d47696ccd0 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -100,20 +100,6 @@ static int soc_ac97_dev_register(struct snd_soc_codec *codec) } #endif -static inline const char *get_dai_name(int type) -{ - switch (type) { - case SND_SOC_DAI_AC97_BUS: - case SND_SOC_DAI_AC97: - return "AC97"; - case SND_SOC_DAI_I2S: - return "I2S"; - case SND_SOC_DAI_PCM: - return "PCM"; - } - return NULL; -} - /* * Called by ALSA when a PCM substream is opened, the runtime->hw record is * then initialized and any private data can be allocated. This also calls @@ -652,7 +638,7 @@ static int soc_suspend(struct platform_device *pdev, pm_message_t state) for (i = 0; i < card->num_links; i++) { struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai; - if (cpu_dai->suspend && cpu_dai->type != SND_SOC_DAI_AC97) + if (cpu_dai->suspend && !cpu_dai->ac97_control) cpu_dai->suspend(pdev, cpu_dai); if (platform->suspend) platform->suspend(pdev, cpu_dai); @@ -678,7 +664,7 @@ static int soc_suspend(struct platform_device *pdev, pm_message_t state) for (i = 0; i < card->num_links; i++) { struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai; - if (cpu_dai->suspend && cpu_dai->type == SND_SOC_DAI_AC97) + if (cpu_dai->suspend && cpu_dai->ac97_control) cpu_dai->suspend(pdev, cpu_dai); } @@ -714,7 +700,7 @@ static void soc_resume_deferred(struct work_struct *work) for (i = 0; i < card->num_links; i++) { struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai; - if (cpu_dai->resume && cpu_dai->type == SND_SOC_DAI_AC97) + if (cpu_dai->resume && cpu_dai->ac97_control) cpu_dai->resume(pdev, cpu_dai); } @@ -741,7 +727,7 @@ static void soc_resume_deferred(struct work_struct *work) for (i = 0; i < card->num_links; i++) { struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai; - if (cpu_dai->resume && cpu_dai->type != SND_SOC_DAI_AC97) + if (cpu_dai->resume && !cpu_dai->ac97_control) cpu_dai->resume(pdev, cpu_dai); if (platform->resume) platform->resume(pdev, cpu_dai); @@ -898,8 +884,8 @@ static int soc_new_pcm(struct snd_soc_device *socdev, codec_dai->codec = socdev->codec; /* check client and interface hw capabilities */ - sprintf(new_name, "%s %s-%s-%d", dai_link->stream_name, codec_dai->name, - get_dai_name(cpu_dai->type), num); + sprintf(new_name, "%s %s-%d", dai_link->stream_name, codec_dai->name, + num); if (codec_dai->playback.channels_min) playback = 1; @@ -1270,8 +1256,7 @@ int snd_soc_register_card(struct snd_soc_device *socdev) continue; } } - if (card->dai_link[i].codec_dai->type == - SND_SOC_DAI_AC97_BUS) + if (card->dai_link[i].codec_dai->ac97_control) ac97 = 1; } snprintf(codec->card->shortname, sizeof(codec->card->shortname), @@ -1335,7 +1320,7 @@ void snd_soc_free_pcms(struct snd_soc_device *socdev) #ifdef CONFIG_SND_SOC_AC97_BUS for (i = 0; i < codec->num_dai; i++) { codec_dai = &codec->dai[i]; - if (codec_dai->type == SND_SOC_DAI_AC97_BUS && codec->ac97) { + if (codec_dai->ac97_control && codec->ac97) { soc_ac97_dev_unregister(codec); goto free_card; } |