diff options
author | Charles Keepax <ckeepax@opensource.wolfsonmicro.com> | 2015-04-13 13:27:58 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-04-27 15:38:24 +0100 |
commit | c9f8dd712e1b7a12978844d25edb0508dd3610cf (patch) | |
tree | 55d5f5b4bf76a7786b8c0c51034e8ece2a7f2725 /sound/soc/codecs/wm_adsp.c | |
parent | 512f2bbaf63f2623ff43c528f0b4281cde3691ed (diff) | |
download | linux-stable-c9f8dd712e1b7a12978844d25edb0508dd3610cf.tar.gz linux-stable-c9f8dd712e1b7a12978844d25edb0508dd3610cf.tar.bz2 linux-stable-c9f8dd712e1b7a12978844d25edb0508dd3610cf.zip |
ASoC: wm_adsp: Clean up low level control read/write functions
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>
Diffstat (limited to 'sound/soc/codecs/wm_adsp.c')
-rw-r--r-- | sound/soc/codecs/wm_adsp.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c index 6c4f013be8b5..37e01b0b93f6 100644 --- a/sound/soc/codecs/wm_adsp.c +++ b/sound/soc/codecs/wm_adsp.c @@ -372,10 +372,9 @@ static int wm_coeff_info(struct snd_kcontrol *kcontrol, return 0; } -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) { - 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; @@ -424,13 +423,12 @@ static int wm_coeff_put(struct snd_kcontrol *kcontrol, 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, 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; @@ -739,7 +737,7 @@ static int wm_coeff_init_control_caches(struct wm_adsp *dsp) 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) @@ -758,7 +756,7 @@ static int wm_coeff_sync_controls(struct wm_adsp *dsp) 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) |