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/wm9713.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/wm9713.c')
-rw-r--r-- | sound/soc/codecs/wm9713.c | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/sound/soc/codecs/wm9713.c b/sound/soc/codecs/wm9713.c index a93aea5c1878..523bad077fa0 100644 --- a/sound/soc/codecs/wm9713.c +++ b/sound/soc/codecs/wm9713.c | |||
@@ -1005,6 +1005,27 @@ static int ac97_aux_prepare(struct snd_pcm_substream *substream, | |||
1005 | (SNDRV_PCM_FORMAT_S16_LE | SNDRV_PCM_FORMAT_S20_3LE | \ | 1005 | (SNDRV_PCM_FORMAT_S16_LE | SNDRV_PCM_FORMAT_S20_3LE | \ |
1006 | SNDRV_PCM_FORMAT_S24_LE) | 1006 | SNDRV_PCM_FORMAT_S24_LE) |
1007 | 1007 | ||
1008 | static struct snd_soc_dai_ops wm9713_dai_ops_hifi = { | ||
1009 | .prepare = ac97_hifi_prepare, | ||
1010 | .set_clkdiv = wm9713_set_dai_clkdiv, | ||
1011 | .set_pll = wm9713_set_dai_pll, | ||
1012 | }; | ||
1013 | |||
1014 | static struct snd_soc_dai_ops wm9713_dai_ops_aux = { | ||
1015 | .prepare = ac97_aux_prepare, | ||
1016 | .set_clkdiv = wm9713_set_dai_clkdiv, | ||
1017 | .set_pll = wm9713_set_dai_pll, | ||
1018 | }; | ||
1019 | |||
1020 | static struct snd_soc_dai_ops wm9713_dai_ops_voice = { | ||
1021 | .hw_params = wm9713_pcm_hw_params, | ||
1022 | .shutdown = wm9713_voiceshutdown, | ||
1023 | .set_clkdiv = wm9713_set_dai_clkdiv, | ||
1024 | .set_pll = wm9713_set_dai_pll, | ||
1025 | .set_fmt = wm9713_set_dai_fmt, | ||
1026 | .set_tristate = wm9713_set_dai_tristate, | ||
1027 | }; | ||
1028 | |||
1008 | struct snd_soc_dai wm9713_dai[] = { | 1029 | struct snd_soc_dai wm9713_dai[] = { |
1009 | { | 1030 | { |
1010 | .name = "AC97 HiFi", | 1031 | .name = "AC97 HiFi", |
@@ -1021,10 +1042,7 @@ struct snd_soc_dai wm9713_dai[] = { | |||
1021 | .channels_max = 2, | 1042 | .channels_max = 2, |
1022 | .rates = WM9713_RATES, | 1043 | .rates = WM9713_RATES, |
1023 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, | 1044 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, |
1024 | .ops = { | 1045 | .ops = &wm9713_dai_ops_hifi, |
1025 | .prepare = ac97_hifi_prepare, | ||
1026 | .set_clkdiv = wm9713_set_dai_clkdiv, | ||
1027 | .set_pll = wm9713_set_dai_pll,}, | ||
1028 | }, | 1046 | }, |
1029 | { | 1047 | { |
1030 | .name = "AC97 Aux", | 1048 | .name = "AC97 Aux", |
@@ -1034,10 +1052,7 @@ struct snd_soc_dai wm9713_dai[] = { | |||
1034 | .channels_max = 1, | 1052 | .channels_max = 1, |
1035 | .rates = WM9713_RATES, | 1053 | .rates = WM9713_RATES, |
1036 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, | 1054 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, |
1037 | .ops = { | 1055 | .ops = &wm9713_dai_ops_aux, |
1038 | .prepare = ac97_aux_prepare, | ||
1039 | .set_clkdiv = wm9713_set_dai_clkdiv, | ||
1040 | .set_pll = wm9713_set_dai_pll,}, | ||
1041 | }, | 1056 | }, |
1042 | { | 1057 | { |
1043 | .name = "WM9713 Voice", | 1058 | .name = "WM9713 Voice", |
@@ -1053,14 +1068,7 @@ struct snd_soc_dai wm9713_dai[] = { | |||
1053 | .channels_max = 2, | 1068 | .channels_max = 2, |
1054 | .rates = WM9713_PCM_RATES, | 1069 | .rates = WM9713_PCM_RATES, |
1055 | .formats = WM9713_PCM_FORMATS,}, | 1070 | .formats = WM9713_PCM_FORMATS,}, |
1056 | .ops = { | 1071 | .ops = &wm9713_dai_ops_voice, |
1057 | .hw_params = wm9713_pcm_hw_params, | ||
1058 | .shutdown = wm9713_voiceshutdown, | ||
1059 | .set_clkdiv = wm9713_set_dai_clkdiv, | ||
1060 | .set_pll = wm9713_set_dai_pll, | ||
1061 | .set_fmt = wm9713_set_dai_fmt, | ||
1062 | .set_tristate = wm9713_set_dai_tristate, | ||
1063 | }, | ||
1064 | }, | 1072 | }, |
1065 | }; | 1073 | }; |
1066 | EXPORT_SYMBOL_GPL(wm9713_dai); | 1074 | EXPORT_SYMBOL_GPL(wm9713_dai); |