aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/atmel
diff options
context:
space:
mode:
authorEric Miao <eric.y.miao@gmail.com>2009-03-02 20:41:00 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-03-04 17:29:47 -0500
commit6335d05548eece40092000aa91b64a50310d69d5 (patch)
treeac72c74562f349879a127b4067827476a7875c88 /sound/soc/atmel
parentff09d49ad0176a5f52a398c137a7ff5f669d6be4 (diff)
ASoC: make ops a pointer in 'struct snd_soc_dai'
Considering the fact that most cpu_dai or codec_dai are using a same 'snd_soc_dai_ops' for several similar interfaces, 'ops' would be better made a pointer instead, to make sharing easier and code a bit cleaner. The patch below is rather preliminary since the asoc tree is being actively developed, and this touches almost every piece of code, (and possibly many others in development need to be changed as well). Building of all codecs are OK, yet to every SoC, I didn't test that. Signed-off-by: Eric Miao <eric.miao@marvell.com> Acked-by: Timur Tabi <timur@freescale.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/atmel')
-rw-r--r--sound/soc/atmel/atmel_ssc_dai.c33
1 files changed, 12 insertions, 21 deletions
diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c
index ff0054b76502..e588e63f18d2 100644
--- a/sound/soc/atmel/atmel_ssc_dai.c
+++ b/sound/soc/atmel/atmel_ssc_dai.c
@@ -697,6 +697,15 @@ static int atmel_ssc_resume(struct snd_soc_dai *cpu_dai)
697#define ATMEL_SSC_FORMATS (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE |\ 697#define ATMEL_SSC_FORMATS (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE |\
698 SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) 698 SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
699 699
700static struct snd_soc_dai_ops atmel_ssc_dai_ops = {
701 .startup = atmel_ssc_startup,
702 .shutdown = atmel_ssc_shutdown,
703 .prepare = atmel_ssc_prepare,
704 .hw_params = atmel_ssc_hw_params,
705 .set_fmt = atmel_ssc_set_dai_fmt,
706 .set_clkdiv = atmel_ssc_set_dai_clkdiv,
707};
708
700struct snd_soc_dai atmel_ssc_dai[NUM_SSC_DEVICES] = { 709struct snd_soc_dai atmel_ssc_dai[NUM_SSC_DEVICES] = {
701 { .name = "atmel-ssc0", 710 { .name = "atmel-ssc0",
702 .id = 0, 711 .id = 0,
@@ -712,13 +721,7 @@ struct snd_soc_dai atmel_ssc_dai[NUM_SSC_DEVICES] = {
712 .channels_max = 2, 721 .channels_max = 2,
713 .rates = ATMEL_SSC_RATES, 722 .rates = ATMEL_SSC_RATES,
714 .formats = ATMEL_SSC_FORMATS,}, 723 .formats = ATMEL_SSC_FORMATS,},
715 .ops = { 724 .ops = &atmel_ssc_dai_ops,
716 .startup = atmel_ssc_startup,
717 .shutdown = atmel_ssc_shutdown,
718 .prepare = atmel_ssc_prepare,
719 .hw_params = atmel_ssc_hw_params,
720 .set_fmt = atmel_ssc_set_dai_fmt,
721 .set_clkdiv = atmel_ssc_set_dai_clkdiv,},
722 .private_data = &ssc_info[0], 725 .private_data = &ssc_info[0],
723 }, 726 },
724#if NUM_SSC_DEVICES == 3 727#if NUM_SSC_DEVICES == 3
@@ -736,13 +739,7 @@ struct snd_soc_dai atmel_ssc_dai[NUM_SSC_DEVICES] = {
736 .channels_max = 2, 739 .channels_max = 2,
737 .rates = ATMEL_SSC_RATES, 740 .rates = ATMEL_SSC_RATES,
738 .formats = ATMEL_SSC_FORMATS,}, 741 .formats = ATMEL_SSC_FORMATS,},
739 .ops = { 742 .ops = &atmel_ssc_dai_ops,
740 .startup = atmel_ssc_startup,
741 .shutdown = atmel_ssc_shutdown,
742 .prepare = atmel_ssc_prepare,
743 .hw_params = atmel_ssc_hw_params,
744 .set_fmt = atmel_ssc_set_dai_fmt,
745 .set_clkdiv = atmel_ssc_set_dai_clkdiv,},
746 .private_data = &ssc_info[1], 743 .private_data = &ssc_info[1],
747 }, 744 },
748 { .name = "atmel-ssc2", 745 { .name = "atmel-ssc2",
@@ -759,13 +756,7 @@ struct snd_soc_dai atmel_ssc_dai[NUM_SSC_DEVICES] = {
759 .channels_max = 2, 756 .channels_max = 2,
760 .rates = ATMEL_SSC_RATES, 757 .rates = ATMEL_SSC_RATES,
761 .formats = ATMEL_SSC_FORMATS,}, 758 .formats = ATMEL_SSC_FORMATS,},
762 .ops = { 759 .ops = &atmel_ssc_dai_ops,
763 .startup = atmel_ssc_startup,
764 .shutdown = atmel_ssc_shutdown,
765 .prepare = atmel_ssc_prepare,
766 .hw_params = atmel_ssc_hw_params,
767 .set_fmt = atmel_ssc_set_dai_fmt,
768 .set_clkdiv = atmel_ssc_set_dai_clkdiv,},
769 .private_data = &ssc_info[2], 760 .private_data = &ssc_info[2],
770 }, 761 },
771#endif 762#endif