diff options
author | Axel Lin <axel.lin@gmail.com> | 2011-12-19 00:13:31 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-19 19:32:24 -0500 |
commit | 5ee65ec628090a3dbfbd900e4174f56e92e70945 (patch) | |
tree | 906141eefd3f95a4d955924a29425798fba4ec1f /sound/soc/codecs/max9850.c | |
parent | 202a51a8d9c1fddea9eca5953e6e7d7d504a4343 (diff) |
ASoC: Convert max9850 to table based DAPM and control init
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/max9850.c')
-rw-r--r-- | sound/soc/codecs/max9850.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/sound/soc/codecs/max9850.c b/sound/soc/codecs/max9850.c index 7dfd6e84796d..47060d2afe90 100644 --- a/sound/soc/codecs/max9850.c +++ b/sound/soc/codecs/max9850.c | |||
@@ -86,7 +86,7 @@ SND_SOC_DAPM_INPUT("INL"), | |||
86 | SND_SOC_DAPM_INPUT("INR"), | 86 | SND_SOC_DAPM_INPUT("INR"), |
87 | }; | 87 | }; |
88 | 88 | ||
89 | static const struct snd_soc_dapm_route intercon[] = { | 89 | static const struct snd_soc_dapm_route max9850_dapm_routes[] = { |
90 | /* output mixer */ | 90 | /* output mixer */ |
91 | {"Output Mixer", NULL, "DAC"}, | 91 | {"Output Mixer", NULL, "DAC"}, |
92 | {"Output Mixer", "Line In Switch", "Line Input"}, | 92 | {"Output Mixer", "Line In Switch", "Line Input"}, |
@@ -293,7 +293,6 @@ static int max9850_resume(struct snd_soc_codec *codec) | |||
293 | 293 | ||
294 | static int max9850_probe(struct snd_soc_codec *codec) | 294 | static int max9850_probe(struct snd_soc_codec *codec) |
295 | { | 295 | { |
296 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
297 | int ret; | 296 | int ret; |
298 | 297 | ||
299 | ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_I2C); | 298 | ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_I2C); |
@@ -309,13 +308,6 @@ static int max9850_probe(struct snd_soc_codec *codec) | |||
309 | /* set slew-rate 125ms */ | 308 | /* set slew-rate 125ms */ |
310 | snd_soc_update_bits(codec, MAX9850_CHARGE_PUMP, 0xff, 0xc0); | 309 | snd_soc_update_bits(codec, MAX9850_CHARGE_PUMP, 0xff, 0xc0); |
311 | 310 | ||
312 | snd_soc_dapm_new_controls(dapm, max9850_dapm_widgets, | ||
313 | ARRAY_SIZE(max9850_dapm_widgets)); | ||
314 | snd_soc_dapm_add_routes(dapm, intercon, ARRAY_SIZE(intercon)); | ||
315 | |||
316 | snd_soc_add_controls(codec, max9850_controls, | ||
317 | ARRAY_SIZE(max9850_controls)); | ||
318 | |||
319 | return 0; | 311 | return 0; |
320 | } | 312 | } |
321 | 313 | ||
@@ -328,6 +320,13 @@ static struct snd_soc_codec_driver soc_codec_dev_max9850 = { | |||
328 | .reg_word_size = sizeof(u8), | 320 | .reg_word_size = sizeof(u8), |
329 | .reg_cache_default = max9850_reg, | 321 | .reg_cache_default = max9850_reg, |
330 | .volatile_register = max9850_volatile_register, | 322 | .volatile_register = max9850_volatile_register, |
323 | |||
324 | .controls = max9850_controls, | ||
325 | .num_controls = ARRAY_SIZE(max9850_controls), | ||
326 | .dapm_widgets = max9850_dapm_widgets, | ||
327 | .num_dapm_widgets = ARRAY_SIZE(max9850_dapm_widgets), | ||
328 | .dapm_routes = max9850_dapm_routes, | ||
329 | .num_dapm_routes = ARRAY_SIZE(max9850_dapm_routes), | ||
331 | }; | 330 | }; |
332 | 331 | ||
333 | static int __devinit max9850_i2c_probe(struct i2c_client *i2c, | 332 | static int __devinit max9850_i2c_probe(struct i2c_client *i2c, |