aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/pxa
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2009-03-11 12:51:31 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-03-11 12:51:31 -0400
commit65ec1cd1e2c6228752d2f167b01e6d291014d249 (patch)
tree8a54ef7d2a0d4770b49779114f9e1ac654363bdd /sound/soc/pxa
parent5314adc3612d893c7cc526b3312d124805e45bc3 (diff)
parent6335d05548eece40092000aa91b64a50310d69d5 (diff)
ASoC: Merge dai_ops factor out
Merge Eric Maio's patch to merge snd_soc_dai_ops out of line. Fixed merge issues and updated drivers, plus an issue with the ops for the two s3c2443 AC97 DAIs having been merged. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/pxa')
-rw-r--r--sound/soc/pxa/pxa-ssp.c65
-rw-r--r--sound/soc/pxa/pxa2xx-ac97.c13
-rw-r--r--sound/soc/pxa/pxa2xx-i2s.c18
3 files changed, 34 insertions, 62 deletions
diff --git a/sound/soc/pxa/pxa-ssp.c b/sound/soc/pxa/pxa-ssp.c
index 52d97c4b82b1..d3fa6357a9fd 100644
--- a/sound/soc/pxa/pxa-ssp.c
+++ b/sound/soc/pxa/pxa-ssp.c
@@ -794,6 +794,19 @@ static void pxa_ssp_remove(struct platform_device *pdev,
794 SNDRV_PCM_FMTBIT_S24_LE | \ 794 SNDRV_PCM_FMTBIT_S24_LE | \
795 SNDRV_PCM_FMTBIT_S32_LE) 795 SNDRV_PCM_FMTBIT_S32_LE)
796 796
797static struct snd_soc_dai_ops pxa_ssp_dai_ops = {
798 .startup = pxa_ssp_startup,
799 .shutdown = pxa_ssp_shutdown,
800 .trigger = pxa_ssp_trigger,
801 .hw_params = pxa_ssp_hw_params,
802 .set_sysclk = pxa_ssp_set_dai_sysclk,
803 .set_clkdiv = pxa_ssp_set_dai_clkdiv,
804 .set_pll = pxa_ssp_set_dai_pll,
805 .set_fmt = pxa_ssp_set_dai_fmt,
806 .set_tdm_slot = pxa_ssp_set_dai_tdm_slot,
807 .set_tristate = pxa_ssp_set_dai_tristate,
808};
809
797struct snd_soc_dai pxa_ssp_dai[] = { 810struct snd_soc_dai pxa_ssp_dai[] = {
798 { 811 {
799 .name = "pxa2xx-ssp1", 812 .name = "pxa2xx-ssp1",
@@ -814,18 +827,7 @@ struct snd_soc_dai pxa_ssp_dai[] = {
814 .rates = PXA_SSP_RATES, 827 .rates = PXA_SSP_RATES,
815 .formats = PXA_SSP_FORMATS, 828 .formats = PXA_SSP_FORMATS,
816 }, 829 },
817 .ops = { 830 .ops = &pxa_ssp_dai_ops,
818 .startup = pxa_ssp_startup,
819 .shutdown = pxa_ssp_shutdown,
820 .trigger = pxa_ssp_trigger,
821 .hw_params = pxa_ssp_hw_params,
822 .set_sysclk = pxa_ssp_set_dai_sysclk,
823 .set_clkdiv = pxa_ssp_set_dai_clkdiv,
824 .set_pll = pxa_ssp_set_dai_pll,
825 .set_fmt = pxa_ssp_set_dai_fmt,
826 .set_tdm_slot = pxa_ssp_set_dai_tdm_slot,
827 .set_tristate = pxa_ssp_set_dai_tristate,
828 },
829 }, 831 },
830 { .name = "pxa2xx-ssp2", 832 { .name = "pxa2xx-ssp2",
831 .id = 1, 833 .id = 1,
@@ -845,18 +847,7 @@ struct snd_soc_dai pxa_ssp_dai[] = {
845 .rates = PXA_SSP_RATES, 847 .rates = PXA_SSP_RATES,
846 .formats = PXA_SSP_FORMATS, 848 .formats = PXA_SSP_FORMATS,
847 }, 849 },
848 .ops = { 850 .ops = &pxa_ssp_dai_ops,
849 .startup = pxa_ssp_startup,
850 .shutdown = pxa_ssp_shutdown,
851 .trigger = pxa_ssp_trigger,
852 .hw_params = pxa_ssp_hw_params,
853 .set_sysclk = pxa_ssp_set_dai_sysclk,
854 .set_clkdiv = pxa_ssp_set_dai_clkdiv,
855 .set_pll = pxa_ssp_set_dai_pll,
856 .set_fmt = pxa_ssp_set_dai_fmt,
857 .set_tdm_slot = pxa_ssp_set_dai_tdm_slot,
858 .set_tristate = pxa_ssp_set_dai_tristate,
859 },
860 }, 851 },
861 { 852 {
862 .name = "pxa2xx-ssp3", 853 .name = "pxa2xx-ssp3",
@@ -877,18 +868,7 @@ struct snd_soc_dai pxa_ssp_dai[] = {
877 .rates = PXA_SSP_RATES, 868 .rates = PXA_SSP_RATES,
878 .formats = PXA_SSP_FORMATS, 869 .formats = PXA_SSP_FORMATS,
879 }, 870 },
880 .ops = { 871 .ops = &pxa_ssp_dai_ops,
881 .startup = pxa_ssp_startup,
882 .shutdown = pxa_ssp_shutdown,
883 .trigger = pxa_ssp_trigger,
884 .hw_params = pxa_ssp_hw_params,
885 .set_sysclk = pxa_ssp_set_dai_sysclk,
886 .set_clkdiv = pxa_ssp_set_dai_clkdiv,
887 .set_pll = pxa_ssp_set_dai_pll,
888 .set_fmt = pxa_ssp_set_dai_fmt,
889 .set_tdm_slot = pxa_ssp_set_dai_tdm_slot,
890 .set_tristate = pxa_ssp_set_dai_tristate,
891 },
892 }, 872 },
893 { 873 {
894 .name = "pxa2xx-ssp4", 874 .name = "pxa2xx-ssp4",
@@ -909,18 +889,7 @@ struct snd_soc_dai pxa_ssp_dai[] = {
909 .rates = PXA_SSP_RATES, 889 .rates = PXA_SSP_RATES,
910 .formats = PXA_SSP_FORMATS, 890 .formats = PXA_SSP_FORMATS,
911 }, 891 },
912 .ops = { 892 .ops = &pxa_ssp_dai_ops,
913 .startup = pxa_ssp_startup,
914 .shutdown = pxa_ssp_shutdown,
915 .trigger = pxa_ssp_trigger,
916 .hw_params = pxa_ssp_hw_params,
917 .set_sysclk = pxa_ssp_set_dai_sysclk,
918 .set_clkdiv = pxa_ssp_set_dai_clkdiv,
919 .set_pll = pxa_ssp_set_dai_pll,
920 .set_fmt = pxa_ssp_set_dai_fmt,
921 .set_tdm_slot = pxa_ssp_set_dai_tdm_slot,
922 .set_tristate = pxa_ssp_set_dai_tristate,
923 },
924 }, 893 },
925}; 894};
926EXPORT_SYMBOL_GPL(pxa_ssp_dai); 895EXPORT_SYMBOL_GPL(pxa_ssp_dai);
diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c
index 49a2810ca58c..cf809049272a 100644
--- a/sound/soc/pxa/pxa2xx-ac97.c
+++ b/sound/soc/pxa/pxa2xx-ac97.c
@@ -164,6 +164,10 @@ static int pxa2xx_ac97_hw_mic_params(struct snd_pcm_substream *substream,
164 SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | \ 164 SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | \
165 SNDRV_PCM_RATE_48000) 165 SNDRV_PCM_RATE_48000)
166 166
167static struct snd_soc_dai_ops pxa_ac97_dai_ops = {
168 .hw_params = pxa2xx_ac97_hw_params,
169};
170
167/* 171/*
168 * There is only 1 physical AC97 interface for pxa2xx, but it 172 * There is only 1 physical AC97 interface for pxa2xx, but it
169 * has extra fifo's that can be used for aux DACs and ADCs. 173 * has extra fifo's that can be used for aux DACs and ADCs.
@@ -189,8 +193,7 @@ struct snd_soc_dai pxa_ac97_dai[] = {
189 .channels_max = 2, 193 .channels_max = 2,
190 .rates = PXA2XX_AC97_RATES, 194 .rates = PXA2XX_AC97_RATES,
191 .formats = SNDRV_PCM_FMTBIT_S16_LE,}, 195 .formats = SNDRV_PCM_FMTBIT_S16_LE,},
192 .ops = { 196 .ops = &pxa_ac97_dai_ops,
193 .hw_params = pxa2xx_ac97_hw_params,},
194}, 197},
195{ 198{
196 .name = "pxa2xx-ac97-aux", 199 .name = "pxa2xx-ac97-aux",
@@ -208,8 +211,7 @@ struct snd_soc_dai pxa_ac97_dai[] = {
208 .channels_max = 1, 211 .channels_max = 1,
209 .rates = PXA2XX_AC97_RATES, 212 .rates = PXA2XX_AC97_RATES,
210 .formats = SNDRV_PCM_FMTBIT_S16_LE,}, 213 .formats = SNDRV_PCM_FMTBIT_S16_LE,},
211 .ops = { 214 .ops = &pxa_ac97_dai_ops,
212 .hw_params = pxa2xx_ac97_hw_aux_params,},
213}, 215},
214{ 216{
215 .name = "pxa2xx-ac97-mic", 217 .name = "pxa2xx-ac97-mic",
@@ -221,8 +223,7 @@ struct snd_soc_dai pxa_ac97_dai[] = {
221 .channels_max = 1, 223 .channels_max = 1,
222 .rates = PXA2XX_AC97_RATES, 224 .rates = PXA2XX_AC97_RATES,
223 .formats = SNDRV_PCM_FMTBIT_S16_LE,}, 225 .formats = SNDRV_PCM_FMTBIT_S16_LE,},
224 .ops = { 226 .ops = &pxa_ac97_dai_ops,
225 .hw_params = pxa2xx_ac97_hw_mic_params,},
226}, 227},
227}; 228};
228 229
diff --git a/sound/soc/pxa/pxa2xx-i2s.c b/sound/soc/pxa/pxa2xx-i2s.c
index 83b59d7fe96e..e6c24408c5f9 100644
--- a/sound/soc/pxa/pxa2xx-i2s.c
+++ b/sound/soc/pxa/pxa2xx-i2s.c
@@ -304,6 +304,15 @@ static int pxa2xx_i2s_resume(struct snd_soc_dai *dai)
304 SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | \ 304 SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | \
305 SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000) 305 SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000)
306 306
307static struct snd_soc_dai_ops pxa_i2s_dai_ops = {
308 .startup = pxa2xx_i2s_startup,
309 .shutdown = pxa2xx_i2s_shutdown,
310 .trigger = pxa2xx_i2s_trigger,
311 .hw_params = pxa2xx_i2s_hw_params,
312 .set_fmt = pxa2xx_i2s_set_dai_fmt,
313 .set_sysclk = pxa2xx_i2s_set_dai_sysclk,
314};
315
307struct snd_soc_dai pxa_i2s_dai = { 316struct snd_soc_dai pxa_i2s_dai = {
308 .name = "pxa2xx-i2s", 317 .name = "pxa2xx-i2s",
309 .id = 0, 318 .id = 0,
@@ -319,14 +328,7 @@ struct snd_soc_dai pxa_i2s_dai = {
319 .channels_max = 2, 328 .channels_max = 2,
320 .rates = PXA2XX_I2S_RATES, 329 .rates = PXA2XX_I2S_RATES,
321 .formats = SNDRV_PCM_FMTBIT_S16_LE,}, 330 .formats = SNDRV_PCM_FMTBIT_S16_LE,},
322 .ops = { 331 .ops = &pxa_i2s_dai_ops,
323 .startup = pxa2xx_i2s_startup,
324 .shutdown = pxa2xx_i2s_shutdown,
325 .trigger = pxa2xx_i2s_trigger,
326 .hw_params = pxa2xx_i2s_hw_params,
327 .set_fmt = pxa2xx_i2s_set_dai_fmt,
328 .set_sysclk = pxa2xx_i2s_set_dai_sysclk,
329 },
330}; 332};
331 333
332EXPORT_SYMBOL_GPL(pxa_i2s_dai); 334EXPORT_SYMBOL_GPL(pxa_i2s_dai);