ASoC: Intel: initial stream_hw_id to invalid value
authorJie Yang <yang.jie@intel.com>
Mon, 12 Jan 2015 09:17:34 +0000 (17:17 +0800)
committerMark Brown <broonie@kernel.org>
Wed, 14 Jan 2015 20:22:35 +0000 (20:22 +0000)
The stream_hw_id for System stream is 0x0, if we use initial stream_hw_id
value 0, it may return wrong(not committed) stream when calling function
get_stream_by_id() with stream_id=0. Here initial stream_hw_id to invalid
value to fix this issue.

Signed-off-by: Jie Yang <yang.jie@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/sst-haswell-ipc.c

index 3f8c48231364c6c7b9510da4eb9d73c6e291cace..083292362da677ea1e9b5996fe1f0d957ac8f150 100644 (file)
@@ -94,6 +94,8 @@
 /* Mailbox */
 #define IPC_MAX_MAILBOX_BYTES  256
 
+#define INVALID_STREAM_HW_ID   0xffffffff
+
 /* Global Message - Types and Replies */
 enum ipc_glb_type {
        IPC_GLB_GET_FW_VERSION = 0,             /* Retrieves firmware version */
@@ -1208,6 +1210,7 @@ struct sst_hsw_stream *sst_hsw_stream_new(struct sst_hsw *hsw, int id,
                return NULL;
 
        spin_lock_irqsave(&sst->spinlock, flags);
+       stream->reply.stream_hw_id = INVALID_STREAM_HW_ID;
        list_add(&stream->node, &hsw->stream_list);
        stream->notify_position = notify_position;
        stream->pdata = data;