diff options
author | Lu Guanqun <guanqun.lu@intel.com> | 2011-03-30 09:53:17 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-03-30 17:22:29 -0400 |
commit | e27808df97ff7b43b4927aadf410705f33313523 (patch) | |
tree | fd81d9ee211927dd5e2888a0064e6227e6418655 /sound/soc/codecs/sn95031.c | |
parent | b63c963da21d05f40f20de0a586143922bfa19d9 (diff) |
ASoC: Use data based init for sn95031 DAPM
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/sn95031.c')
-rw-r--r-- | sound/soc/codecs/sn95031.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/sound/soc/codecs/sn95031.c b/sound/soc/codecs/sn95031.c index 2a30eae1881c..569555f4a92f 100644 --- a/sound/soc/codecs/sn95031.c +++ b/sound/soc/codecs/sn95031.c | |||
@@ -825,8 +825,6 @@ EXPORT_SYMBOL_GPL(sn95031_jack_detection); | |||
825 | /* codec registration */ | 825 | /* codec registration */ |
826 | static int sn95031_codec_probe(struct snd_soc_codec *codec) | 826 | static int sn95031_codec_probe(struct snd_soc_codec *codec) |
827 | { | 827 | { |
828 | int ret; | ||
829 | |||
830 | pr_debug("codec_probe called\n"); | 828 | pr_debug("codec_probe called\n"); |
831 | 829 | ||
832 | codec->dapm.bias_level = SND_SOC_BIAS_OFF; | 830 | codec->dapm.bias_level = SND_SOC_BIAS_OFF; |
@@ -877,16 +875,7 @@ static int sn95031_codec_probe(struct snd_soc_codec *codec) | |||
877 | snd_soc_add_controls(codec, sn95031_snd_controls, | 875 | snd_soc_add_controls(codec, sn95031_snd_controls, |
878 | ARRAY_SIZE(sn95031_snd_controls)); | 876 | ARRAY_SIZE(sn95031_snd_controls)); |
879 | 877 | ||
880 | ret = snd_soc_dapm_new_controls(&codec->dapm, sn95031_dapm_widgets, | 878 | return 0; |
881 | ARRAY_SIZE(sn95031_dapm_widgets)); | ||
882 | if (ret) | ||
883 | pr_err("soc_dapm_new_control failed %d", ret); | ||
884 | ret = snd_soc_dapm_add_routes(&codec->dapm, sn95031_audio_map, | ||
885 | ARRAY_SIZE(sn95031_audio_map)); | ||
886 | if (ret) | ||
887 | pr_err("soc_dapm_add_routes failed %d", ret); | ||
888 | |||
889 | return ret; | ||
890 | } | 879 | } |
891 | 880 | ||
892 | static int sn95031_codec_remove(struct snd_soc_codec *codec) | 881 | static int sn95031_codec_remove(struct snd_soc_codec *codec) |
@@ -903,6 +892,10 @@ struct snd_soc_codec_driver sn95031_codec = { | |||
903 | .read = sn95031_read, | 892 | .read = sn95031_read, |
904 | .write = sn95031_write, | 893 | .write = sn95031_write, |
905 | .set_bias_level = sn95031_set_vaud_bias, | 894 | .set_bias_level = sn95031_set_vaud_bias, |
895 | .dapm_widgets = sn95031_dapm_widgets, | ||
896 | .num_dapm_widgets = ARRAY_SIZE(sn95031_dapm_widgets), | ||
897 | .dapm_routes = sn95031_audio_map, | ||
898 | .num_dapm_routes = ARRAY_SIZE(sn95031_audio_map), | ||
906 | }; | 899 | }; |
907 | 900 | ||
908 | static int __devinit sn95031_device_probe(struct platform_device *pdev) | 901 | static int __devinit sn95031_device_probe(struct platform_device *pdev) |