aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-core.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2008-11-24 13:01:05 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2008-11-24 13:01:31 -0500
commit3ba9e10a6d3b6abf5f5952572cff8f8d5a35ae54 (patch)
tree855569d0aeee6fc06a35928f3b6e351918c9bea6 /sound/soc/soc-core.c
parentb0bd53a7399f65e2d1b37cd44c5003e55b886c1e (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.c31
1 files changed, 8 insertions, 23 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 43f4060dbe75..0d47696ccd07 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)
100} 100}
101#endif 101#endif
102 102
103static inline const char *get_dai_name(int type)
104{
105 switch (type) {
106 case SND_SOC_DAI_AC97_BUS:
107 case SND_SOC_DAI_AC97:
108 return "AC97";
109 case SND_SOC_DAI_I2S:
110 return "I2S";
111 case SND_SOC_DAI_PCM:
112 return "PCM";
113 }
114 return NULL;
115}
116
117/* 103/*
118 * Called by ALSA when a PCM substream is opened, the runtime->hw record is 104 * Called by ALSA when a PCM substream is opened, the runtime->hw record is
119 * then initialized and any private data can be allocated. This also calls 105 * 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)
652 638
653 for (i = 0; i < card->num_links; i++) { 639 for (i = 0; i < card->num_links; i++) {
654 struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai; 640 struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai;
655 if (cpu_dai->suspend && cpu_dai->type != SND_SOC_DAI_AC97) 641 if (cpu_dai->suspend && !cpu_dai->ac97_control)
656 cpu_dai->suspend(pdev, cpu_dai); 642 cpu_dai->suspend(pdev, cpu_dai);
657 if (platform->suspend) 643 if (platform->suspend)
658 platform->suspend(pdev, cpu_dai); 644 platform->suspend(pdev, cpu_dai);
@@ -678,7 +664,7 @@ static int soc_suspend(struct platform_device *pdev, pm_message_t state)
678 664
679 for (i = 0; i < card->num_links; i++) { 665 for (i = 0; i < card->num_links; i++) {
680 struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai; 666 struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai;
681 if (cpu_dai->suspend && cpu_dai->type == SND_SOC_DAI_AC97) 667 if (cpu_dai->suspend && cpu_dai->ac97_control)
682 cpu_dai->suspend(pdev, cpu_dai); 668 cpu_dai->suspend(pdev, cpu_dai);
683 } 669 }
684 670
@@ -714,7 +700,7 @@ static void soc_resume_deferred(struct work_struct *work)
714 700
715 for (i = 0; i < card->num_links; i++) { 701 for (i = 0; i < card->num_links; i++) {
716 struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai; 702 struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai;
717 if (cpu_dai->resume && cpu_dai->type == SND_SOC_DAI_AC97) 703 if (cpu_dai->resume && cpu_dai->ac97_control)
718 cpu_dai->resume(pdev, cpu_dai); 704 cpu_dai->resume(pdev, cpu_dai);
719 } 705 }
720 706
@@ -741,7 +727,7 @@ static void soc_resume_deferred(struct work_struct *work)
741 727
742 for (i = 0; i < card->num_links; i++) { 728 for (i = 0; i < card->num_links; i++) {
743 struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai; 729 struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai;
744 if (cpu_dai->resume && cpu_dai->type != SND_SOC_DAI_AC97) 730 if (cpu_dai->resume && !cpu_dai->ac97_control)
745 cpu_dai->resume(pdev, cpu_dai); 731 cpu_dai->resume(pdev, cpu_dai);
746 if (platform->resume) 732 if (platform->resume)
747 platform->resume(pdev, cpu_dai); 733 platform->resume(pdev, cpu_dai);
@@ -898,8 +884,8 @@ static int soc_new_pcm(struct snd_soc_device *socdev,
898 codec_dai->codec = socdev->codec; 884 codec_dai->codec = socdev->codec;
899 885
900 /* check client and interface hw capabilities */ 886 /* check client and interface hw capabilities */
901 sprintf(new_name, "%s %s-%s-%d", dai_link->stream_name, codec_dai->name, 887 sprintf(new_name, "%s %s-%d", dai_link->stream_name, codec_dai->name,
902 get_dai_name(cpu_dai->type), num); 888 num);
903 889
904 if (codec_dai->playback.channels_min) 890 if (codec_dai->playback.channels_min)
905 playback = 1; 891 playback = 1;
@@ -1270,8 +1256,7 @@ int snd_soc_register_card(struct snd_soc_device *socdev)
1270 continue; 1256 continue;
1271 } 1257 }
1272 } 1258 }
1273 if (card->dai_link[i].codec_dai->type == 1259 if (card->dai_link[i].codec_dai->ac97_control)
1274 SND_SOC_DAI_AC97_BUS)
1275 ac97 = 1; 1260 ac97 = 1;
1276 } 1261 }
1277 snprintf(codec->card->shortname, sizeof(codec->card->shortname), 1262 snprintf(codec->card->shortname, sizeof(codec->card->shortname),
@@ -1335,7 +1320,7 @@ void snd_soc_free_pcms(struct snd_soc_device *socdev)
1335#ifdef CONFIG_SND_SOC_AC97_BUS 1320#ifdef CONFIG_SND_SOC_AC97_BUS
1336 for (i = 0; i < codec->num_dai; i++) { 1321 for (i = 0; i < codec->num_dai; i++) {
1337 codec_dai = &codec->dai[i]; 1322 codec_dai = &codec->dai[i];
1338 if (codec_dai->type == SND_SOC_DAI_AC97_BUS && codec->ac97) { 1323 if (codec_dai->ac97_control && codec->ac97) {
1339 soc_ac97_dev_unregister(codec); 1324 soc_ac97_dev_unregister(codec);
1340 goto free_card; 1325 goto free_card;
1341 } 1326 }