summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-io.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/soc-io.c')
-rw-r--r--sound/soc/soc-io.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/sound/soc/soc-io.c b/sound/soc/soc-io.c
index 4d8dc6a27d4d..29183ef2b93d 100644
--- a/sound/soc/soc-io.c
+++ b/sound/soc/soc-io.c
@@ -142,11 +142,16 @@ int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec,
case SND_SOC_REGMAP:
/* Device has made its own regmap arrangements */
codec->using_regmap = true;
-
- ret = regmap_get_val_bytes(codec->control_data);
- /* Errors are legitimate for non-integer byte multiples */
- if (ret > 0)
- codec->val_bytes = ret;
+ if (!codec->control_data)
+ codec->control_data = dev_get_regmap(codec->dev, NULL);
+
+ if (codec->control_data) {
+ ret = regmap_get_val_bytes(codec->control_data);
+ /* Errors are legitimate for non-integer byte
+ * multiples */
+ if (ret > 0)
+ codec->val_bytes = ret;
+ }
break;
default: