ASoC: wm_adsp: Mimic legacy behaviour of reading controls when DSP is on
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Thu, 17 Dec 2015 10:05:59 +0000 (10:05 +0000)
committerMark Brown <broonie@kernel.org>
Thu, 17 Dec 2015 12:13:08 +0000 (12:13 +0000)
Older firmwares don't specify access flags for the controls,
unfortunately the usage of some of these firmware relies on being able
to read back values from the DSP. The current control code will only do
this for volatile controls. This patch will read the control from the
hardware if no flags are specified and the control is currently
enabled, which should cover these legacy use-cases.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/wm_adsp.c

index b083642718f0f0fc476ecc11f3daf1ca28c82eae..d1e0826c7db234cc60b8bba5c81bb031ef462baa 100644 (file)
@@ -666,6 +666,9 @@ static int wm_coeff_get(struct snd_kcontrol *kctl,
                else
                        ret = -EPERM;
        } else {
+               if (!ctl->flags && ctl->enabled)
+                       ret = wm_coeff_read_control(ctl, ctl->cache, ctl->len);
+
                memcpy(p, ctl->cache, ctl->len);
        }