aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/fsl
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/fsl
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/fsl')
-rw-r--r--sound/soc/fsl/fsl_ssi.c18
-rw-r--r--sound/soc/fsl/mpc5200_psc_i2s.c20
2 files changed, 21 insertions, 17 deletions
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 6844009833db..0fddd437a7c9 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -562,6 +562,15 @@ static int fsl_ssi_set_fmt(struct snd_soc_dai *cpu_dai, unsigned int format)
562/** 562/**
563 * fsl_ssi_dai_template: template CPU DAI for the SSI 563 * fsl_ssi_dai_template: template CPU DAI for the SSI
564 */ 564 */
565static struct snd_soc_dai_ops fsl_ssi_dai_ops = {
566 .startup = fsl_ssi_startup,
567 .hw_params = fsl_ssi_hw_params,
568 .shutdown = fsl_ssi_shutdown,
569 .trigger = fsl_ssi_trigger,
570 .set_sysclk = fsl_ssi_set_sysclk,
571 .set_fmt = fsl_ssi_set_fmt,
572};
573
565static struct snd_soc_dai fsl_ssi_dai_template = { 574static struct snd_soc_dai fsl_ssi_dai_template = {
566 .playback = { 575 .playback = {
567 /* The SSI does not support monaural audio. */ 576 /* The SSI does not support monaural audio. */
@@ -576,14 +585,7 @@ static struct snd_soc_dai fsl_ssi_dai_template = {
576 .rates = FSLSSI_I2S_RATES, 585 .rates = FSLSSI_I2S_RATES,
577 .formats = FSLSSI_I2S_FORMATS, 586 .formats = FSLSSI_I2S_FORMATS,
578 }, 587 },
579 .ops = { 588 .ops = &fsl_ssi_dai_ops,
580 .startup = fsl_ssi_startup,
581 .hw_params = fsl_ssi_hw_params,
582 .shutdown = fsl_ssi_shutdown,
583 .trigger = fsl_ssi_trigger,
584 .set_sysclk = fsl_ssi_set_sysclk,
585 .set_fmt = fsl_ssi_set_fmt,
586 },
587}; 589};
588 590
589/** 591/**
diff --git a/sound/soc/fsl/mpc5200_psc_i2s.c b/sound/soc/fsl/mpc5200_psc_i2s.c
index 9eb1ce185bd0..3aa729df27b5 100644
--- a/sound/soc/fsl/mpc5200_psc_i2s.c
+++ b/sound/soc/fsl/mpc5200_psc_i2s.c
@@ -468,6 +468,16 @@ static int psc_i2s_set_fmt(struct snd_soc_dai *cpu_dai, unsigned int format)
468/** 468/**
469 * psc_i2s_dai_template: template CPU Digital Audio Interface 469 * psc_i2s_dai_template: template CPU Digital Audio Interface
470 */ 470 */
471static struct snd_soc_dai_ops psc_i2s_dai_ops = {
472 .startup = psc_i2s_startup,
473 .hw_params = psc_i2s_hw_params,
474 .hw_free = psc_i2s_hw_free,
475 .shutdown = psc_i2s_shutdown,
476 .trigger = psc_i2s_trigger,
477 .set_sysclk = psc_i2s_set_sysclk,
478 .set_fmt = psc_i2s_set_fmt,
479};
480
471static struct snd_soc_dai psc_i2s_dai_template = { 481static struct snd_soc_dai psc_i2s_dai_template = {
472 .playback = { 482 .playback = {
473 .channels_min = 2, 483 .channels_min = 2,
@@ -481,15 +491,7 @@ static struct snd_soc_dai psc_i2s_dai_template = {
481 .rates = PSC_I2S_RATES, 491 .rates = PSC_I2S_RATES,
482 .formats = PSC_I2S_FORMATS, 492 .formats = PSC_I2S_FORMATS,
483 }, 493 },
484 .ops = { 494 .ops = &psc_i2s_dai_ops,
485 .startup = psc_i2s_startup,
486 .hw_params = psc_i2s_hw_params,
487 .hw_free = psc_i2s_hw_free,
488 .shutdown = psc_i2s_shutdown,
489 .trigger = psc_i2s_trigger,
490 .set_sysclk = psc_i2s_set_sysclk,
491 .set_fmt = psc_i2s_set_fmt,
492 },
493}; 495};
494 496
495/* --------------------------------------------------------------------- 497/* ---------------------------------------------------------------------