On Sat, Apr 18, 2015 at 06:23:06PM +0100, Mark Brown wrote:
On Mon, Apr 13, 2015 at 01:28:03PM +0100, Charles Keepax wrote:
The DSP control information contains various hints about the usage of the controls use these when handling the control.
@@ -418,6 +419,9 @@ static int wm_coeff_put(struct snd_kcontrol *kcontrol, struct wm_coeff_ctl *ctl = (struct wm_coeff_ctl *)kcontrol->private_value; char *p = ucontrol->value.bytes.data;
if (ctl->flags && !(ctl->flags & WMFW_CTL_FLAG_WRITEABLE))
return -EPERM;
memcpy(ctl->cache, p, ctl->len);
ctl->set = 1;
What would be even better for these would be to apply these at control creation time so that controls that lack read or write support just don't have the relevant operations in the first place. That would not be simpler and would allow the rest of the stack to do the right thing, for example setting SNDRV_CTL_ELEM_ACCESS_READ and _WRITE properly.
That is indeed much more sensible I will respin this patch.
Thanks, Charles