Commit dd21353f authored by Mark Brown's avatar Mark Brown

ASoC: wm8988: Convert to table based DAPM and control init

Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 411a3450
...@@ -317,7 +317,7 @@ static const struct snd_soc_dapm_widget wm8988_dapm_widgets[] = { ...@@ -317,7 +317,7 @@ static const struct snd_soc_dapm_widget wm8988_dapm_widgets[] = {
SND_SOC_DAPM_INPUT("RINPUT2"), SND_SOC_DAPM_INPUT("RINPUT2"),
}; };
static const struct snd_soc_dapm_route audio_map[] = { static const struct snd_soc_dapm_route wm8988_dapm_routes[] = {
{ "Left Line Mux", "Line 1", "LINPUT1" }, { "Left Line Mux", "Line 1", "LINPUT1" },
{ "Left Line Mux", "Line 2", "LINPUT2" }, { "Left Line Mux", "Line 2", "LINPUT2" },
...@@ -743,7 +743,6 @@ static int wm8988_resume(struct snd_soc_codec *codec) ...@@ -743,7 +743,6 @@ static int wm8988_resume(struct snd_soc_codec *codec)
static int wm8988_probe(struct snd_soc_codec *codec) static int wm8988_probe(struct snd_soc_codec *codec)
{ {
struct wm8988_priv *wm8988 = snd_soc_codec_get_drvdata(codec); struct wm8988_priv *wm8988 = snd_soc_codec_get_drvdata(codec);
struct snd_soc_dapm_context *dapm = &codec->dapm;
int ret = 0; int ret = 0;
ret = snd_soc_codec_set_cache_io(codec, 7, 9, wm8988->control_type); ret = snd_soc_codec_set_cache_io(codec, 7, 9, wm8988->control_type);
...@@ -767,12 +766,6 @@ static int wm8988_probe(struct snd_soc_codec *codec) ...@@ -767,12 +766,6 @@ static int wm8988_probe(struct snd_soc_codec *codec)
wm8988_set_bias_level(codec, SND_SOC_BIAS_STANDBY); wm8988_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
snd_soc_add_controls(codec, wm8988_snd_controls,
ARRAY_SIZE(wm8988_snd_controls));
snd_soc_dapm_new_controls(dapm, wm8988_dapm_widgets,
ARRAY_SIZE(wm8988_dapm_widgets));
snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
return 0; return 0;
} }
...@@ -791,6 +784,13 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8988 = { ...@@ -791,6 +784,13 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8988 = {
.reg_cache_size = ARRAY_SIZE(wm8988_reg), .reg_cache_size = ARRAY_SIZE(wm8988_reg),
.reg_word_size = sizeof(u16), .reg_word_size = sizeof(u16),
.reg_cache_default = wm8988_reg, .reg_cache_default = wm8988_reg,
.controls = wm8988_snd_controls,
.num_controls = ARRAY_SIZE(wm8988_snd_controls),
.dapm_widgets = wm8988_dapm_widgets,
.num_dapm_widgets = ARRAY_SIZE(wm8988_dapm_widgets),
.dapm_routes = wm8988_dapm_routes,
.num_dapm_routes = ARRAY_SIZE(wm8988_dapm_routes),
}; };
#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