diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-02-17 14:33:29 -0800 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-02-21 19:34:47 +0000 |
commit | 2b4bdee2920fb3894f9116f76343f8b31f9e4da8 (patch) | |
tree | a7048ea6b7c4e5074d887ab5032e8e529e2ccdf7 /sound/soc/soc-io.c | |
parent | 82150451816ac6d735d8f90babe102636121d67e (diff) | |
download | op-kernel-dev-2b4bdee2920fb3894f9116f76343f8b31f9e4da8.zip op-kernel-dev-2b4bdee2920fb3894f9116f76343f8b31f9e4da8.tar.gz |
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 39ba507..4d8dc6a 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, enum snd_soc_control_type control) { struct regmap_config config; + int ret; memset(&config, 0, sizeof(config)); codec->write = hw_write; @@ -141,6 +142,11 @@ 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; break; default: |