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/wm8580.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/wm8580.c')
-rw-r--r-- | sound/soc/codecs/wm8580.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c index d3c51ba5e6f9..ee0af23a1acc 100644 --- a/sound/soc/codecs/wm8580.c +++ b/sound/soc/codecs/wm8580.c | |||
@@ -771,6 +771,21 @@ static int wm8580_set_bias_level(struct snd_soc_codec *codec, | |||
771 | #define WM8580_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ | 771 | #define WM8580_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ |
772 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) | 772 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) |
773 | 773 | ||
774 | static struct snd_soc_dai_ops wm8580_dai_ops_playback = { | ||
775 | .hw_params = wm8580_paif_hw_params, | ||
776 | .set_fmt = wm8580_set_paif_dai_fmt, | ||
777 | .set_clkdiv = wm8580_set_dai_clkdiv, | ||
778 | .set_pll = wm8580_set_dai_pll, | ||
779 | .digital_mute = wm8580_digital_mute, | ||
780 | }; | ||
781 | |||
782 | static struct snd_soc_dai_ops wm8580_dai_ops_capture = { | ||
783 | .hw_params = wm8580_paif_hw_params, | ||
784 | .set_fmt = wm8580_set_paif_dai_fmt, | ||
785 | .set_clkdiv = wm8580_set_dai_clkdiv, | ||
786 | .set_pll = wm8580_set_dai_pll, | ||
787 | }; | ||
788 | |||
774 | struct snd_soc_dai wm8580_dai[] = { | 789 | struct snd_soc_dai wm8580_dai[] = { |
775 | { | 790 | { |
776 | .name = "WM8580 PAIFRX", | 791 | .name = "WM8580 PAIFRX", |
@@ -782,13 +797,7 @@ struct snd_soc_dai wm8580_dai[] = { | |||
782 | .rates = SNDRV_PCM_RATE_8000_192000, | 797 | .rates = SNDRV_PCM_RATE_8000_192000, |
783 | .formats = WM8580_FORMATS, | 798 | .formats = WM8580_FORMATS, |
784 | }, | 799 | }, |
785 | .ops = { | 800 | .ops = &wm8580_dai_ops_playback, |
786 | .hw_params = wm8580_paif_hw_params, | ||
787 | .set_fmt = wm8580_set_paif_dai_fmt, | ||
788 | .set_clkdiv = wm8580_set_dai_clkdiv, | ||
789 | .set_pll = wm8580_set_dai_pll, | ||
790 | .digital_mute = wm8580_digital_mute, | ||
791 | }, | ||
792 | }, | 801 | }, |
793 | { | 802 | { |
794 | .name = "WM8580 PAIFTX", | 803 | .name = "WM8580 PAIFTX", |
@@ -800,12 +809,7 @@ struct snd_soc_dai wm8580_dai[] = { | |||
800 | .rates = SNDRV_PCM_RATE_8000_192000, | 809 | .rates = SNDRV_PCM_RATE_8000_192000, |
801 | .formats = WM8580_FORMATS, | 810 | .formats = WM8580_FORMATS, |
802 | }, | 811 | }, |
803 | .ops = { | 812 | .ops = &wm8580_dai_ops_capture, |
804 | .hw_params = wm8580_paif_hw_params, | ||
805 | .set_fmt = wm8580_set_paif_dai_fmt, | ||
806 | .set_clkdiv = wm8580_set_dai_clkdiv, | ||
807 | .set_pll = wm8580_set_dai_pll, | ||
808 | }, | ||
809 | }, | 813 | }, |
810 | }; | 814 | }; |
811 | EXPORT_SYMBOL_GPL(wm8580_dai); | 815 | EXPORT_SYMBOL_GPL(wm8580_dai); |