diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-02-17 17:33:29 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-02-21 14:34:47 -0500 |
commit | 2b4bdee2920fb3894f9116f76343f8b31f9e4da8 (patch) | |
tree | a7048ea6b7c4e5074d887ab5032e8e529e2ccdf7 /sound/soc/soc-io.c | |
parent | 82150451816ac6d735d8f90babe102636121d67e (diff) |
ASoC: io: Retrieve val_bytes from the regmap API
Allow us to build infrastructure which needs to know the size of a value
without requiring regmap based drivers to supply this information to both
ASoC and regmap by asking regmap for the value.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Diffstat (limited to 'sound/soc/soc-io.c')
-rw-r--r-- | sound/soc/soc-io.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/soc/soc-io.c b/sound/soc/soc-io.c index 39ba5070ff92..4d8dc6a27d4d 100644 --- a/sound/soc/soc-io.c +++ b/sound/soc/soc-io.c | |||
@@ -114,6 +114,7 @@ int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, | |||
114 | enum snd_soc_control_type control) | 114 | enum snd_soc_control_type control) |
115 | { | 115 | { |
116 | struct regmap_config config; | 116 | struct regmap_config config; |
117 | int ret; | ||
117 | 118 | ||
118 | memset(&config, 0, sizeof(config)); | 119 | memset(&config, 0, sizeof(config)); |
119 | codec->write = hw_write; | 120 | codec->write = hw_write; |
@@ -141,6 +142,11 @@ int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, | |||
141 | case SND_SOC_REGMAP: | 142 | case SND_SOC_REGMAP: |
142 | /* Device has made its own regmap arrangements */ | 143 | /* Device has made its own regmap arrangements */ |
143 | codec->using_regmap = true; | 144 | codec->using_regmap = true; |
145 | |||
146 | ret = regmap_get_val_bytes(codec->control_data); | ||
147 | /* Errors are legitimate for non-integer byte multiples */ | ||
148 | if (ret > 0) | ||
149 | codec->val_bytes = ret; | ||
144 | break; | 150 | break; |
145 | 151 | ||
146 | default: | 152 | default: |