aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXiubo Li <Li.Xiubo@freescale.com>2014-02-27 04:49:52 -0500
committerMark Brown <broonie@linaro.org>2014-02-27 22:52:14 -0500
commitfe2265e4833a3ebea426d748b5ecf8d3ff31edc8 (patch)
treedd96960659caef35632def5a4df7681e98a8eb6f
parent9aa8210d40c2140daf655c5299557bd68362399a (diff)
ASoC: core: Set the default I/O up try regmap.
For most CODEC drivers which the REGMAP is used, the soc_probe_codec() will do the stuff work of snd_soc_codec_set_cache_io(), which the CODEC drivers' ASoC probe will do too, and almost at the same time. This patch set the default I/O up try regmap, and then the CODEC drivers' stuff work of snd_soc_codec_set_cache_io() will be redundant, while if one CODEC driver needed to set it's own I/O, then it can rewrite the default ones. Then could we just discard the snd_soc_codec_set_cache_io() from the CODEC drivers' ASoC probe to simplify the code. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--sound/soc/soc-core.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index fe1df50805a3..93854f031523 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1137,6 +1137,10 @@ static int soc_probe_codec(struct snd_soc_card *card,
1137 1137
1138 codec->dapm.idle_bias_off = driver->idle_bias_off; 1138 codec->dapm.idle_bias_off = driver->idle_bias_off;
1139 1139
1140 /* Set the default I/O up try regmap */
1141 if (dev_get_regmap(codec->dev, NULL))
1142 snd_soc_codec_set_cache_io(codec, 0, 0, SND_SOC_REGMAP);
1143
1140 if (driver->probe) { 1144 if (driver->probe) {
1141 ret = driver->probe(codec); 1145 ret = driver->probe(codec);
1142 if (ret < 0) { 1146 if (ret < 0) {
@@ -1150,10 +1154,6 @@ static int soc_probe_codec(struct snd_soc_card *card,
1150 codec->name); 1154 codec->name);
1151 } 1155 }
1152 1156
1153 /* If the driver didn't set I/O up try regmap */
1154 if (!codec->write && dev_get_regmap(codec->dev, NULL))
1155 snd_soc_codec_set_cache_io(codec, 0, 0, SND_SOC_REGMAP);
1156
1157 if (driver->controls) 1157 if (driver->controls)
1158 snd_soc_add_codec_controls(codec, driver->controls, 1158 snd_soc_add_codec_controls(codec, driver->controls,
1159 driver->num_controls); 1159 driver->num_controls);