aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorXiubo Li <Li.Xiubo@freescale.com>2014-03-11 00:43:22 -0400
committerMark Brown <broonie@linaro.org>2014-03-11 05:59:06 -0400
commita32c17b87c17f5e2e68edcf4d163ee42f9490652 (patch)
tree3f1d0b9e20208ce3d62d57444352b981b61682cb /sound
parent092eba937d948a76ff55825922eff4df010f6a17 (diff)
ASoC: core: Fix check before setting default I/O up try regmap
Since the CODEC driver could specify its own I/O(read and write) while registering the CODEC for some reason, maybe the MFDs is used, etc. So just do check it, if they are not specified by CODEC driver then try to set up the default regmap I/O if regmap is used. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/soc-core.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 6510a8e4a5af..cbddbd595213 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1137,9 +1137,15 @@ 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 */ 1140 if (!codec->write && dev_get_regmap(codec->dev, NULL)) {
1141 if (dev_get_regmap(codec->dev, NULL)) 1141 /* Set the default I/O up try regmap */
1142 snd_soc_codec_set_cache_io(codec, NULL); 1142 ret = snd_soc_codec_set_cache_io(codec, NULL);
1143 if (ret < 0) {
1144 dev_err(codec->dev,
1145 "Failed to set cache I/O: %d\n", ret);
1146 goto err_probe;
1147 }
1148 }
1143 1149
1144 if (driver->probe) { 1150 if (driver->probe) {
1145 ret = driver->probe(codec); 1151 ret = driver->probe(codec);