diff options
author | Eric Miao <eric.y.miao@gmail.com> | 2009-03-03 09:41:00 +0800 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-03-04 22:29:47 +0000 |
commit | 6335d05548eece40092000aa91b64a50310d69d5 (patch) | |
tree | ac72c74562f349879a127b4067827476a7875c88 /sound/soc/sh/ssi.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/sh/ssi.c')
-rw-r--r-- | sound/soc/sh/ssi.c | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/sound/soc/sh/ssi.c b/sound/soc/sh/ssi.c index d1e5390fddeb..56fa0872abbb 100644 --- a/sound/soc/sh/ssi.c +++ b/sound/soc/sh/ssi.c @@ -336,6 +336,16 @@ static int ssi_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_U24_3LE | \ SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_U32_LE) +static struct snd_soc_dai_ops ssi_dai_ops = { + .startup = ssi_startup, + .shutdown = ssi_shutdown, + .trigger = ssi_trigger, + .hw_params = ssi_hw_params, + .set_sysclk = ssi_set_sysclk, + .set_clkdiv = ssi_set_clkdiv, + .set_fmt = ssi_set_fmt, +}; + struct snd_soc_dai sh4_ssi_dai[] = { { .name = "SSI0", @@ -352,15 +362,7 @@ struct snd_soc_dai sh4_ssi_dai[] = { .channels_min = 2, .channels_max = 8, }, - .ops = { - .startup = ssi_startup, - .shutdown = ssi_shutdown, - .trigger = ssi_trigger, - .hw_params = ssi_hw_params, - .set_sysclk = ssi_set_sysclk, - .set_clkdiv = ssi_set_clkdiv, - .set_fmt = ssi_set_fmt, - }, + .ops = &ssi_dai_ops, }, #ifdef CONFIG_CPU_SUBTYPE_SH7760 { @@ -378,15 +380,7 @@ struct snd_soc_dai sh4_ssi_dai[] = { .channels_min = 2, .channels_max = 8, }, - .ops = { - .startup = ssi_startup, - .shutdown = ssi_shutdown, - .trigger = ssi_trigger, - .hw_params = ssi_hw_params, - .set_sysclk = ssi_set_sysclk, - .set_clkdiv = ssi_set_clkdiv, - .set_fmt = ssi_set_fmt, - }, + .ops = &ssi_dai_ops, }, #endif }; |