aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLu Guanqun <guanqun.lu@intel.com>2011-03-30 09:53:10 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-03-30 17:21:47 -0400
commitdc6fc49b141ed14256e1319ccb9797e9825f1734 (patch)
tree5d6078a54b46e6ccfc0a8dd4ffcd0511a218888e
parent51fb1a8704f6bccfcf5248f9edc2751c272fbdf2 (diff)
ASoC: Use data based init for max98088 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>
-rw-r--r--sound/soc/codecs/max98088.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c
index bd0517cb7980..bb58bdb49853 100644
--- a/sound/soc/codecs/max98088.c
+++ b/sound/soc/codecs/max98088.c
@@ -1112,7 +1112,7 @@ static const struct snd_soc_dapm_widget max98088_dapm_widgets[] = {
1112 SND_SOC_DAPM_INPUT("INB2"), 1112 SND_SOC_DAPM_INPUT("INB2"),
1113}; 1113};
1114 1114
1115static const struct snd_soc_dapm_route audio_map[] = { 1115static const struct snd_soc_dapm_route max98088_audio_map[] = {
1116 /* Left headphone output mixer */ 1116 /* Left headphone output mixer */
1117 {"Left HP Mixer", "Left DAC1 Switch", "DACL1"}, 1117 {"Left HP Mixer", "Left DAC1 Switch", "DACL1"},
1118 {"Left HP Mixer", "Left DAC2 Switch", "DACL2"}, 1118 {"Left HP Mixer", "Left DAC2 Switch", "DACL2"},
@@ -1226,22 +1226,6 @@ static const struct snd_soc_dapm_route audio_map[] = {
1226 {"MIC2 Input", NULL, "MIC2"}, 1226 {"MIC2 Input", NULL, "MIC2"},
1227}; 1227};
1228 1228
1229static int max98088_add_widgets(struct snd_soc_codec *codec)
1230{
1231 struct snd_soc_dapm_context *dapm = &codec->dapm;
1232
1233 snd_soc_dapm_new_controls(dapm, max98088_dapm_widgets,
1234 ARRAY_SIZE(max98088_dapm_widgets));
1235
1236 snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
1237
1238 snd_soc_add_controls(codec, max98088_snd_controls,
1239 ARRAY_SIZE(max98088_snd_controls));
1240
1241 snd_soc_dapm_new_widgets(dapm);
1242 return 0;
1243}
1244
1245/* codec mclk clock divider coefficients */ 1229/* codec mclk clock divider coefficients */
1246static const struct { 1230static const struct {
1247 u32 rate; 1231 u32 rate;
@@ -2010,7 +1994,8 @@ static int max98088_probe(struct snd_soc_codec *codec)
2010 1994
2011 max98088_handle_pdata(codec); 1995 max98088_handle_pdata(codec);
2012 1996
2013 max98088_add_widgets(codec); 1997 snd_soc_add_controls(codec, max98088_snd_controls,
1998 ARRAY_SIZE(max98088_snd_controls));
2014 1999
2015err_access: 2000err_access:
2016 return ret; 2001 return ret;
@@ -2036,6 +2021,10 @@ static struct snd_soc_codec_driver soc_codec_dev_max98088 = {
2036 .reg_word_size = sizeof(u8), 2021 .reg_word_size = sizeof(u8),
2037 .reg_cache_default = max98088_reg, 2022 .reg_cache_default = max98088_reg,
2038 .volatile_register = max98088_volatile_register, 2023 .volatile_register = max98088_volatile_register,
2024 .dapm_widgets = max98088_dapm_widgets,
2025 .num_dapm_widgets = ARRAY_SIZE(max98088_dapm_widgets),
2026 .dapm_routes = max98088_audio_map,
2027 .num_dapm_routes = ARRAY_SIZE(max98088_audio_map),
2039}; 2028};
2040 2029
2041static int max98088_i2c_probe(struct i2c_client *i2c, 2030static int max98088_i2c_probe(struct i2c_client *i2c,