host: refine stream position update for FW version before 3.11

FW sends stream position message to kernel for its version before
3.11. In kernel, no_stream_position will be set to 1 for FW version
after 3.10, and host_period_bytes will be set to 0 for other versions.
So in host_update_position, the condition is always true for hd->report_pos
>= dev->params.host_period_bytes for FW version before 3.11

Now check the condition dev->params.host_period_bytes != 0 according to
commit:b39b17ddf3e

Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
This commit is contained in:
Rander Wang 2019-10-08 15:10:01 +08:00 committed by Tomasz Lauda
parent 89ef0af076
commit 742ee80785
1 changed files with 6 additions and 2 deletions

View File

@ -165,8 +165,12 @@ static void host_update_position(struct comp_dev *dev, uint32_t bytes)
if (!dev->params.no_stream_position) {
hd->report_pos += bytes;
/* send IPC message to driver if needed */
if (hd->report_pos >= dev->params.host_period_bytes) {
/* host_period_bytes is set to zero to disable position update
* by IPC for FW version before 3.11, so send IPC message to
* driver according to this condition and report_pos.
*/
if (dev->params.host_period_bytes != 0 &&
hd->report_pos >= dev->params.host_period_bytes) {
hd->report_pos = 0;
/* send timestamped position to host