Commit 38a72a9f authored by Mark Brown's avatar Mark Brown

Merge remote-tracking branches 'asoc/topic/wm9090', 'asoc/topic/wm9712',...

Merge remote-tracking branches 'asoc/topic/wm9090', 'asoc/topic/wm9712', 'asoc/topic/wm9713' and 'asoc/topic/wm_adsp' into asoc-next
This diff is collapsed.
...@@ -226,7 +226,7 @@ static int wm9712_hp_mixer_put(struct snd_kcontrol *kcontrol, ...@@ -226,7 +226,7 @@ static int wm9712_hp_mixer_put(struct snd_kcontrol *kcontrol,
struct soc_mixer_control *mc = struct soc_mixer_control *mc =
(struct soc_mixer_control *)kcontrol->private_value; (struct soc_mixer_control *)kcontrol->private_value;
unsigned int mixer, mask, shift, old; unsigned int mixer, mask, shift, old;
struct snd_soc_dapm_update update = { 0 }; struct snd_soc_dapm_update update = {};
bool change; bool change;
mixer = mc->shift >> 8; mixer = mc->shift >> 8;
......
...@@ -235,7 +235,7 @@ static int wm9713_hp_mixer_put(struct snd_kcontrol *kcontrol, ...@@ -235,7 +235,7 @@ static int wm9713_hp_mixer_put(struct snd_kcontrol *kcontrol,
struct soc_mixer_control *mc = struct soc_mixer_control *mc =
(struct soc_mixer_control *)kcontrol->private_value; (struct soc_mixer_control *)kcontrol->private_value;
unsigned int mixer, mask, shift, old; unsigned int mixer, mask, shift, old;
struct snd_soc_dapm_update update = { 0 }; struct snd_soc_dapm_update update = {};
bool change; bool change;
mixer = mc->shift >> 8; mixer = mc->shift >> 8;
......
...@@ -1239,9 +1239,16 @@ static int wm_coeff_init_control_caches(struct wm_adsp *dsp) ...@@ -1239,9 +1239,16 @@ static int wm_coeff_init_control_caches(struct wm_adsp *dsp)
if (ctl->flags & WMFW_CTL_FLAG_VOLATILE) if (ctl->flags & WMFW_CTL_FLAG_VOLATILE)
continue; continue;
ret = wm_coeff_read_control(ctl, ctl->cache, ctl->len); /*
if (ret < 0) * For readable controls populate the cache from the DSP memory.
return ret; * For non-readable controls the cache was zero-filled when
* created so we don't need to do anything.
*/
if (!ctl->flags || (ctl->flags & WMFW_CTL_FLAG_READABLE)) {
ret = wm_coeff_read_control(ctl, ctl->cache, ctl->len);
if (ret < 0)
return ret;
}
} }
return 0; return 0;
...@@ -3253,6 +3260,13 @@ static int wm_adsp_buffer_populate(struct wm_adsp_compr_buf *buf) ...@@ -3253,6 +3260,13 @@ static int wm_adsp_buffer_populate(struct wm_adsp_compr_buf *buf)
return 0; return 0;
} }
static void wm_adsp_buffer_clear(struct wm_adsp_compr_buf *buf)
{
buf->irq_count = 0xFFFFFFFF;
buf->read_index = -1;
buf->avail = 0;
}
static int wm_adsp_buffer_init(struct wm_adsp *dsp) static int wm_adsp_buffer_init(struct wm_adsp *dsp)
{ {
struct wm_adsp_compr_buf *buf; struct wm_adsp_compr_buf *buf;
...@@ -3263,8 +3277,8 @@ static int wm_adsp_buffer_init(struct wm_adsp *dsp) ...@@ -3263,8 +3277,8 @@ static int wm_adsp_buffer_init(struct wm_adsp *dsp)
return -ENOMEM; return -ENOMEM;
buf->dsp = dsp; buf->dsp = dsp;
buf->read_index = -1;
buf->irq_count = 0xFFFFFFFF; wm_adsp_buffer_clear(buf);
ret = wm_adsp_buffer_locate(buf); ret = wm_adsp_buffer_locate(buf);
if (ret < 0) { if (ret < 0) {
...@@ -3322,16 +3336,17 @@ int wm_adsp_compr_trigger(struct snd_compr_stream *stream, int cmd) ...@@ -3322,16 +3336,17 @@ int wm_adsp_compr_trigger(struct snd_compr_stream *stream, int cmd)
switch (cmd) { switch (cmd) {
case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_START:
if (wm_adsp_compr_attached(compr)) if (!wm_adsp_compr_attached(compr)) {
break; ret = wm_adsp_compr_attach(compr);
if (ret < 0) {
ret = wm_adsp_compr_attach(compr); adsp_err(dsp, "Failed to link buffer and stream: %d\n",
if (ret < 0) { ret);
adsp_err(dsp, "Failed to link buffer and stream: %d\n", break;
ret); }
break;
} }
wm_adsp_buffer_clear(compr->buf);
/* Trigger the IRQ at one fragment of data */ /* Trigger the IRQ at one fragment of data */
ret = wm_adsp_buffer_write(compr->buf, ret = wm_adsp_buffer_write(compr->buf,
HOST_BUFFER_FIELD(high_water_mark), HOST_BUFFER_FIELD(high_water_mark),
......
...@@ -64,10 +64,10 @@ struct wm_adsp { ...@@ -64,10 +64,10 @@ struct wm_adsp {
struct regmap *regmap; struct regmap *regmap;
struct snd_soc_component *component; struct snd_soc_component *component;
int base; unsigned int base;
int sysclk_reg; unsigned int sysclk_reg;
int sysclk_mask; unsigned int sysclk_mask;
int sysclk_shift; unsigned int sysclk_shift;
struct list_head alg_regions; struct list_head alg_regions;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment