aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/s3c24xx
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/s3c24xx
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/s3c24xx')
-rw-r--r--sound/soc/s3c24xx/s3c2412-i2s.c16
-rw-r--r--sound/soc/s3c24xx/s3c2443-ac97.c13
-rw-r--r--sound/soc/s3c24xx/s3c24xx-i2s.c16
3 files changed, 25 insertions, 20 deletions
diff --git a/sound/soc/s3c24xx/s3c2412-i2s.c b/sound/soc/s3c24xx/s3c2412-i2s.c
index f3fc0aba0aaf..382d7eee53ef 100644
--- a/sound/soc/s3c24xx/s3c2412-i2s.c
+++ b/sound/soc/s3c24xx/s3c2412-i2s.c
@@ -708,6 +708,14 @@ static int s3c2412_i2s_resume(struct snd_soc_dai *dai)
708 SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \ 708 SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \
709 SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000) 709 SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000)
710 710
711static struct snd_soc_dai_ops s3c2412_i2s_dai_ops = {
712 .trigger = s3c2412_i2s_trigger,
713 .hw_params = s3c2412_i2s_hw_params,
714 .set_fmt = s3c2412_i2s_set_fmt,
715 .set_clkdiv = s3c2412_i2s_set_clkdiv,
716 .set_sysclk = s3c2412_i2s_set_sysclk,
717};
718
711struct snd_soc_dai s3c2412_i2s_dai = { 719struct snd_soc_dai s3c2412_i2s_dai = {
712 .name = "s3c2412-i2s", 720 .name = "s3c2412-i2s",
713 .id = 0, 721 .id = 0,
@@ -726,13 +734,7 @@ struct snd_soc_dai s3c2412_i2s_dai = {
726 .rates = S3C2412_I2S_RATES, 734 .rates = S3C2412_I2S_RATES,
727 .formats = SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE, 735 .formats = SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE,
728 }, 736 },
729 .ops = { 737 .ops = &s3c2412_i2s_dai_ops,
730 .trigger = s3c2412_i2s_trigger,
731 .hw_params = s3c2412_i2s_hw_params,
732 .set_fmt = s3c2412_i2s_set_fmt,
733 .set_clkdiv = s3c2412_i2s_set_clkdiv,
734 .set_sysclk = s3c2412_i2s_set_sysclk,
735 },
736}; 738};
737EXPORT_SYMBOL_GPL(s3c2412_i2s_dai); 739EXPORT_SYMBOL_GPL(s3c2412_i2s_dai);
738 740
diff --git a/sound/soc/s3c24xx/s3c2443-ac97.c b/sound/soc/s3c24xx/s3c2443-ac97.c
index 5822d2dd49ba..83ea623234e7 100644
--- a/sound/soc/s3c24xx/s3c2443-ac97.c
+++ b/sound/soc/s3c24xx/s3c2443-ac97.c
@@ -355,6 +355,11 @@ static int s3c2443_ac97_mic_trigger(struct snd_pcm_substream *substream,
355 SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | \ 355 SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | \
356 SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000) 356 SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000)
357 357
358static struct snd_soc_dai_ops s3c2443_ac97_dai_ops = {
359 .hw_params = s3c2443_ac97_hw_params,
360 .trigger = s3c2443_ac97_trigger,
361};
362
358struct snd_soc_dai s3c2443_ac97_dai[] = { 363struct snd_soc_dai s3c2443_ac97_dai[] = {
359{ 364{
360 .name = "s3c2443-ac97", 365 .name = "s3c2443-ac97",
@@ -374,9 +379,7 @@ struct snd_soc_dai s3c2443_ac97_dai[] = {
374 .channels_max = 2, 379 .channels_max = 2,
375 .rates = s3c2443_AC97_RATES, 380 .rates = s3c2443_AC97_RATES,
376 .formats = SNDRV_PCM_FMTBIT_S16_LE,}, 381 .formats = SNDRV_PCM_FMTBIT_S16_LE,},
377 .ops = { 382 .ops = &s3c2443_ac97_dai_ops,
378 .hw_params = s3c2443_ac97_hw_params,
379 .trigger = s3c2443_ac97_trigger},
380}, 383},
381{ 384{
382 .name = "pxa2xx-ac97-mic", 385 .name = "pxa2xx-ac97-mic",
@@ -388,9 +391,7 @@ struct snd_soc_dai s3c2443_ac97_dai[] = {
388 .channels_max = 1, 391 .channels_max = 1,
389 .rates = s3c2443_AC97_RATES, 392 .rates = s3c2443_AC97_RATES,
390 .formats = SNDRV_PCM_FMTBIT_S16_LE,}, 393 .formats = SNDRV_PCM_FMTBIT_S16_LE,},
391 .ops = { 394 .ops = &s3c2443_ac97_dai_ops,
392 .hw_params = s3c2443_ac97_hw_mic_params,
393 .trigger = s3c2443_ac97_mic_trigger,},
394}, 395},
395}; 396};
396EXPORT_SYMBOL_GPL(s3c2443_ac97_dai); 397EXPORT_SYMBOL_GPL(s3c2443_ac97_dai);
diff --git a/sound/soc/s3c24xx/s3c24xx-i2s.c b/sound/soc/s3c24xx/s3c24xx-i2s.c
index 1c2b05497107..4473fb584c4c 100644
--- a/sound/soc/s3c24xx/s3c24xx-i2s.c
+++ b/sound/soc/s3c24xx/s3c24xx-i2s.c
@@ -456,6 +456,14 @@ static int s3c24xx_i2s_resume(struct snd_soc_dai *cpu_dai)
456 SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \ 456 SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \
457 SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000) 457 SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000)
458 458
459static struct snd_soc_dai_ops s3c24xx_i2s_dai_ops = {
460 .trigger = s3c24xx_i2s_trigger,
461 .hw_params = s3c24xx_i2s_hw_params,
462 .set_fmt = s3c24xx_i2s_set_fmt,
463 .set_clkdiv = s3c24xx_i2s_set_clkdiv,
464 .set_sysclk = s3c24xx_i2s_set_sysclk,
465};
466
459struct snd_soc_dai s3c24xx_i2s_dai = { 467struct snd_soc_dai s3c24xx_i2s_dai = {
460 .name = "s3c24xx-i2s", 468 .name = "s3c24xx-i2s",
461 .id = 0, 469 .id = 0,
@@ -472,13 +480,7 @@ struct snd_soc_dai s3c24xx_i2s_dai = {
472 .channels_max = 2, 480 .channels_max = 2,
473 .rates = S3C24XX_I2S_RATES, 481 .rates = S3C24XX_I2S_RATES,
474 .formats = SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE,}, 482 .formats = SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE,},
475 .ops = { 483 .ops = &s3c24xx_i2s_dai_ops,
476 .trigger = s3c24xx_i2s_trigger,
477 .hw_params = s3c24xx_i2s_hw_params,
478 .set_fmt = s3c24xx_i2s_set_fmt,
479 .set_clkdiv = s3c24xx_i2s_set_clkdiv,
480 .set_sysclk = s3c24xx_i2s_set_sysclk,
481 },
482}; 484};
483EXPORT_SYMBOL_GPL(s3c24xx_i2s_dai); 485EXPORT_SYMBOL_GPL(s3c24xx_i2s_dai);
484 486