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

ASoC: Use data based init for ak4671 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 f20eda5d
...@@ -352,7 +352,7 @@ static const struct snd_soc_dapm_widget ak4671_dapm_widgets[] = { ...@@ -352,7 +352,7 @@ static const struct snd_soc_dapm_widget ak4671_dapm_widgets[] = {
SND_SOC_DAPM_SUPPLY("PMPLL", AK4671_PLL_MODE_SELECT1, 0, 0, NULL, 0), SND_SOC_DAPM_SUPPLY("PMPLL", AK4671_PLL_MODE_SELECT1, 0, 0, NULL, 0),
}; };
static const struct snd_soc_dapm_route intercon[] = { static const struct snd_soc_dapm_route ak4671_intercon[] = {
{"DAC Left", "NULL", "PMPLL"}, {"DAC Left", "NULL", "PMPLL"},
{"DAC Right", "NULL", "PMPLL"}, {"DAC Right", "NULL", "PMPLL"},
{"ADC Left", "NULL", "PMPLL"}, {"ADC Left", "NULL", "PMPLL"},
...@@ -433,17 +433,6 @@ static const struct snd_soc_dapm_route intercon[] = { ...@@ -433,17 +433,6 @@ static const struct snd_soc_dapm_route intercon[] = {
{"ROUT3 Mixer", "RINS4", "RIN4 Mixing Circuit"}, {"ROUT3 Mixer", "RINS4", "RIN4 Mixing Circuit"},
}; };
static int ak4671_add_widgets(struct snd_soc_codec *codec)
{
struct snd_soc_dapm_context *dapm = &codec->dapm;
snd_soc_dapm_new_controls(dapm, ak4671_dapm_widgets,
ARRAY_SIZE(ak4671_dapm_widgets));
snd_soc_dapm_add_routes(dapm, intercon, ARRAY_SIZE(intercon));
return 0;
}
static int ak4671_hw_params(struct snd_pcm_substream *substream, static int ak4671_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params, struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai) struct snd_soc_dai *dai)
...@@ -650,7 +639,6 @@ static int ak4671_probe(struct snd_soc_codec *codec) ...@@ -650,7 +639,6 @@ static int ak4671_probe(struct snd_soc_codec *codec)
snd_soc_add_controls(codec, ak4671_snd_controls, snd_soc_add_controls(codec, ak4671_snd_controls,
ARRAY_SIZE(ak4671_snd_controls)); ARRAY_SIZE(ak4671_snd_controls));
ak4671_add_widgets(codec);
ak4671_set_bias_level(codec, SND_SOC_BIAS_STANDBY); ak4671_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
...@@ -670,6 +658,10 @@ static struct snd_soc_codec_driver soc_codec_dev_ak4671 = { ...@@ -670,6 +658,10 @@ static struct snd_soc_codec_driver soc_codec_dev_ak4671 = {
.reg_cache_size = AK4671_CACHEREGNUM, .reg_cache_size = AK4671_CACHEREGNUM,
.reg_word_size = sizeof(u8), .reg_word_size = sizeof(u8),
.reg_cache_default = ak4671_reg, .reg_cache_default = ak4671_reg,
.dapm_widgets = ak4671_dapm_widgets,
.num_dapm_widgets = ARRAY_SIZE(ak4671_dapm_widgets),
.dapm_routes = ak4671_intercon,
.num_dapm_routes = ARRAY_SIZE(ak4671_intercon),
}; };
static int __devinit ak4671_i2c_probe(struct i2c_client *client, static int __devinit ak4671_i2c_probe(struct i2c_client *client,
......
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