aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/88pm860x-codec.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2011-12-19 21:14:25 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-12-20 07:04:33 -0500
commitf4f8e4c32c5064b292303b270999a87fe11f4ba4 (patch)
treeb27bc10d9c15a7f8c52d0288026eb4275d6397a1 /sound/soc/codecs/88pm860x-codec.c
parent52ec35f64ecdd7ef759ce594061be780ca4b324b (diff)
ASoC: Convert 88pm860x-codec 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/88pm860x-codec.c')
-rw-r--r--sound/soc/codecs/88pm860x-codec.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sound/soc/codecs/88pm860x-codec.c b/sound/soc/codecs/88pm860x-codec.c
index 2d39123dd21a..99ca53c01676 100644
--- a/sound/soc/codecs/88pm860x-codec.c
+++ b/sound/soc/codecs/88pm860x-codec.c
@@ -861,7 +861,7 @@ static const struct snd_soc_dapm_widget pm860x_dapm_widgets[] = {
861 PM860X_DAPM_OUTPUT("RSYNC", pm860x_rsync_event), 861 PM860X_DAPM_OUTPUT("RSYNC", pm860x_rsync_event),
862}; 862};
863 863
864static const struct snd_soc_dapm_route audio_map[] = { 864static const struct snd_soc_dapm_route pm860x_dapm_routes[] = {
865 /* supply */ 865 /* supply */
866 {"Left DAC", NULL, "VCODEC"}, 866 {"Left DAC", NULL, "VCODEC"},
867 {"Right DAC", NULL, "VCODEC"}, 867 {"Right DAC", NULL, "VCODEC"},
@@ -1361,7 +1361,6 @@ EXPORT_SYMBOL_GPL(pm860x_mic_jack_detect);
1361static int pm860x_probe(struct snd_soc_codec *codec) 1361static int pm860x_probe(struct snd_soc_codec *codec)
1362{ 1362{
1363 struct pm860x_priv *pm860x = snd_soc_codec_get_drvdata(codec); 1363 struct pm860x_priv *pm860x = snd_soc_codec_get_drvdata(codec);
1364 struct snd_soc_dapm_context *dapm = &codec->dapm;
1365 int i, ret; 1364 int i, ret;
1366 1365
1367 pm860x->codec = codec; 1366 pm860x->codec = codec;
@@ -1388,11 +1387,6 @@ static int pm860x_probe(struct snd_soc_codec *codec)
1388 goto out; 1387 goto out;
1389 } 1388 }
1390 1389
1391 snd_soc_add_controls(codec, pm860x_snd_controls,
1392 ARRAY_SIZE(pm860x_snd_controls));
1393 snd_soc_dapm_new_controls(dapm, pm860x_dapm_widgets,
1394 ARRAY_SIZE(pm860x_dapm_widgets));
1395 snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
1396 return 0; 1390 return 0;
1397 1391
1398out: 1392out:
@@ -1420,6 +1414,13 @@ static struct snd_soc_codec_driver soc_codec_dev_pm860x = {
1420 .reg_cache_size = REG_CACHE_SIZE, 1414 .reg_cache_size = REG_CACHE_SIZE,
1421 .reg_word_size = sizeof(u8), 1415 .reg_word_size = sizeof(u8),
1422 .set_bias_level = pm860x_set_bias_level, 1416 .set_bias_level = pm860x_set_bias_level,
1417
1418 .controls = pm860x_snd_controls,
1419 .num_controls = ARRAY_SIZE(pm860x_snd_controls),
1420 .dapm_widgets = pm860x_dapm_widgets,
1421 .num_dapm_widgets = ARRAY_SIZE(pm860x_dapm_widgets),
1422 .dapm_routes = pm860x_dapm_routes,
1423 .num_dapm_routes = ARRAY_SIZE(pm860x_dapm_routes),
1423}; 1424};
1424 1425
1425static int __devinit pm860x_codec_probe(struct platform_device *pdev) 1426static int __devinit pm860x_codec_probe(struct platform_device *pdev)