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>
This commit is contained in:
parent
ff09d49ad0
commit
6335d05548
40 changed files with 481 additions and 428 deletions
|
@ -1497,6 +1497,15 @@ static int wm8903_hw_params(struct snd_pcm_substream *substream,
|
|||
SNDRV_PCM_FMTBIT_S20_3LE |\
|
||||
SNDRV_PCM_FMTBIT_S24_LE)
|
||||
|
||||
static struct snd_soc_dai_ops wm8903_dai_ops = {
|
||||
.startup = wm8903_startup,
|
||||
.shutdown = wm8903_shutdown,
|
||||
.hw_params = wm8903_hw_params,
|
||||
.digital_mute = wm8903_digital_mute,
|
||||
.set_fmt = wm8903_set_dai_fmt,
|
||||
.set_sysclk = wm8903_set_dai_sysclk,
|
||||
};
|
||||
|
||||
struct snd_soc_dai wm8903_dai = {
|
||||
.name = "WM8903",
|
||||
.playback = {
|
||||
|
@ -1513,14 +1522,7 @@ struct snd_soc_dai wm8903_dai = {
|
|||
.rates = WM8903_CAPTURE_RATES,
|
||||
.formats = WM8903_FORMATS,
|
||||
},
|
||||
.ops = {
|
||||
.startup = wm8903_startup,
|
||||
.shutdown = wm8903_shutdown,
|
||||
.hw_params = wm8903_hw_params,
|
||||
.digital_mute = wm8903_digital_mute,
|
||||
.set_fmt = wm8903_set_dai_fmt,
|
||||
.set_sysclk = wm8903_set_dai_sysclk
|
||||
}
|
||||
.ops = &wm8903_dai_ops,
|
||||
};
|
||||
EXPORT_SYMBOL_GPL(wm8903_dai);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue