Loading sound/soc/msm/qdsp6v2/q6asm.c +9 −8 Original line number Diff line number Diff line Loading @@ -412,9 +412,10 @@ static void q6asm_session_free(struct audio_client *ac) return; } static uint32_t q6asm_get_next_buf(uint32_t curr_buf, uint32_t max_buf_cnt) static uint32_t q6asm_get_next_buf(struct audio_client *ac, uint32_t curr_buf, uint32_t max_buf_cnt) { pr_debug("%s: curr_buf = %d, max_buf_cnt = %d\n", dev_vdbg(ac->dev, "%s: curr_buf = %d, max_buf_cnt = %d\n", __func__, curr_buf, max_buf_cnt); curr_buf += 1; return (curr_buf >= max_buf_cnt) ? 0 : curr_buf; Loading Loading @@ -1797,7 +1798,7 @@ void *q6asm_is_cpu_buf_avail(int dir, struct audio_client *ac, uint32_t *size, user accesses this function,increase cpu buf(to avoid another api)*/ port->buf[idx].used = dir; port->cpu_buf = q6asm_get_next_buf(port->cpu_buf, port->cpu_buf = q6asm_get_next_buf(ac, port->cpu_buf, port->max_buf_cnt); mutex_unlock(&port->lock); return data; Loading Loading @@ -1849,7 +1850,7 @@ void *q6asm_is_cpu_buf_avail_nolock(int dir, struct audio_client *ac, * buf(to avoid another api) */ port->buf[idx].used = dir; port->cpu_buf = q6asm_get_next_buf(port->cpu_buf, port->cpu_buf = q6asm_get_next_buf(ac, port->cpu_buf, port->max_buf_cnt); return data; } Loading Loading @@ -4859,7 +4860,7 @@ static int __q6asm_read(struct audio_client *ac, bool is_custom_len_reqd, read.buf_size = is_custom_len_reqd ? len : ab->size; read.seq_id = port->dsp_buf; read.hdr.token = port->dsp_buf; port->dsp_buf = q6asm_get_next_buf(port->dsp_buf, port->dsp_buf = q6asm_get_next_buf(ac, port->dsp_buf, port->max_buf_cnt); mutex_unlock(&port->lock); dev_vdbg(ac->dev, "%s: buf add[%pa] token[%d] uid[%d]\n", Loading Loading @@ -4938,7 +4939,7 @@ int q6asm_read_nolock(struct audio_client *ac) } } port->dsp_buf = q6asm_get_next_buf(port->dsp_buf, port->dsp_buf = q6asm_get_next_buf(ac, port->dsp_buf, port->max_buf_cnt); dev_vdbg(ac->dev, "%s: buf add[%pa] token[%d] uid[%d]\n", __func__, &ab->phys, read.hdr.token, Loading Loading @@ -5144,7 +5145,7 @@ int q6asm_write(struct audio_client *ac, uint32_t len, uint32_t msw_ts, write.flags = (0x00000000 | (flags & 0x800000FF)); else write.flags = (0x80000000 | flags); port->dsp_buf = q6asm_get_next_buf(port->dsp_buf, port->dsp_buf = q6asm_get_next_buf(ac, port->dsp_buf, port->max_buf_cnt); buf_node = list_first_entry(&ac->port[IN].mem_map_handle, struct asm_buffer_node, Loading Loading @@ -5222,7 +5223,7 @@ int q6asm_write_nolock(struct audio_client *ac, uint32_t len, uint32_t msw_ts, write.flags = (0x00000000 | (flags & 0x800000FF)); else write.flags = (0x80000000 | flags); port->dsp_buf = q6asm_get_next_buf(port->dsp_buf, port->dsp_buf = q6asm_get_next_buf(ac, port->dsp_buf, port->max_buf_cnt); dev_vdbg(ac->dev, "%s: ab->phys[%pa]bufadd[0x%x]token[0x%x] buf_id[0x%x]buf_size[0x%x]mmaphdl[0x%x]" Loading Loading
sound/soc/msm/qdsp6v2/q6asm.c +9 −8 Original line number Diff line number Diff line Loading @@ -412,9 +412,10 @@ static void q6asm_session_free(struct audio_client *ac) return; } static uint32_t q6asm_get_next_buf(uint32_t curr_buf, uint32_t max_buf_cnt) static uint32_t q6asm_get_next_buf(struct audio_client *ac, uint32_t curr_buf, uint32_t max_buf_cnt) { pr_debug("%s: curr_buf = %d, max_buf_cnt = %d\n", dev_vdbg(ac->dev, "%s: curr_buf = %d, max_buf_cnt = %d\n", __func__, curr_buf, max_buf_cnt); curr_buf += 1; return (curr_buf >= max_buf_cnt) ? 0 : curr_buf; Loading Loading @@ -1797,7 +1798,7 @@ void *q6asm_is_cpu_buf_avail(int dir, struct audio_client *ac, uint32_t *size, user accesses this function,increase cpu buf(to avoid another api)*/ port->buf[idx].used = dir; port->cpu_buf = q6asm_get_next_buf(port->cpu_buf, port->cpu_buf = q6asm_get_next_buf(ac, port->cpu_buf, port->max_buf_cnt); mutex_unlock(&port->lock); return data; Loading Loading @@ -1849,7 +1850,7 @@ void *q6asm_is_cpu_buf_avail_nolock(int dir, struct audio_client *ac, * buf(to avoid another api) */ port->buf[idx].used = dir; port->cpu_buf = q6asm_get_next_buf(port->cpu_buf, port->cpu_buf = q6asm_get_next_buf(ac, port->cpu_buf, port->max_buf_cnt); return data; } Loading Loading @@ -4859,7 +4860,7 @@ static int __q6asm_read(struct audio_client *ac, bool is_custom_len_reqd, read.buf_size = is_custom_len_reqd ? len : ab->size; read.seq_id = port->dsp_buf; read.hdr.token = port->dsp_buf; port->dsp_buf = q6asm_get_next_buf(port->dsp_buf, port->dsp_buf = q6asm_get_next_buf(ac, port->dsp_buf, port->max_buf_cnt); mutex_unlock(&port->lock); dev_vdbg(ac->dev, "%s: buf add[%pa] token[%d] uid[%d]\n", Loading Loading @@ -4938,7 +4939,7 @@ int q6asm_read_nolock(struct audio_client *ac) } } port->dsp_buf = q6asm_get_next_buf(port->dsp_buf, port->dsp_buf = q6asm_get_next_buf(ac, port->dsp_buf, port->max_buf_cnt); dev_vdbg(ac->dev, "%s: buf add[%pa] token[%d] uid[%d]\n", __func__, &ab->phys, read.hdr.token, Loading Loading @@ -5144,7 +5145,7 @@ int q6asm_write(struct audio_client *ac, uint32_t len, uint32_t msw_ts, write.flags = (0x00000000 | (flags & 0x800000FF)); else write.flags = (0x80000000 | flags); port->dsp_buf = q6asm_get_next_buf(port->dsp_buf, port->dsp_buf = q6asm_get_next_buf(ac, port->dsp_buf, port->max_buf_cnt); buf_node = list_first_entry(&ac->port[IN].mem_map_handle, struct asm_buffer_node, Loading Loading @@ -5222,7 +5223,7 @@ int q6asm_write_nolock(struct audio_client *ac, uint32_t len, uint32_t msw_ts, write.flags = (0x00000000 | (flags & 0x800000FF)); else write.flags = (0x80000000 | flags); port->dsp_buf = q6asm_get_next_buf(port->dsp_buf, port->dsp_buf = q6asm_get_next_buf(ac, port->dsp_buf, port->max_buf_cnt); dev_vdbg(ac->dev, "%s: ab->phys[%pa]bufadd[0x%x]token[0x%x] buf_id[0x%x]buf_size[0x%x]mmaphdl[0x%x]" Loading