Skip to contentSkip to conversation

ASoC: Intel: initial stream_hw_id to invalid value

PATCH Applied Jie Yang 2 participants 2 messages Jan 12, 2015 – Jan 14, 2015

Subsystems (3)
lore
Share & tools
lore

Jie Yang

author
#0 lore raw

PATCH 1/1 ASoC: Intel: initial stream_hw_id to invalid value

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.

---
 sound/soc/intel/sst-haswell-ipc.c | 3 +++
 1 file changed, 3 insertions(+)
sound/soc/intel/sst-haswell-ipc.c +3 -0
index 5bf1404..eeef9a5 100644
@@ -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;
Signature · 1 line
1.9.1
maintainer Applied
#1 lore raw
Quoted 4 lines · Jie Yang

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.

Applied, thanks.