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

Commit c4850644 authored by Mark Brown's avatar Mark Brown
Browse files

ASoC: Convert wm8971 to table based DAPM and control init

parent 542cc361
Loading
Loading
Loading
Loading
+8 −16
Original line number Original line Diff line number Diff line
@@ -252,7 +252,7 @@ static const struct snd_soc_dapm_widget wm8971_dapm_widgets[] = {
	SND_SOC_DAPM_INPUT("MIC"),
	SND_SOC_DAPM_INPUT("MIC"),
};
};


static const struct snd_soc_dapm_route audio_map[] = {
static const struct snd_soc_dapm_route wm8971_dapm_routes[] = {
	/* left mixer */
	/* left mixer */
	{"Left Mixer", "Playback Switch", "Left DAC"},
	{"Left Mixer", "Playback Switch", "Left DAC"},
	{"Left Mixer", "Left Bypass Switch", "Left Line Mux"},
	{"Left Mixer", "Left Bypass Switch", "Left Line Mux"},
@@ -329,17 +329,6 @@ static const struct snd_soc_dapm_route audio_map[] = {
	{"Right ADC", NULL, "Right ADC Mux"},
	{"Right ADC", NULL, "Right ADC Mux"},
};
};


static int wm8971_add_widgets(struct snd_soc_codec *codec)
{
	struct snd_soc_dapm_context *dapm = &codec->dapm;

	snd_soc_dapm_new_controls(dapm, wm8971_dapm_widgets,
				  ARRAY_SIZE(wm8971_dapm_widgets));
	snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));

	return 0;
}

struct _coeff_div {
struct _coeff_div {
	u32 mclk;
	u32 mclk;
	u32 rate;
	u32 rate;
@@ -659,10 +648,6 @@ static int wm8971_probe(struct snd_soc_codec *codec)
	snd_soc_update_bits(codec, WM8971_LINVOL, 0x0100, 0x0100);
	snd_soc_update_bits(codec, WM8971_LINVOL, 0x0100, 0x0100);
	snd_soc_update_bits(codec, WM8971_RINVOL, 0x0100, 0x0100);
	snd_soc_update_bits(codec, WM8971_RINVOL, 0x0100, 0x0100);


	snd_soc_add_controls(codec, wm8971_snd_controls,
				ARRAY_SIZE(wm8971_snd_controls));
	wm8971_add_widgets(codec);

	return ret;
	return ret;
}
}


@@ -686,6 +671,13 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8971 = {
	.reg_cache_size = ARRAY_SIZE(wm8971_reg),
	.reg_cache_size = ARRAY_SIZE(wm8971_reg),
	.reg_word_size = sizeof(u16),
	.reg_word_size = sizeof(u16),
	.reg_cache_default = wm8971_reg,
	.reg_cache_default = wm8971_reg,

	.controls = wm8971_snd_controls,
	.num_controls = ARRAY_SIZE(wm8971_snd_controls),
	.dapm_widgets = wm8971_dapm_widgets,
	.num_dapm_widgets = ARRAY_SIZE(wm8971_dapm_widgets),
	.dapm_routes = wm8971_dapm_routes,
	.num_dapm_routes = ARRAY_SIZE(wm8971_dapm_routes),
};
};


static __devinit int wm8971_i2c_probe(struct i2c_client *i2c,
static __devinit int wm8971_i2c_probe(struct i2c_client *i2c,