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/wm9712.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/wm9712.c')
-rw-r--r-- | sound/soc/codecs/wm9712.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c index b3a8be77676e..765cf1e7369e 100644 --- a/sound/soc/codecs/wm9712.c +++ b/sound/soc/codecs/wm9712.c | |||
@@ -517,6 +517,14 @@ static int ac97_aux_prepare(struct snd_pcm_substream *substream, | |||
517 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 |\ | 517 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 |\ |
518 | SNDRV_PCM_RATE_48000) | 518 | SNDRV_PCM_RATE_48000) |
519 | 519 | ||
520 | static struct snd_soc_dai_ops wm9712_dai_ops_hifi = { | ||
521 | .prepare = ac97_prepare, | ||
522 | }; | ||
523 | |||
524 | static struct snd_soc_dai_ops wm9712_dai_ops_aux = { | ||
525 | .prepare = ac97_aux_prepare, | ||
526 | }; | ||
527 | |||
520 | struct snd_soc_dai wm9712_dai[] = { | 528 | struct snd_soc_dai wm9712_dai[] = { |
521 | { | 529 | { |
522 | .name = "AC97 HiFi", | 530 | .name = "AC97 HiFi", |
@@ -533,8 +541,7 @@ struct snd_soc_dai wm9712_dai[] = { | |||
533 | .channels_max = 2, | 541 | .channels_max = 2, |
534 | .rates = WM9712_AC97_RATES, | 542 | .rates = WM9712_AC97_RATES, |
535 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, | 543 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, |
536 | .ops = { | 544 | .ops = &wm9712_dai_ops_hifi, |
537 | .prepare = ac97_prepare,}, | ||
538 | }, | 545 | }, |
539 | { | 546 | { |
540 | .name = "AC97 Aux", | 547 | .name = "AC97 Aux", |
@@ -544,8 +551,7 @@ struct snd_soc_dai wm9712_dai[] = { | |||
544 | .channels_max = 1, | 551 | .channels_max = 1, |
545 | .rates = WM9712_AC97_RATES, | 552 | .rates = WM9712_AC97_RATES, |
546 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, | 553 | .formats = SNDRV_PCM_FMTBIT_S16_LE,}, |
547 | .ops = { | 554 | .ops = &wm9712_dai_ops_aux, |
548 | .prepare = ac97_aux_prepare,}, | ||
549 | } | 555 | } |
550 | }; | 556 | }; |
551 | EXPORT_SYMBOL_GPL(wm9712_dai); | 557 | EXPORT_SYMBOL_GPL(wm9712_dai); |