Lines Matching refs:stream

247 	u32 (*notify_position)(struct sst_hsw_stream *stream, void *data);
425 struct sst_hsw_stream *stream; in get_stream_by_id() local
427 list_for_each_entry(stream, &hsw->stream_list, node) { in get_stream_by_id()
428 if (stream->reply.stream_hw_id == stream_id) in get_stream_by_id()
429 return stream; in get_stream_by_id()
479 struct sst_hsw_stream *stream = container_of(work, in hsw_notification_work() local
481 struct sst_hsw_ipc_stream_glitch_position *glitch = &stream->glitch; in hsw_notification_work()
482 struct sst_hsw_ipc_stream_get_position *pos = &stream->rpos; in hsw_notification_work()
483 struct sst_hsw *hsw = stream->hsw; in hsw_notification_work()
486 reason = msg_get_notify_reason(stream->header); in hsw_notification_work()
491 stream->reply.stream_hw_id); in hsw_notification_work()
501 stream->reply.stream_hw_id); in hsw_notification_work()
504 if (stream->notify_position) in hsw_notification_work()
505 stream->notify_position(stream, stream->pdata); in hsw_notification_work()
510 stream->header); in hsw_notification_work()
524 struct sst_hsw_stream *stream; in hsw_stream_update() local
529 stream = get_stream_by_id(hsw, stream_id); in hsw_stream_update()
530 if (stream == NULL) in hsw_stream_update()
538 trace_ipc_notification("stream reset", stream->reply.stream_hw_id); in hsw_stream_update()
541 stream->running = false; in hsw_stream_update()
543 stream->reply.stream_hw_id); in hsw_stream_update()
546 stream->running = true; in hsw_stream_update()
548 stream->reply.stream_hw_id); in hsw_stream_update()
667 struct sst_hsw_stream *stream; in hsw_stream_message() local
674 stream = get_stream_by_id(hsw, stream_id); in hsw_stream_message()
675 if (stream == NULL) in hsw_stream_message()
678 stream->header = header; in hsw_stream_message()
686 schedule_work(&stream->notify_work); in hsw_stream_message()
700 struct sst_hsw_log_stream *stream = &hsw->log_stream; in hsw_log_message() local
709 mutex_lock(&stream->rw_mutex); in hsw_log_message()
710 stream->last_pos = stream->curr_pos; in hsw_log_message()
712 hsw->dsp, &stream->curr_pos, sizeof(stream->curr_pos)); in hsw_log_message()
713 mutex_unlock(&stream->rw_mutex); in hsw_log_message()
715 schedule_work(&stream->notify_work); in hsw_log_message()
842 int sst_hsw_stream_get_volume(struct sst_hsw *hsw, struct sst_hsw_stream *stream, in sst_hsw_stream_get_volume() argument
849 stream->reply.volume_register_address[channel], in sst_hsw_stream_get_volume()
857 struct sst_hsw_stream *stream, u32 stage_id, u32 channel, u32 volume) in sst_hsw_stream_set_volume() argument
863 trace_ipc_request("set stream volume", stream->reply.stream_hw_id); in sst_hsw_stream_set_volume()
870 header |= (stream->reply.stream_hw_id << IPC_STR_ID_SHIFT); in sst_hsw_stream_set_volume()
874 req = &stream->vol_req; in sst_hsw_stream_set_volume()
975 u32 (*notify_position)(struct sst_hsw_stream *stream, void *data), in sst_hsw_stream_new() argument
978 struct sst_hsw_stream *stream; in sst_hsw_stream_new() local
982 stream = kzalloc(sizeof(*stream), GFP_KERNEL); in sst_hsw_stream_new()
983 if (stream == NULL) in sst_hsw_stream_new()
987 stream->reply.stream_hw_id = INVALID_STREAM_HW_ID; in sst_hsw_stream_new()
988 list_add(&stream->node, &hsw->stream_list); in sst_hsw_stream_new()
989 stream->notify_position = notify_position; in sst_hsw_stream_new()
990 stream->pdata = data; in sst_hsw_stream_new()
991 stream->hsw = hsw; in sst_hsw_stream_new()
992 stream->host_id = id; in sst_hsw_stream_new()
995 INIT_WORK(&stream->notify_work, hsw_notification_work); in sst_hsw_stream_new()
998 return stream; in sst_hsw_stream_new()
1001 int sst_hsw_stream_free(struct sst_hsw *hsw, struct sst_hsw_stream *stream) in sst_hsw_stream_free() argument
1008 if (!stream) { in sst_hsw_stream_free()
1014 if (!stream->commited) in sst_hsw_stream_free()
1017 trace_ipc_request("stream free", stream->host_id); in sst_hsw_stream_free()
1019 stream->free_req.stream_id = stream->reply.stream_hw_id; in sst_hsw_stream_free()
1022 ret = sst_ipc_tx_message_wait(&hsw->ipc, header, &stream->free_req, in sst_hsw_stream_free()
1023 sizeof(stream->free_req), NULL, 0); in sst_hsw_stream_free()
1026 stream->free_req.stream_id); in sst_hsw_stream_free()
1030 trace_hsw_stream_free_req(stream, &stream->free_req); in sst_hsw_stream_free()
1033 cancel_work_sync(&stream->notify_work); in sst_hsw_stream_free()
1035 list_del(&stream->node); in sst_hsw_stream_free()
1036 kfree(stream); in sst_hsw_stream_free()
1043 struct sst_hsw_stream *stream, enum sst_hsw_bitdepth bits) in sst_hsw_stream_set_bits() argument
1045 if (stream->commited) { in sst_hsw_stream_set_bits()
1050 stream->request.format.bitdepth = bits; in sst_hsw_stream_set_bits()
1055 struct sst_hsw_stream *stream, int channels) in sst_hsw_stream_set_channels() argument
1057 if (stream->commited) { in sst_hsw_stream_set_channels()
1062 stream->request.format.ch_num = channels; in sst_hsw_stream_set_channels()
1067 struct sst_hsw_stream *stream, int rate) in sst_hsw_stream_set_rate() argument
1069 if (stream->commited) { in sst_hsw_stream_set_rate()
1074 stream->request.format.frequency = rate; in sst_hsw_stream_set_rate()
1079 struct sst_hsw_stream *stream, u32 map, in sst_hsw_stream_set_map_config() argument
1082 if (stream->commited) { in sst_hsw_stream_set_map_config()
1087 stream->request.format.map = map; in sst_hsw_stream_set_map_config()
1088 stream->request.format.config = config; in sst_hsw_stream_set_map_config()
1093 struct sst_hsw_stream *stream, enum sst_hsw_interleaving style) in sst_hsw_stream_set_style() argument
1095 if (stream->commited) { in sst_hsw_stream_set_style()
1100 stream->request.format.style = style; in sst_hsw_stream_set_style()
1105 struct sst_hsw_stream *stream, u32 bits) in sst_hsw_stream_set_valid() argument
1107 if (stream->commited) { in sst_hsw_stream_set_valid()
1112 stream->request.format.valid_bit = bits; in sst_hsw_stream_set_valid()
1117 int sst_hsw_stream_format(struct sst_hsw *hsw, struct sst_hsw_stream *stream, in sst_hsw_stream_format() argument
1122 if (stream->commited) { in sst_hsw_stream_format()
1127 stream->request.path_id = path_id; in sst_hsw_stream_format()
1128 stream->request.stream_type = stream_type; in sst_hsw_stream_format()
1129 stream->request.format_id = format_id; in sst_hsw_stream_format()
1131 trace_hsw_stream_alloc_request(stream, &stream->request); in sst_hsw_stream_format()
1136 int sst_hsw_stream_buffer(struct sst_hsw *hsw, struct sst_hsw_stream *stream, in sst_hsw_stream_buffer() argument
1140 if (stream->commited) { in sst_hsw_stream_buffer()
1145 stream->request.ringinfo.ring_pt_address = ring_pt_address; in sst_hsw_stream_buffer()
1146 stream->request.ringinfo.num_pages = num_pages; in sst_hsw_stream_buffer()
1147 stream->request.ringinfo.ring_size = ring_size; in sst_hsw_stream_buffer()
1148 stream->request.ringinfo.ring_offset = ring_offset; in sst_hsw_stream_buffer()
1149 stream->request.ringinfo.ring_first_pfn = ring_first_pfn; in sst_hsw_stream_buffer()
1151 trace_hsw_stream_buffer(stream); in sst_hsw_stream_buffer()
1157 struct sst_hsw_stream *stream, struct sst_module_runtime *runtime) in sst_hsw_stream_set_module_info() argument
1159 struct sst_hsw_module_map *map = &stream->request.map; in sst_hsw_stream_set_module_info()
1163 if (stream->commited) { in sst_hsw_stream_set_module_info()
1173 stream->request.persistent_mem.offset = in sst_hsw_stream_set_module_info()
1175 stream->request.persistent_mem.size = module->persistent_size; in sst_hsw_stream_set_module_info()
1177 stream->request.scratch_mem.offset = in sst_hsw_stream_set_module_info()
1179 stream->request.scratch_mem.size = dsp->scratch_size; in sst_hsw_stream_set_module_info()
1184 stream->request.persistent_mem.offset, in sst_hsw_stream_set_module_info()
1185 stream->request.persistent_mem.size); in sst_hsw_stream_set_module_info()
1187 stream->request.scratch_mem.offset, in sst_hsw_stream_set_module_info()
1188 stream->request.scratch_mem.size); in sst_hsw_stream_set_module_info()
1193 int sst_hsw_stream_commit(struct sst_hsw *hsw, struct sst_hsw_stream *stream) in sst_hsw_stream_commit() argument
1195 struct sst_hsw_ipc_stream_alloc_req *str_req = &stream->request; in sst_hsw_stream_commit()
1196 struct sst_hsw_ipc_stream_alloc_reply *reply = &stream->reply; in sst_hsw_stream_commit()
1200 if (!stream) { in sst_hsw_stream_commit()
1205 if (stream->commited) { in sst_hsw_stream_commit()
1210 trace_ipc_request("stream alloc", stream->host_id); in sst_hsw_stream_commit()
1221 stream->commited = 1; in sst_hsw_stream_commit()
1222 trace_hsw_stream_alloc_reply(stream); in sst_hsw_stream_commit()
1228 struct sst_hsw_stream *stream) in sst_hsw_stream_get_old_position() argument
1230 return stream->old_position; in sst_hsw_stream_get_old_position()
1234 struct sst_hsw_stream *stream, snd_pcm_uframes_t val) in sst_hsw_stream_set_old_position() argument
1236 stream->old_position = val; in sst_hsw_stream_set_old_position()
1240 struct sst_hsw_stream *stream) in sst_hsw_stream_get_silence_start() argument
1242 return stream->play_silence; in sst_hsw_stream_get_silence_start()
1246 struct sst_hsw_stream *stream, bool val) in sst_hsw_stream_set_silence_start() argument
1248 stream->play_silence = val; in sst_hsw_stream_set_silence_start()
1293 int sst_hsw_stream_pause(struct sst_hsw *hsw, struct sst_hsw_stream *stream, in sst_hsw_stream_pause() argument
1298 if (!stream) { in sst_hsw_stream_pause()
1303 trace_ipc_request("stream pause", stream->reply.stream_hw_id); in sst_hsw_stream_pause()
1306 stream->reply.stream_hw_id, wait); in sst_hsw_stream_pause()
1309 stream->reply.stream_hw_id); in sst_hsw_stream_pause()
1314 int sst_hsw_stream_resume(struct sst_hsw *hsw, struct sst_hsw_stream *stream, in sst_hsw_stream_resume() argument
1319 if (!stream) { in sst_hsw_stream_resume()
1324 trace_ipc_request("stream resume", stream->reply.stream_hw_id); in sst_hsw_stream_resume()
1327 stream->reply.stream_hw_id, wait); in sst_hsw_stream_resume()
1330 stream->reply.stream_hw_id); in sst_hsw_stream_resume()
1335 int sst_hsw_stream_reset(struct sst_hsw *hsw, struct sst_hsw_stream *stream) in sst_hsw_stream_reset() argument
1339 if (!stream) { in sst_hsw_stream_reset()
1345 if (!stream->commited) in sst_hsw_stream_reset()
1349 while (stream->running && tries--) in sst_hsw_stream_reset()
1353 stream->reply.stream_hw_id); in sst_hsw_stream_reset()
1357 trace_ipc_request("stream reset", stream->reply.stream_hw_id); in sst_hsw_stream_reset()
1360 stream->reply.stream_hw_id, 1); in sst_hsw_stream_reset()
1363 stream->reply.stream_hw_id); in sst_hsw_stream_reset()
1369 struct sst_hsw_stream *stream) in sst_hsw_get_dsp_position() argument
1374 stream->reply.read_position_register_address, sizeof(rpos)); in sst_hsw_get_dsp_position()
1381 struct sst_hsw_stream *stream) in sst_hsw_get_dsp_presentation_position() argument
1386 stream->reply.presentation_position_register_address, in sst_hsw_get_dsp_presentation_position()