diff options
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r-- | sound/soc/soc-core.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 359c2849b364..b322cf294d06 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -1137,6 +1137,16 @@ 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 | if (!codec->write && dev_get_regmap(codec->dev, NULL)) { | ||
1141 | /* Set the default I/O up try regmap */ | ||
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 | } | ||
1149 | |||
1140 | if (driver->probe) { | 1150 | if (driver->probe) { |
1141 | ret = driver->probe(codec); | 1151 | ret = driver->probe(codec); |
1142 | if (ret < 0) { | 1152 | if (ret < 0) { |
@@ -1150,10 +1160,6 @@ static int soc_probe_codec(struct snd_soc_card *card, | |||
1150 | codec->name); | 1160 | codec->name); |
1151 | } | 1161 | } |
1152 | 1162 | ||
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) | 1163 | if (driver->controls) |
1158 | snd_soc_add_codec_controls(codec, driver->controls, | 1164 | snd_soc_add_codec_controls(codec, driver->controls, |
1159 | driver->num_controls); | 1165 | driver->num_controls); |