summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
512f2bb)
Physically reading and writing controls to/from the DSP are handled by
two low level functions (wm_coeff_{write|read}_control, these currently
take in a snd_kcontrol pointer but immediately pull out a wm_coeff_ctl
pointer from the private data. These functions don't handle the kcontrols
at all they just shuttle data to and from the chip and all the call
sites have a wm_coeff_ctl pointer available. This patch just passes the
wm_coeff_ctl pointer straight into these functions.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-static int wm_coeff_write_control(struct snd_kcontrol *kcontrol,
+static int wm_coeff_write_control(struct wm_coeff_ctl *ctl,
const void *buf, size_t len)
{
const void *buf, size_t len)
{
- struct wm_coeff_ctl *ctl = (struct wm_coeff_ctl *)kcontrol->private_value;
struct wm_adsp_alg_region *alg_region = &ctl->alg_region;
const struct wm_adsp_region *mem;
struct wm_adsp *dsp = ctl->dsp;
struct wm_adsp_alg_region *alg_region = &ctl->alg_region;
const struct wm_adsp_region *mem;
struct wm_adsp *dsp = ctl->dsp;
if (!ctl->enabled)
return 0;
if (!ctl->enabled)
return 0;
- return wm_coeff_write_control(kcontrol, p, ctl->len);
+ return wm_coeff_write_control(ctl, p, ctl->len);
-static int wm_coeff_read_control(struct snd_kcontrol *kcontrol,
+static int wm_coeff_read_control(struct wm_coeff_ctl *ctl,
- struct wm_coeff_ctl *ctl = (struct wm_coeff_ctl *)kcontrol->private_value;
struct wm_adsp_alg_region *alg_region = &ctl->alg_region;
const struct wm_adsp_region *mem;
struct wm_adsp *dsp = ctl->dsp;
struct wm_adsp_alg_region *alg_region = &ctl->alg_region;
const struct wm_adsp_region *mem;
struct wm_adsp *dsp = ctl->dsp;
list_for_each_entry(ctl, &dsp->ctl_list, list) {
if (!ctl->enabled || ctl->set)
continue;
list_for_each_entry(ctl, &dsp->ctl_list, list) {
if (!ctl->enabled || ctl->set)
continue;
- ret = wm_coeff_read_control(ctl->kcontrol,
+ ret = wm_coeff_read_control(ctl,
ctl->cache,
ctl->len);
if (ret < 0)
ctl->cache,
ctl->len);
if (ret < 0)
if (!ctl->enabled)
continue;
if (ctl->set) {
if (!ctl->enabled)
continue;
if (ctl->set) {
- ret = wm_coeff_write_control(ctl->kcontrol,
+ ret = wm_coeff_write_control(ctl,
ctl->cache,
ctl->len);
if (ret < 0)
ctl->cache,
ctl->len);
if (ret < 0)