mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-09 22:50:41 +00:00
ASoC: Convert wm8974 to table based DAPM and control init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
parent
7a389651bd
commit
a2bd691c64
@ -235,7 +235,7 @@ SND_SOC_DAPM_OUTPUT("SPKOUTP"),
|
|||||||
SND_SOC_DAPM_OUTPUT("SPKOUTN"),
|
SND_SOC_DAPM_OUTPUT("SPKOUTN"),
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct snd_soc_dapm_route audio_map[] = {
|
static const struct snd_soc_dapm_route wm8974_dapm_routes[] = {
|
||||||
/* Mono output mixer */
|
/* Mono output mixer */
|
||||||
{"Mono Mixer", "PCM Playback Switch", "DAC"},
|
{"Mono Mixer", "PCM Playback Switch", "DAC"},
|
||||||
{"Mono Mixer", "Aux Playback Switch", "Aux Input"},
|
{"Mono Mixer", "Aux Playback Switch", "Aux Input"},
|
||||||
@ -269,17 +269,6 @@ static const struct snd_soc_dapm_route audio_map[] = {
|
|||||||
{"Aux Input", NULL, "AUX"},
|
{"Aux Input", NULL, "AUX"},
|
||||||
};
|
};
|
||||||
|
|
||||||
static int wm8974_add_widgets(struct snd_soc_codec *codec)
|
|
||||||
{
|
|
||||||
struct snd_soc_dapm_context *dapm = &codec->dapm;
|
|
||||||
|
|
||||||
snd_soc_dapm_new_controls(dapm, wm8974_dapm_widgets,
|
|
||||||
ARRAY_SIZE(wm8974_dapm_widgets));
|
|
||||||
snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct pll_ {
|
struct pll_ {
|
||||||
unsigned int pre_div:1;
|
unsigned int pre_div:1;
|
||||||
unsigned int n:4;
|
unsigned int n:4;
|
||||||
@ -611,9 +600,6 @@ static int wm8974_probe(struct snd_soc_codec *codec)
|
|||||||
}
|
}
|
||||||
|
|
||||||
wm8974_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
|
wm8974_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
|
||||||
snd_soc_add_controls(codec, wm8974_snd_controls,
|
|
||||||
ARRAY_SIZE(wm8974_snd_controls));
|
|
||||||
wm8974_add_widgets(codec);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -634,6 +620,13 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8974 = {
|
|||||||
.reg_cache_size = ARRAY_SIZE(wm8974_reg),
|
.reg_cache_size = ARRAY_SIZE(wm8974_reg),
|
||||||
.reg_word_size = sizeof(u16),
|
.reg_word_size = sizeof(u16),
|
||||||
.reg_cache_default = wm8974_reg,
|
.reg_cache_default = wm8974_reg,
|
||||||
|
|
||||||
|
.controls = wm8974_snd_controls,
|
||||||
|
.num_controls = ARRAY_SIZE(wm8974_snd_controls),
|
||||||
|
.dapm_widgets = wm8974_dapm_widgets,
|
||||||
|
.num_dapm_widgets = ARRAY_SIZE(wm8974_dapm_widgets),
|
||||||
|
.dapm_routes = wm8974_dapm_routes,
|
||||||
|
.num_dapm_routes = ARRAY_SIZE(wm8974_dapm_routes),
|
||||||
};
|
};
|
||||||
|
|
||||||
static __devinit int wm8974_i2c_probe(struct i2c_client *i2c,
|
static __devinit int wm8974_i2c_probe(struct i2c_client *i2c,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user