diff options
author | Eric Miao <eric.y.miao@gmail.com> | 2009-03-02 20:41:00 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-03-04 17:29:47 -0500 |
commit | 6335d05548eece40092000aa91b64a50310d69d5 (patch) | |
tree | ac72c74562f349879a127b4067827476a7875c88 /sound/soc/codecs/uda1380.c | |
parent | ff09d49ad0176a5f52a398c137a7ff5f669d6be4 (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/codecs/uda1380.c')
-rw-r--r-- | sound/soc/codecs/uda1380.c | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/sound/soc/codecs/uda1380.c b/sound/soc/codecs/uda1380.c index 5242b8156b38..cafa7684c0e7 100644 --- a/sound/soc/codecs/uda1380.c +++ b/sound/soc/codecs/uda1380.c | |||
@@ -583,6 +583,29 @@ static int uda1380_set_bias_level(struct snd_soc_codec *codec, | |||
583 | SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\ | 583 | SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\ |
584 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000) | 584 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000) |
585 | 585 | ||
586 | static struct snd_soc_dai_ops uda1380_dai_ops = { | ||
587 | .hw_params = uda1380_pcm_hw_params, | ||
588 | .shutdown = uda1380_pcm_shutdown, | ||
589 | .prepare = uda1380_pcm_prepare, | ||
590 | .digital_mute = uda1380_mute, | ||
591 | .set_fmt = uda1380_set_dai_fmt_both, | ||
592 | }; | ||
593 | |||
594 | static struct snd_soc_dai_ops uda1380_dai_ops_playback = { | ||
595 | .hw_params = uda1380_pcm_hw_params, | ||
596 | .shutdown = uda1380_pcm_shutdown, | ||
597 | .prepare = uda1380_pcm_prepare, | ||
598 | .digital_mute = uda1380_mute, | ||
599 | .set_fmt = uda1380_set_dai_fmt_playback, | ||
600 | }; | ||
601 | |||
602 | static struct snd_soc_dai_ops uda1380_dai_ops_capture = { | ||
603 | .hw_params = uda1380_pcm_hw_params, | ||
604 | .shutdown = uda1380_pcm_shutdown, | ||
605 | .prepare = uda1380_pcm_prepare, | ||
606 | .set_fmt = uda1380_set_dai_fmt_capture, | ||
607 | }; | ||
608 | |||
586 | struct snd_soc_dai uda1380_dai[] = { | 609 | struct snd_soc_dai uda1380_dai[] = { |
587 | { | 610 | { |
588 | .name = "UDA1380", | 611 | .name = "UDA1380", |
@@ -598,13 +621,7 @@ struct snd_soc_dai uda1380_dai[] = { | |||
598 | .channels_max = 2, | 621 | .channels_max = 2, |
599 | .rates = UDA1380_RATES, | 622 | .rates = UDA1380_RATES, |
600 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, | 623 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, |
601 | .ops = { | 624 | .ops = &uda1380_dai_ops, |
602 | .hw_params = uda1380_pcm_hw_params, | ||
603 | .shutdown = uda1380_pcm_shutdown, | ||
604 | .prepare = uda1380_pcm_prepare, | ||
605 | .digital_mute = uda1380_mute, | ||
606 | .set_fmt = uda1380_set_dai_fmt_both, | ||
607 | }, | ||
608 | }, | 625 | }, |
609 | { /* playback only - dual interface */ | 626 | { /* playback only - dual interface */ |
610 | .name = "UDA1380", | 627 | .name = "UDA1380", |
@@ -615,13 +632,7 @@ struct snd_soc_dai uda1380_dai[] = { | |||
615 | .rates = UDA1380_RATES, | 632 | .rates = UDA1380_RATES, |
616 | .formats = SNDRV_PCM_FMTBIT_S16_LE, | 633 | .formats = SNDRV_PCM_FMTBIT_S16_LE, |
617 | }, | 634 | }, |
618 | .ops = { | 635 | .ops = &uda1380_dai_ops_playback, |
619 | .hw_params = uda1380_pcm_hw_params, | ||
620 | .shutdown = uda1380_pcm_shutdown, | ||
621 | .prepare = uda1380_pcm_prepare, | ||
622 | .digital_mute = uda1380_mute, | ||
623 | .set_fmt = uda1380_set_dai_fmt_playback, | ||
624 | }, | ||
625 | }, | 636 | }, |
626 | { /* capture only - dual interface*/ | 637 | { /* capture only - dual interface*/ |
627 | .name = "UDA1380", | 638 | .name = "UDA1380", |
@@ -632,12 +643,7 @@ struct snd_soc_dai uda1380_dai[] = { | |||
632 | .rates = UDA1380_RATES, | 643 | .rates = UDA1380_RATES, |
633 | .formats = SNDRV_PCM_FMTBIT_S16_LE, | 644 | .formats = SNDRV_PCM_FMTBIT_S16_LE, |
634 | }, | 645 | }, |
635 | .ops = { | 646 | .ops = &uda1380_dai_ops_capture, |
636 | .hw_params = uda1380_pcm_hw_params, | ||
637 | .shutdown = uda1380_pcm_shutdown, | ||
638 | .prepare = uda1380_pcm_prepare, | ||
639 | .set_fmt = uda1380_set_dai_fmt_capture, | ||
640 | }, | ||
641 | }, | 647 | }, |
642 | }; | 648 | }; |
643 | EXPORT_SYMBOL_GPL(uda1380_dai); | 649 | EXPORT_SYMBOL_GPL(uda1380_dai); |