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

ASoC: Use data based init for ak4535 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 a7dca707
...@@ -230,7 +230,7 @@ static const struct snd_soc_dapm_widget ak4535_dapm_widgets[] = { ...@@ -230,7 +230,7 @@ static const struct snd_soc_dapm_widget ak4535_dapm_widgets[] = {
SND_SOC_DAPM_INPUT("AIN"), SND_SOC_DAPM_INPUT("AIN"),
}; };
static const struct snd_soc_dapm_route audio_map[] = { static const struct snd_soc_dapm_route ak4535_audio_map[] = {
/*stereo mixer */ /*stereo mixer */
{"Stereo Mixer", "Playback Switch", "DAC"}, {"Stereo Mixer", "Playback Switch", "DAC"},
{"Stereo Mixer", "Mic Sidetone Switch", "Mic"}, {"Stereo Mixer", "Mic Sidetone Switch", "Mic"},
...@@ -287,17 +287,6 @@ static const struct snd_soc_dapm_route audio_map[] = { ...@@ -287,17 +287,6 @@ static const struct snd_soc_dapm_route audio_map[] = {
{"Input Mixer", "Aux Capture Switch", "Aux In"}, {"Input Mixer", "Aux Capture Switch", "Aux In"},
}; };
static int ak4535_add_widgets(struct snd_soc_codec *codec)
{
struct snd_soc_dapm_context *dapm = &codec->dapm;
snd_soc_dapm_new_controls(dapm, ak4535_dapm_widgets,
ARRAY_SIZE(ak4535_dapm_widgets));
snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
return 0;
}
static int ak4535_set_dai_sysclk(struct snd_soc_dai *codec_dai, static int ak4535_set_dai_sysclk(struct snd_soc_dai *codec_dai,
int clk_id, unsigned int freq, int dir) int clk_id, unsigned int freq, int dir)
{ {
...@@ -457,8 +446,6 @@ static int ak4535_probe(struct snd_soc_codec *codec) ...@@ -457,8 +446,6 @@ static int ak4535_probe(struct snd_soc_codec *codec)
snd_soc_add_controls(codec, ak4535_snd_controls, snd_soc_add_controls(codec, ak4535_snd_controls,
ARRAY_SIZE(ak4535_snd_controls)); ARRAY_SIZE(ak4535_snd_controls));
ak4535_add_widgets(codec);
return 0; return 0;
} }
...@@ -480,6 +467,10 @@ static struct snd_soc_codec_driver soc_codec_dev_ak4535 = { ...@@ -480,6 +467,10 @@ static struct snd_soc_codec_driver soc_codec_dev_ak4535 = {
.reg_cache_size = ARRAY_SIZE(ak4535_reg), .reg_cache_size = ARRAY_SIZE(ak4535_reg),
.reg_word_size = sizeof(u8), .reg_word_size = sizeof(u8),
.reg_cache_default = ak4535_reg, .reg_cache_default = ak4535_reg,
.dapm_widgets = ak4535_dapm_widgets,
.num_dapm_widgets = ARRAY_SIZE(ak4535_dapm_widgets),
.dapm_routes = ak4535_audio_map,
.num_dapm_routes = ARRAY_SIZE(ak4535_audio_map),
}; };
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
......
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