diff options
author | Liam Girdwood <lg@opensource.wolfsonmicro.com> | 2008-07-07 11:07:17 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-07-10 03:32:32 -0400 |
commit | 3c4b266fe642bcaebe2b95edb56c3f8802924ff9 (patch) | |
tree | 837a5e7d8e77702bcca5a02fbcaed51c3fa52065 /sound/soc | |
parent | a5302181e5321664047f75715242aac4e0bbd17c (diff) |
ALSA: asoc: core - merge structs snd_soc_codec_dai and snd_soc_cpu_dai.
This patch series merges struct snd_soc_codec_dai and struct
snd_soc_cpu_dai into struct snd_soc_dai in preparation for further
ASoC v2 patches.
This merger removes duplication in both DAI structures and simplifies
the API for other users.
Signed-off-by: Liam Girdwood <lg@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/soc-core.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index bdbbc6a980fa..4d626b47b2ff 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -134,8 +134,8 @@ static int soc_pcm_open(struct snd_pcm_substream *substream) | |||
134 | struct snd_pcm_runtime *runtime = substream->runtime; | 134 | struct snd_pcm_runtime *runtime = substream->runtime; |
135 | struct snd_soc_dai_link *machine = rtd->dai; | 135 | struct snd_soc_dai_link *machine = rtd->dai; |
136 | struct snd_soc_platform *platform = socdev->platform; | 136 | struct snd_soc_platform *platform = socdev->platform; |
137 | struct snd_soc_cpu_dai *cpu_dai = machine->cpu_dai; | 137 | struct snd_soc_dai *cpu_dai = machine->cpu_dai; |
138 | struct snd_soc_codec_dai *codec_dai = machine->codec_dai; | 138 | struct snd_soc_dai *codec_dai = machine->codec_dai; |
139 | int ret = 0; | 139 | int ret = 0; |
140 | 140 | ||
141 | mutex_lock(&pcm_mutex); | 141 | mutex_lock(&pcm_mutex); |
@@ -272,7 +272,7 @@ static void close_delayed_work(struct work_struct *work) | |||
272 | struct snd_soc_device *socdev = | 272 | struct snd_soc_device *socdev = |
273 | container_of(work, struct snd_soc_device, delayed_work.work); | 273 | container_of(work, struct snd_soc_device, delayed_work.work); |
274 | struct snd_soc_codec *codec = socdev->codec; | 274 | struct snd_soc_codec *codec = socdev->codec; |
275 | struct snd_soc_codec_dai *codec_dai; | 275 | struct snd_soc_dai *codec_dai; |
276 | int i; | 276 | int i; |
277 | 277 | ||
278 | mutex_lock(&pcm_mutex); | 278 | mutex_lock(&pcm_mutex); |
@@ -323,8 +323,8 @@ static int soc_codec_close(struct snd_pcm_substream *substream) | |||
323 | struct snd_soc_device *socdev = rtd->socdev; | 323 | struct snd_soc_device *socdev = rtd->socdev; |
324 | struct snd_soc_dai_link *machine = rtd->dai; | 324 | struct snd_soc_dai_link *machine = rtd->dai; |
325 | struct snd_soc_platform *platform = socdev->platform; | 325 | struct snd_soc_platform *platform = socdev->platform; |
326 | struct snd_soc_cpu_dai *cpu_dai = machine->cpu_dai; | 326 | struct snd_soc_dai *cpu_dai = machine->cpu_dai; |
327 | struct snd_soc_codec_dai *codec_dai = machine->codec_dai; | 327 | struct snd_soc_dai *codec_dai = machine->codec_dai; |
328 | struct snd_soc_codec *codec = socdev->codec; | 328 | struct snd_soc_codec *codec = socdev->codec; |
329 | 329 | ||
330 | mutex_lock(&pcm_mutex); | 330 | mutex_lock(&pcm_mutex); |
@@ -384,8 +384,8 @@ static int soc_pcm_prepare(struct snd_pcm_substream *substream) | |||
384 | struct snd_soc_device *socdev = rtd->socdev; | 384 | struct snd_soc_device *socdev = rtd->socdev; |
385 | struct snd_soc_dai_link *machine = rtd->dai; | 385 | struct snd_soc_dai_link *machine = rtd->dai; |
386 | struct snd_soc_platform *platform = socdev->platform; | 386 | struct snd_soc_platform *platform = socdev->platform; |
387 | struct snd_soc_cpu_dai *cpu_dai = machine->cpu_dai; | 387 | struct snd_soc_dai *cpu_dai = machine->cpu_dai; |
388 | struct snd_soc_codec_dai *codec_dai = machine->codec_dai; | 388 | struct snd_soc_dai *codec_dai = machine->codec_dai; |
389 | struct snd_soc_codec *codec = socdev->codec; | 389 | struct snd_soc_codec *codec = socdev->codec; |
390 | int ret = 0; | 390 | int ret = 0; |
391 | 391 | ||
@@ -489,8 +489,8 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream, | |||
489 | struct snd_soc_device *socdev = rtd->socdev; | 489 | struct snd_soc_device *socdev = rtd->socdev; |
490 | struct snd_soc_dai_link *machine = rtd->dai; | 490 | struct snd_soc_dai_link *machine = rtd->dai; |
491 | struct snd_soc_platform *platform = socdev->platform; | 491 | struct snd_soc_platform *platform = socdev->platform; |
492 | struct snd_soc_cpu_dai *cpu_dai = machine->cpu_dai; | 492 | struct snd_soc_dai *cpu_dai = machine->cpu_dai; |
493 | struct snd_soc_codec_dai *codec_dai = machine->codec_dai; | 493 | struct snd_soc_dai *codec_dai = machine->codec_dai; |
494 | int ret = 0; | 494 | int ret = 0; |
495 | 495 | ||
496 | mutex_lock(&pcm_mutex); | 496 | mutex_lock(&pcm_mutex); |
@@ -559,8 +559,8 @@ static int soc_pcm_hw_free(struct snd_pcm_substream *substream) | |||
559 | struct snd_soc_device *socdev = rtd->socdev; | 559 | struct snd_soc_device *socdev = rtd->socdev; |
560 | struct snd_soc_dai_link *machine = rtd->dai; | 560 | struct snd_soc_dai_link *machine = rtd->dai; |
561 | struct snd_soc_platform *platform = socdev->platform; | 561 | struct snd_soc_platform *platform = socdev->platform; |
562 | struct snd_soc_cpu_dai *cpu_dai = machine->cpu_dai; | 562 | struct snd_soc_dai *cpu_dai = machine->cpu_dai; |
563 | struct snd_soc_codec_dai *codec_dai = machine->codec_dai; | 563 | struct snd_soc_dai *codec_dai = machine->codec_dai; |
564 | struct snd_soc_codec *codec = socdev->codec; | 564 | struct snd_soc_codec *codec = socdev->codec; |
565 | 565 | ||
566 | mutex_lock(&pcm_mutex); | 566 | mutex_lock(&pcm_mutex); |
@@ -594,8 +594,8 @@ static int soc_pcm_trigger(struct snd_pcm_substream *substream, int cmd) | |||
594 | struct snd_soc_device *socdev = rtd->socdev; | 594 | struct snd_soc_device *socdev = rtd->socdev; |
595 | struct snd_soc_dai_link *machine = rtd->dai; | 595 | struct snd_soc_dai_link *machine = rtd->dai; |
596 | struct snd_soc_platform *platform = socdev->platform; | 596 | struct snd_soc_platform *platform = socdev->platform; |
597 | struct snd_soc_cpu_dai *cpu_dai = machine->cpu_dai; | 597 | struct snd_soc_dai *cpu_dai = machine->cpu_dai; |
598 | struct snd_soc_codec_dai *codec_dai = machine->codec_dai; | 598 | struct snd_soc_dai *codec_dai = machine->codec_dai; |
599 | int ret; | 599 | int ret; |
600 | 600 | ||
601 | if (codec_dai->ops.trigger) { | 601 | if (codec_dai->ops.trigger) { |
@@ -651,7 +651,7 @@ static int soc_suspend(struct platform_device *pdev, pm_message_t state) | |||
651 | 651 | ||
652 | /* mute any active DAC's */ | 652 | /* mute any active DAC's */ |
653 | for (i = 0; i < machine->num_links; i++) { | 653 | for (i = 0; i < machine->num_links; i++) { |
654 | struct snd_soc_codec_dai *dai = machine->dai_link[i].codec_dai; | 654 | struct snd_soc_dai *dai = machine->dai_link[i].codec_dai; |
655 | if (dai->dai_ops.digital_mute && dai->playback.active) | 655 | if (dai->dai_ops.digital_mute && dai->playback.active) |
656 | dai->dai_ops.digital_mute(dai, 1); | 656 | dai->dai_ops.digital_mute(dai, 1); |
657 | } | 657 | } |
@@ -664,7 +664,7 @@ static int soc_suspend(struct platform_device *pdev, pm_message_t state) | |||
664 | machine->suspend_pre(pdev, state); | 664 | machine->suspend_pre(pdev, state); |
665 | 665 | ||
666 | for (i = 0; i < machine->num_links; i++) { | 666 | for (i = 0; i < machine->num_links; i++) { |
667 | struct snd_soc_cpu_dai *cpu_dai = machine->dai_link[i].cpu_dai; | 667 | struct snd_soc_dai *cpu_dai = machine->dai_link[i].cpu_dai; |
668 | if (cpu_dai->suspend && cpu_dai->type != SND_SOC_DAI_AC97) | 668 | if (cpu_dai->suspend && cpu_dai->type != SND_SOC_DAI_AC97) |
669 | cpu_dai->suspend(pdev, cpu_dai); | 669 | cpu_dai->suspend(pdev, cpu_dai); |
670 | if (platform->suspend) | 670 | if (platform->suspend) |
@@ -690,7 +690,7 @@ static int soc_suspend(struct platform_device *pdev, pm_message_t state) | |||
690 | codec_dev->suspend(pdev, state); | 690 | codec_dev->suspend(pdev, state); |
691 | 691 | ||
692 | for (i = 0; i < machine->num_links; i++) { | 692 | for (i = 0; i < machine->num_links; i++) { |
693 | struct snd_soc_cpu_dai *cpu_dai = machine->dai_link[i].cpu_dai; | 693 | struct snd_soc_dai *cpu_dai = machine->dai_link[i].cpu_dai; |
694 | if (cpu_dai->suspend && cpu_dai->type == SND_SOC_DAI_AC97) | 694 | if (cpu_dai->suspend && cpu_dai->type == SND_SOC_DAI_AC97) |
695 | cpu_dai->suspend(pdev, cpu_dai); | 695 | cpu_dai->suspend(pdev, cpu_dai); |
696 | } | 696 | } |
@@ -726,7 +726,7 @@ static void soc_resume_deferred(struct work_struct *work) | |||
726 | machine->resume_pre(pdev); | 726 | machine->resume_pre(pdev); |
727 | 727 | ||
728 | for (i = 0; i < machine->num_links; i++) { | 728 | for (i = 0; i < machine->num_links; i++) { |
729 | struct snd_soc_cpu_dai *cpu_dai = machine->dai_link[i].cpu_dai; | 729 | struct snd_soc_dai *cpu_dai = machine->dai_link[i].cpu_dai; |
730 | if (cpu_dai->resume && cpu_dai->type == SND_SOC_DAI_AC97) | 730 | if (cpu_dai->resume && cpu_dai->type == SND_SOC_DAI_AC97) |
731 | cpu_dai->resume(pdev, cpu_dai); | 731 | cpu_dai->resume(pdev, cpu_dai); |
732 | } | 732 | } |
@@ -747,13 +747,13 @@ static void soc_resume_deferred(struct work_struct *work) | |||
747 | 747 | ||
748 | /* unmute any active DACs */ | 748 | /* unmute any active DACs */ |
749 | for (i = 0; i < machine->num_links; i++) { | 749 | for (i = 0; i < machine->num_links; i++) { |
750 | struct snd_soc_codec_dai *dai = machine->dai_link[i].codec_dai; | 750 | struct snd_soc_dai *dai = machine->dai_link[i].codec_dai; |
751 | if (dai->dai_ops.digital_mute && dai->playback.active) | 751 | if (dai->dai_ops.digital_mute && dai->playback.active) |
752 | dai->dai_ops.digital_mute(dai, 0); | 752 | dai->dai_ops.digital_mute(dai, 0); |
753 | } | 753 | } |
754 | 754 | ||
755 | for (i = 0; i < machine->num_links; i++) { | 755 | for (i = 0; i < machine->num_links; i++) { |
756 | struct snd_soc_cpu_dai *cpu_dai = machine->dai_link[i].cpu_dai; | 756 | struct snd_soc_dai *cpu_dai = machine->dai_link[i].cpu_dai; |
757 | if (cpu_dai->resume && cpu_dai->type != SND_SOC_DAI_AC97) | 757 | if (cpu_dai->resume && cpu_dai->type != SND_SOC_DAI_AC97) |
758 | cpu_dai->resume(pdev, cpu_dai); | 758 | cpu_dai->resume(pdev, cpu_dai); |
759 | if (platform->resume) | 759 | if (platform->resume) |
@@ -803,7 +803,7 @@ static int soc_probe(struct platform_device *pdev) | |||
803 | } | 803 | } |
804 | 804 | ||
805 | for (i = 0; i < machine->num_links; i++) { | 805 | for (i = 0; i < machine->num_links; i++) { |
806 | struct snd_soc_cpu_dai *cpu_dai = machine->dai_link[i].cpu_dai; | 806 | struct snd_soc_dai *cpu_dai = machine->dai_link[i].cpu_dai; |
807 | if (cpu_dai->probe) { | 807 | if (cpu_dai->probe) { |
808 | ret = cpu_dai->probe(pdev, cpu_dai); | 808 | ret = cpu_dai->probe(pdev, cpu_dai); |
809 | if (ret < 0) | 809 | if (ret < 0) |
@@ -838,7 +838,7 @@ platform_err: | |||
838 | 838 | ||
839 | cpu_dai_err: | 839 | cpu_dai_err: |
840 | for (i--; i >= 0; i--) { | 840 | for (i--; i >= 0; i--) { |
841 | struct snd_soc_cpu_dai *cpu_dai = machine->dai_link[i].cpu_dai; | 841 | struct snd_soc_dai *cpu_dai = machine->dai_link[i].cpu_dai; |
842 | if (cpu_dai->remove) | 842 | if (cpu_dai->remove) |
843 | cpu_dai->remove(pdev, cpu_dai); | 843 | cpu_dai->remove(pdev, cpu_dai); |
844 | } | 844 | } |
@@ -867,7 +867,7 @@ static int soc_remove(struct platform_device *pdev) | |||
867 | codec_dev->remove(pdev); | 867 | codec_dev->remove(pdev); |
868 | 868 | ||
869 | for (i = 0; i < machine->num_links; i++) { | 869 | for (i = 0; i < machine->num_links; i++) { |
870 | struct snd_soc_cpu_dai *cpu_dai = machine->dai_link[i].cpu_dai; | 870 | struct snd_soc_dai *cpu_dai = machine->dai_link[i].cpu_dai; |
871 | if (cpu_dai->remove) | 871 | if (cpu_dai->remove) |
872 | cpu_dai->remove(pdev, cpu_dai); | 872 | cpu_dai->remove(pdev, cpu_dai); |
873 | } | 873 | } |
@@ -895,8 +895,8 @@ static int soc_new_pcm(struct snd_soc_device *socdev, | |||
895 | struct snd_soc_dai_link *dai_link, int num) | 895 | struct snd_soc_dai_link *dai_link, int num) |
896 | { | 896 | { |
897 | struct snd_soc_codec *codec = socdev->codec; | 897 | struct snd_soc_codec *codec = socdev->codec; |
898 | struct snd_soc_codec_dai *codec_dai = dai_link->codec_dai; | 898 | struct snd_soc_dai *codec_dai = dai_link->codec_dai; |
899 | struct snd_soc_cpu_dai *cpu_dai = dai_link->cpu_dai; | 899 | struct snd_soc_dai *cpu_dai = dai_link->cpu_dai; |
900 | struct snd_soc_pcm_runtime *rtd; | 900 | struct snd_soc_pcm_runtime *rtd; |
901 | struct snd_pcm *pcm; | 901 | struct snd_pcm *pcm; |
902 | char new_name[64]; | 902 | char new_name[64]; |
@@ -1211,7 +1211,7 @@ void snd_soc_free_pcms(struct snd_soc_device *socdev) | |||
1211 | { | 1211 | { |
1212 | struct snd_soc_codec *codec = socdev->codec; | 1212 | struct snd_soc_codec *codec = socdev->codec; |
1213 | #ifdef CONFIG_SND_SOC_AC97_BUS | 1213 | #ifdef CONFIG_SND_SOC_AC97_BUS |
1214 | struct snd_soc_codec_dai *codec_dai; | 1214 | struct snd_soc_dai *codec_dai; |
1215 | int i; | 1215 | int i; |
1216 | #endif | 1216 | #endif |
1217 | 1217 | ||