Commit 20314000 authored by Lu Guanqun's avatar Lu Guanqun Committed by Mark Brown

ASoC: Use data based init for wm8711 DAPM

Signed-off-by: default avatarLu Guanqun <guanqun.lu@intel.com>
Acked-by: default avatarLiam Girdwood <lrg@ti.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 8428edf9
...@@ -77,7 +77,7 @@ SND_SOC_DAPM_OUTPUT("ROUT"), ...@@ -77,7 +77,7 @@ SND_SOC_DAPM_OUTPUT("ROUT"),
SND_SOC_DAPM_OUTPUT("RHPOUT"), SND_SOC_DAPM_OUTPUT("RHPOUT"),
}; };
static const struct snd_soc_dapm_route intercon[] = { static const struct snd_soc_dapm_route wm8711_intercon[] = {
/* output mixer */ /* output mixer */
{"Output Mixer", "Line Bypass Switch", "Line Input"}, {"Output Mixer", "Line Bypass Switch", "Line Input"},
{"Output Mixer", "HiFi Playback Switch", "DAC"}, {"Output Mixer", "HiFi Playback Switch", "DAC"},
...@@ -89,17 +89,6 @@ static const struct snd_soc_dapm_route intercon[] = { ...@@ -89,17 +89,6 @@ static const struct snd_soc_dapm_route intercon[] = {
{"LOUT", NULL, "Output Mixer"}, {"LOUT", NULL, "Output Mixer"},
}; };
static int wm8711_add_widgets(struct snd_soc_codec *codec)
{
struct snd_soc_dapm_context *dapm = &codec->dapm;
snd_soc_dapm_new_controls(dapm, wm8711_dapm_widgets,
ARRAY_SIZE(wm8711_dapm_widgets));
snd_soc_dapm_add_routes(dapm, intercon, ARRAY_SIZE(intercon));
return 0;
}
struct _coeff_div { struct _coeff_div {
u32 mclk; u32 mclk;
u32 rate; u32 rate;
...@@ -398,7 +387,6 @@ static int wm8711_probe(struct snd_soc_codec *codec) ...@@ -398,7 +387,6 @@ static int wm8711_probe(struct snd_soc_codec *codec)
snd_soc_add_controls(codec, wm8711_snd_controls, snd_soc_add_controls(codec, wm8711_snd_controls,
ARRAY_SIZE(wm8711_snd_controls)); ARRAY_SIZE(wm8711_snd_controls));
wm8711_add_widgets(codec);
return ret; return ret;
...@@ -420,6 +408,10 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8711 = { ...@@ -420,6 +408,10 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8711 = {
.reg_cache_size = ARRAY_SIZE(wm8711_reg), .reg_cache_size = ARRAY_SIZE(wm8711_reg),
.reg_word_size = sizeof(u16), .reg_word_size = sizeof(u16),
.reg_cache_default = wm8711_reg, .reg_cache_default = wm8711_reg,
.dapm_widgets = wm8711_dapm_widgets,
.num_dapm_widgets = ARRAY_SIZE(wm8711_dapm_widgets),
.dapm_routes = wm8711_intercon,
.num_dapm_routes = ARRAY_SIZE(wm8711_intercon),
}; };
#if defined(CONFIG_SPI_MASTER) #if defined(CONFIG_SPI_MASTER)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment