Commit 8428edf9 authored by Lu Guanqun's avatar Lu Guanqun Committed by Mark Brown

ASoC: Use data based init for wm8728 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 97a58d6e
...@@ -65,22 +65,11 @@ SND_SOC_DAPM_OUTPUT("VOUTL"), ...@@ -65,22 +65,11 @@ SND_SOC_DAPM_OUTPUT("VOUTL"),
SND_SOC_DAPM_OUTPUT("VOUTR"), SND_SOC_DAPM_OUTPUT("VOUTR"),
}; };
static const struct snd_soc_dapm_route intercon[] = { static const struct snd_soc_dapm_route wm8728_intercon[] = {
{"VOUTL", NULL, "DAC"}, {"VOUTL", NULL, "DAC"},
{"VOUTR", NULL, "DAC"}, {"VOUTR", NULL, "DAC"},
}; };
static int wm8728_add_widgets(struct snd_soc_codec *codec)
{
struct snd_soc_dapm_context *dapm = &codec->dapm;
snd_soc_dapm_new_controls(dapm, wm8728_dapm_widgets,
ARRAY_SIZE(wm8728_dapm_widgets));
snd_soc_dapm_add_routes(dapm, intercon, ARRAY_SIZE(intercon));
return 0;
}
static int wm8728_mute(struct snd_soc_dai *dai, int mute) static int wm8728_mute(struct snd_soc_dai *dai, int mute)
{ {
struct snd_soc_codec *codec = dai->codec; struct snd_soc_codec *codec = dai->codec;
...@@ -255,7 +244,6 @@ static int wm8728_probe(struct snd_soc_codec *codec) ...@@ -255,7 +244,6 @@ static int wm8728_probe(struct snd_soc_codec *codec)
snd_soc_add_controls(codec, wm8728_snd_controls, snd_soc_add_controls(codec, wm8728_snd_controls,
ARRAY_SIZE(wm8728_snd_controls)); ARRAY_SIZE(wm8728_snd_controls));
wm8728_add_widgets(codec);
return ret; return ret;
} }
...@@ -275,6 +263,10 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8728 = { ...@@ -275,6 +263,10 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8728 = {
.reg_cache_size = ARRAY_SIZE(wm8728_reg_defaults), .reg_cache_size = ARRAY_SIZE(wm8728_reg_defaults),
.reg_word_size = sizeof(u16), .reg_word_size = sizeof(u16),
.reg_cache_default = wm8728_reg_defaults, .reg_cache_default = wm8728_reg_defaults,
.dapm_widgets = wm8728_dapm_widgets,
.num_dapm_widgets = ARRAY_SIZE(wm8728_dapm_widgets),
.dapm_routes = wm8728_intercon,
.num_dapm_routes = ARRAY_SIZE(wm8728_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