diff options
author | Fabio Estevam <fabio.estevam@freescale.com> | 2012-01-22 11:49:42 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-01-22 16:55:03 -0500 |
commit | 899896379670f885072564669e395feb649105a6 (patch) | |
tree | c68edd9e0aa877b2237abfe39f7d8aaf7aa09f0e /sound/soc/codecs/sgtl5000.c | |
parent | 82fa3670575143031517531936b1cc308d4981fa (diff) |
ASoC: sgtl5000: Convert to table based DAPM and control init
Convert to table based DAPM and control init.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/sgtl5000.c')
-rw-r--r-- | sound/soc/codecs/sgtl5000.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index 04ea4850cd43..18e61a0be260 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c | |||
@@ -227,7 +227,7 @@ static const struct snd_soc_dapm_widget sgtl5000_dapm_widgets[] = { | |||
227 | }; | 227 | }; |
228 | 228 | ||
229 | /* routes for sgtl5000 */ | 229 | /* routes for sgtl5000 */ |
230 | static const struct snd_soc_dapm_route audio_map[] = { | 230 | static const struct snd_soc_dapm_route sgtl5000_dapm_routes[] = { |
231 | {"Capture Mux", "LINE_IN", "LINE_IN"}, /* line_in --> adc_mux */ | 231 | {"Capture Mux", "LINE_IN", "LINE_IN"}, /* line_in --> adc_mux */ |
232 | {"Capture Mux", "MIC_IN", "MIC_IN"}, /* mic_in --> adc_mux */ | 232 | {"Capture Mux", "MIC_IN", "MIC_IN"}, /* mic_in --> adc_mux */ |
233 | 233 | ||
@@ -1353,15 +1353,6 @@ static int sgtl5000_probe(struct snd_soc_codec *codec) | |||
1353 | if (ret) | 1353 | if (ret) |
1354 | goto err; | 1354 | goto err; |
1355 | 1355 | ||
1356 | snd_soc_add_controls(codec, sgtl5000_snd_controls, | ||
1357 | ARRAY_SIZE(sgtl5000_snd_controls)); | ||
1358 | |||
1359 | snd_soc_dapm_new_controls(&codec->dapm, sgtl5000_dapm_widgets, | ||
1360 | ARRAY_SIZE(sgtl5000_dapm_widgets)); | ||
1361 | |||
1362 | snd_soc_dapm_add_routes(&codec->dapm, audio_map, | ||
1363 | ARRAY_SIZE(audio_map)); | ||
1364 | |||
1365 | snd_soc_dapm_new_widgets(&codec->dapm); | 1356 | snd_soc_dapm_new_widgets(&codec->dapm); |
1366 | 1357 | ||
1367 | return 0; | 1358 | return 0; |
@@ -1402,6 +1393,12 @@ static struct snd_soc_codec_driver sgtl5000_driver = { | |||
1402 | .reg_cache_step = 2, | 1393 | .reg_cache_step = 2, |
1403 | .reg_cache_default = sgtl5000_regs, | 1394 | .reg_cache_default = sgtl5000_regs, |
1404 | .volatile_register = sgtl5000_volatile_register, | 1395 | .volatile_register = sgtl5000_volatile_register, |
1396 | .controls = sgtl5000_snd_controls, | ||
1397 | .num_controls = ARRAY_SIZE(sgtl5000_snd_controls), | ||
1398 | .dapm_widgets = sgtl500_dapm_widgets, | ||
1399 | .num_dapm_widgets = ARRAY_SIZE(sgtl500_dapm_widgets), | ||
1400 | .dapm_routes = sgtl500_dapm_routes, | ||
1401 | .num_dapm_routes = ARRAY_SIZE(sgtl500_dapm_routes), | ||
1405 | }; | 1402 | }; |
1406 | 1403 | ||
1407 | static __devinit int sgtl5000_i2c_probe(struct i2c_client *client, | 1404 | static __devinit int sgtl5000_i2c_probe(struct i2c_client *client, |