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>
enum snd_soc_control_type control)
{
struct regmap_config config;
+ int ret;
memset(&config, 0, sizeof(config));
codec->write = hw_write;
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: