Lines Matching refs:stream

247 	u32 (*notify_position)(struct sst_hsw_stream *stream, void *data);
429 struct sst_hsw_stream *stream; in get_stream_by_id() local
431 list_for_each_entry(stream, &hsw->stream_list, node) { in get_stream_by_id()
432 if (stream->reply.stream_hw_id == stream_id) in get_stream_by_id()
433 return stream; in get_stream_by_id()
483 struct sst_hsw_stream *stream = container_of(work, in hsw_notification_work() local
485 struct sst_hsw_ipc_stream_glitch_position *glitch = &stream->glitch; in hsw_notification_work()
486 struct sst_hsw_ipc_stream_get_position *pos = &stream->rpos; in hsw_notification_work()
487 struct sst_hsw *hsw = stream->hsw; in hsw_notification_work()
490 reason = msg_get_notify_reason(stream->header); in hsw_notification_work()
495 stream->reply.stream_hw_id); in hsw_notification_work()
505 stream->reply.stream_hw_id); in hsw_notification_work()
508 if (stream->notify_position) in hsw_notification_work()
509 stream->notify_position(stream, stream->pdata); in hsw_notification_work()
514 stream->header); in hsw_notification_work()
528 struct sst_hsw_stream *stream; in hsw_stream_update() local
533 stream = get_stream_by_id(hsw, stream_id); in hsw_stream_update()
534 if (stream == NULL) in hsw_stream_update()
542 trace_ipc_notification("stream reset", stream->reply.stream_hw_id); in hsw_stream_update()
545 stream->running = false; in hsw_stream_update()
547 stream->reply.stream_hw_id); in hsw_stream_update()
550 stream->running = true; in hsw_stream_update()
552 stream->reply.stream_hw_id); in hsw_stream_update()
671 struct sst_hsw_stream *stream; in hsw_stream_message() local
678 stream = get_stream_by_id(hsw, stream_id); in hsw_stream_message()
679 if (stream == NULL) in hsw_stream_message()
682 stream->header = header; in hsw_stream_message()
690 schedule_work(&stream->notify_work); in hsw_stream_message()
704 struct sst_hsw_log_stream *stream = &hsw->log_stream; in hsw_log_message() local
713 mutex_lock(&stream->rw_mutex); in hsw_log_message()
714 stream->last_pos = stream->curr_pos; in hsw_log_message()
716 hsw->dsp, &stream->curr_pos, sizeof(stream->curr_pos)); in hsw_log_message()
717 mutex_unlock(&stream->rw_mutex); in hsw_log_message()
719 schedule_work(&stream->notify_work); in hsw_log_message()
846 int sst_hsw_stream_get_volume(struct sst_hsw *hsw, struct sst_hsw_stream *stream, in sst_hsw_stream_get_volume() argument
853 stream->reply.volume_register_address[channel], in sst_hsw_stream_get_volume()
861 struct sst_hsw_stream *stream, u32 stage_id, u32 channel, u32 volume) in sst_hsw_stream_set_volume() argument
867 trace_ipc_request("set stream volume", stream->reply.stream_hw_id); in sst_hsw_stream_set_volume()
874 header |= (stream->reply.stream_hw_id << IPC_STR_ID_SHIFT); in sst_hsw_stream_set_volume()
878 req = &stream->vol_req; in sst_hsw_stream_set_volume()
979 u32 (*notify_position)(struct sst_hsw_stream *stream, void *data), in sst_hsw_stream_new() argument
982 struct sst_hsw_stream *stream; in sst_hsw_stream_new() local
986 stream = kzalloc(sizeof(*stream), GFP_KERNEL); in sst_hsw_stream_new()
987 if (stream == NULL) in sst_hsw_stream_new()
991 stream->reply.stream_hw_id = INVALID_STREAM_HW_ID; in sst_hsw_stream_new()
992 list_add(&stream->node, &hsw->stream_list); in sst_hsw_stream_new()
993 stream->notify_position = notify_position; in sst_hsw_stream_new()
994 stream->pdata = data; in sst_hsw_stream_new()
995 stream->hsw = hsw; in sst_hsw_stream_new()
996 stream->host_id = id; in sst_hsw_stream_new()
999 INIT_WORK(&stream->notify_work, hsw_notification_work); in sst_hsw_stream_new()
1002 return stream; in sst_hsw_stream_new()
1005 int sst_hsw_stream_free(struct sst_hsw *hsw, struct sst_hsw_stream *stream) in sst_hsw_stream_free() argument
1012 if (!stream) { in sst_hsw_stream_free()
1018 if (!stream->commited) in sst_hsw_stream_free()
1021 trace_ipc_request("stream free", stream->host_id); in sst_hsw_stream_free()
1023 stream->free_req.stream_id = stream->reply.stream_hw_id; in sst_hsw_stream_free()
1026 ret = sst_ipc_tx_message_wait(&hsw->ipc, header, &stream->free_req, in sst_hsw_stream_free()
1027 sizeof(stream->free_req), NULL, 0); in sst_hsw_stream_free()
1030 stream->free_req.stream_id); in sst_hsw_stream_free()
1034 trace_hsw_stream_free_req(stream, &stream->free_req); in sst_hsw_stream_free()
1037 cancel_work_sync(&stream->notify_work); in sst_hsw_stream_free()
1039 list_del(&stream->node); in sst_hsw_stream_free()
1040 kfree(stream); in sst_hsw_stream_free()
1047 struct sst_hsw_stream *stream, enum sst_hsw_bitdepth bits) in sst_hsw_stream_set_bits() argument
1049 if (stream->commited) { in sst_hsw_stream_set_bits()
1054 stream->request.format.bitdepth = bits; in sst_hsw_stream_set_bits()
1059 struct sst_hsw_stream *stream, int channels) in sst_hsw_stream_set_channels() argument
1061 if (stream->commited) { in sst_hsw_stream_set_channels()
1066 stream->request.format.ch_num = channels; in sst_hsw_stream_set_channels()
1071 struct sst_hsw_stream *stream, int rate) in sst_hsw_stream_set_rate() argument
1073 if (stream->commited) { in sst_hsw_stream_set_rate()
1078 stream->request.format.frequency = rate; in sst_hsw_stream_set_rate()
1083 struct sst_hsw_stream *stream, u32 map, in sst_hsw_stream_set_map_config() argument
1086 if (stream->commited) { in sst_hsw_stream_set_map_config()
1091 stream->request.format.map = map; in sst_hsw_stream_set_map_config()
1092 stream->request.format.config = config; in sst_hsw_stream_set_map_config()
1097 struct sst_hsw_stream *stream, enum sst_hsw_interleaving style) in sst_hsw_stream_set_style() argument
1099 if (stream->commited) { in sst_hsw_stream_set_style()
1104 stream->request.format.style = style; in sst_hsw_stream_set_style()
1109 struct sst_hsw_stream *stream, u32 bits) in sst_hsw_stream_set_valid() argument
1111 if (stream->commited) { in sst_hsw_stream_set_valid()
1116 stream->request.format.valid_bit = bits; in sst_hsw_stream_set_valid()
1121 int sst_hsw_stream_format(struct sst_hsw *hsw, struct sst_hsw_stream *stream, in sst_hsw_stream_format() argument
1126 if (stream->commited) { in sst_hsw_stream_format()
1131 stream->request.path_id = path_id; in sst_hsw_stream_format()
1132 stream->request.stream_type = stream_type; in sst_hsw_stream_format()
1133 stream->request.format_id = format_id; in sst_hsw_stream_format()
1135 trace_hsw_stream_alloc_request(stream, &stream->request); in sst_hsw_stream_format()
1140 int sst_hsw_stream_buffer(struct sst_hsw *hsw, struct sst_hsw_stream *stream, in sst_hsw_stream_buffer() argument
1144 if (stream->commited) { in sst_hsw_stream_buffer()
1149 stream->request.ringinfo.ring_pt_address = ring_pt_address; in sst_hsw_stream_buffer()
1150 stream->request.ringinfo.num_pages = num_pages; in sst_hsw_stream_buffer()
1151 stream->request.ringinfo.ring_size = ring_size; in sst_hsw_stream_buffer()
1152 stream->request.ringinfo.ring_offset = ring_offset; in sst_hsw_stream_buffer()
1153 stream->request.ringinfo.ring_first_pfn = ring_first_pfn; in sst_hsw_stream_buffer()
1155 trace_hsw_stream_buffer(stream); in sst_hsw_stream_buffer()
1161 struct sst_hsw_stream *stream, struct sst_module_runtime *runtime) in sst_hsw_stream_set_module_info() argument
1163 struct sst_hsw_module_map *map = &stream->request.map; in sst_hsw_stream_set_module_info()
1167 if (stream->commited) { in sst_hsw_stream_set_module_info()
1177 stream->request.persistent_mem.offset = in sst_hsw_stream_set_module_info()
1179 stream->request.persistent_mem.size = module->persistent_size; in sst_hsw_stream_set_module_info()
1181 stream->request.scratch_mem.offset = in sst_hsw_stream_set_module_info()
1183 stream->request.scratch_mem.size = dsp->scratch_size; in sst_hsw_stream_set_module_info()
1188 stream->request.persistent_mem.offset, in sst_hsw_stream_set_module_info()
1189 stream->request.persistent_mem.size); in sst_hsw_stream_set_module_info()
1191 stream->request.scratch_mem.offset, in sst_hsw_stream_set_module_info()
1192 stream->request.scratch_mem.size); in sst_hsw_stream_set_module_info()
1197 int sst_hsw_stream_commit(struct sst_hsw *hsw, struct sst_hsw_stream *stream) in sst_hsw_stream_commit() argument
1199 struct sst_hsw_ipc_stream_alloc_req *str_req = &stream->request; in sst_hsw_stream_commit()
1200 struct sst_hsw_ipc_stream_alloc_reply *reply = &stream->reply; in sst_hsw_stream_commit()
1204 if (!stream) { in sst_hsw_stream_commit()
1209 if (stream->commited) { in sst_hsw_stream_commit()
1214 trace_ipc_request("stream alloc", stream->host_id); in sst_hsw_stream_commit()
1225 stream->commited = 1; in sst_hsw_stream_commit()
1226 trace_hsw_stream_alloc_reply(stream); in sst_hsw_stream_commit()
1232 struct sst_hsw_stream *stream) in sst_hsw_stream_get_old_position() argument
1234 return stream->old_position; in sst_hsw_stream_get_old_position()
1238 struct sst_hsw_stream *stream, snd_pcm_uframes_t val) in sst_hsw_stream_set_old_position() argument
1240 stream->old_position = val; in sst_hsw_stream_set_old_position()
1244 struct sst_hsw_stream *stream) in sst_hsw_stream_get_silence_start() argument
1246 return stream->play_silence; in sst_hsw_stream_get_silence_start()
1250 struct sst_hsw_stream *stream, bool val) in sst_hsw_stream_set_silence_start() argument
1252 stream->play_silence = val; in sst_hsw_stream_set_silence_start()
1297 int sst_hsw_stream_pause(struct sst_hsw *hsw, struct sst_hsw_stream *stream, in sst_hsw_stream_pause() argument
1302 if (!stream) { in sst_hsw_stream_pause()
1307 trace_ipc_request("stream pause", stream->reply.stream_hw_id); in sst_hsw_stream_pause()
1310 stream->reply.stream_hw_id, wait); in sst_hsw_stream_pause()
1313 stream->reply.stream_hw_id); in sst_hsw_stream_pause()
1318 int sst_hsw_stream_resume(struct sst_hsw *hsw, struct sst_hsw_stream *stream, in sst_hsw_stream_resume() argument
1323 if (!stream) { in sst_hsw_stream_resume()
1328 trace_ipc_request("stream resume", stream->reply.stream_hw_id); in sst_hsw_stream_resume()
1331 stream->reply.stream_hw_id, wait); in sst_hsw_stream_resume()
1334 stream->reply.stream_hw_id); in sst_hsw_stream_resume()
1339 int sst_hsw_stream_reset(struct sst_hsw *hsw, struct sst_hsw_stream *stream) in sst_hsw_stream_reset() argument
1343 if (!stream) { in sst_hsw_stream_reset()
1349 if (!stream->commited) in sst_hsw_stream_reset()
1353 while (stream->running && tries--) in sst_hsw_stream_reset()
1357 stream->reply.stream_hw_id); in sst_hsw_stream_reset()
1361 trace_ipc_request("stream reset", stream->reply.stream_hw_id); in sst_hsw_stream_reset()
1364 stream->reply.stream_hw_id, 1); in sst_hsw_stream_reset()
1367 stream->reply.stream_hw_id); in sst_hsw_stream_reset()
1373 struct sst_hsw_stream *stream) in sst_hsw_get_dsp_position() argument
1378 stream->reply.read_position_register_address, sizeof(rpos)); in sst_hsw_get_dsp_position()
1385 struct sst_hsw_stream *stream) in sst_hsw_get_dsp_presentation_position() argument
1390 stream->reply.presentation_position_register_address, in sst_hsw_get_dsp_presentation_position()