Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 89989637 authored by Fabio Estevam's avatar Fabio Estevam Committed by Mark Brown
Browse files

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



Convert to table based DAPM and control init.

Signed-off-by: default avatarFabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 82fa3670
Loading
Loading
Loading
Loading
+7 −10
Original line number Original line Diff line number Diff line
@@ -227,7 +227,7 @@ static const struct snd_soc_dapm_widget sgtl5000_dapm_widgets[] = {
};
};


/* routes for sgtl5000 */
/* routes for sgtl5000 */
static const struct snd_soc_dapm_route audio_map[] = {
static const struct snd_soc_dapm_route sgtl5000_dapm_routes[] = {
	{"Capture Mux", "LINE_IN", "LINE_IN"},	/* line_in --> adc_mux */
	{"Capture Mux", "LINE_IN", "LINE_IN"},	/* line_in --> adc_mux */
	{"Capture Mux", "MIC_IN", "MIC_IN"},	/* mic_in --> adc_mux */
	{"Capture Mux", "MIC_IN", "MIC_IN"},	/* mic_in --> adc_mux */


@@ -1353,15 +1353,6 @@ static int sgtl5000_probe(struct snd_soc_codec *codec)
	if (ret)
	if (ret)
		goto err;
		goto err;


	snd_soc_add_controls(codec, sgtl5000_snd_controls,
			     ARRAY_SIZE(sgtl5000_snd_controls));

	snd_soc_dapm_new_controls(&codec->dapm, sgtl5000_dapm_widgets,
				  ARRAY_SIZE(sgtl5000_dapm_widgets));

	snd_soc_dapm_add_routes(&codec->dapm, audio_map,
				ARRAY_SIZE(audio_map));

	snd_soc_dapm_new_widgets(&codec->dapm);
	snd_soc_dapm_new_widgets(&codec->dapm);


	return 0;
	return 0;
@@ -1402,6 +1393,12 @@ static struct snd_soc_codec_driver sgtl5000_driver = {
	.reg_cache_step = 2,
	.reg_cache_step = 2,
	.reg_cache_default = sgtl5000_regs,
	.reg_cache_default = sgtl5000_regs,
	.volatile_register = sgtl5000_volatile_register,
	.volatile_register = sgtl5000_volatile_register,
	.controls = sgtl5000_snd_controls,
	.num_controls = ARRAY_SIZE(sgtl5000_snd_controls),
	.dapm_widgets = sgtl500_dapm_widgets,
	.num_dapm_widgets = ARRAY_SIZE(sgtl500_dapm_widgets),
	.dapm_routes = sgtl500_dapm_routes,
	.num_dapm_routes = ARRAY_SIZE(sgtl500_dapm_routes),
};
};


static __devinit int sgtl5000_i2c_probe(struct i2c_client *client,
static __devinit int sgtl5000_i2c_probe(struct i2c_client *client,