Lines Matching refs:hstream
29 static inline const char *hda_hstream_direction_str(struct hdac_stream *hstream) in hda_hstream_direction_str() argument
31 if (hstream->direction == SNDRV_PCM_STREAM_PLAYBACK) in hda_hstream_direction_str()
37 static char *hda_hstream_dbg_get_stream_info_str(struct hdac_stream *hstream) in hda_hstream_dbg_get_stream_info_str() argument
41 if (hstream->substream) in hda_hstream_dbg_get_stream_info_str()
42 rtd = asoc_substream_to_rtd(hstream->substream); in hda_hstream_dbg_get_stream_info_str()
43 else if (hstream->cstream) in hda_hstream_dbg_get_stream_info_str()
44 rtd = hstream->cstream->private_data; in hda_hstream_dbg_get_stream_info_str()
48 hda_hstream_direction_str(hstream), in hda_hstream_dbg_get_stream_info_str()
49 hstream->stream_tag); in hda_hstream_dbg_get_stream_info_str()
52 rtd->dai_link->name, hda_hstream_direction_str(hstream), in hda_hstream_dbg_get_stream_info_str()
53 hstream->stream_tag); in hda_hstream_dbg_get_stream_info_str()
61 struct hdac_stream *hstream, in hda_setup_bdle() argument
72 if (hstream->frags >= HDA_DSP_MAX_BDL_ENTRIES) { in hda_setup_bdle()
95 hstream->frags++; in hda_setup_bdle()
109 struct hdac_stream *hstream) in hda_dsp_stream_setup_bdl() argument
116 period_bytes = hstream->period_bytes; in hda_dsp_stream_setup_bdl()
119 period_bytes = hstream->bufsize; in hda_dsp_stream_setup_bdl()
121 periods = hstream->bufsize / period_bytes; in hda_dsp_stream_setup_bdl()
125 remain = hstream->bufsize % period_bytes; in hda_dsp_stream_setup_bdl()
130 bdl = (struct sof_intel_dsp_bdl *)hstream->bdl.area; in hda_dsp_stream_setup_bdl()
132 hstream->frags = 0; in hda_dsp_stream_setup_bdl()
139 !hstream->no_period_wakeup : 0; in hda_dsp_stream_setup_bdl()
145 hstream, &bdl, offset, in hda_dsp_stream_setup_bdl()
149 hstream, &bdl, offset, in hda_dsp_stream_setup_bdl()
160 struct hdac_stream *hstream = &hext_stream->hstream; in hda_dsp_stream_spib_config() local
168 mask = (1 << hstream->index); in hda_dsp_stream_spib_config()
173 enable << hstream->index); in hda_dsp_stream_spib_config()
280 static int hda_dsp_stream_reset(struct snd_sof_dev *sdev, struct hdac_stream *hstream) in hda_dsp_stream_reset() argument
282 int sd_offset = SOF_STREAM_SD_OFFSET(hstream); in hda_dsp_stream_reset()
322 struct hdac_stream *hstream = &hext_stream->hstream; in hda_dsp_stream_trigger() local
323 int sd_offset = SOF_STREAM_SD_OFFSET(hstream); in hda_dsp_stream_trigger()
333 1 << hstream->index, in hda_dsp_stream_trigger()
334 1 << hstream->index); in hda_dsp_stream_trigger()
351 hstream->running = true; in hda_dsp_stream_trigger()
373 hstream->running = false; in hda_dsp_stream_trigger()
376 1 << hstream->index, 0x0); in hda_dsp_stream_trigger()
385 char *stream_name = hda_hstream_dbg_get_stream_info_str(hstream); in hda_dsp_stream_trigger()
402 struct hdac_stream *hstream = &hext_stream->hstream; in hda_dsp_iccmax_stream_hw_params() local
403 int sd_offset = SOF_STREAM_SD_OFFSET(hstream); in hda_dsp_iccmax_stream_hw_params()
405 u32 mask = 0x1 << hstream->index; in hda_dsp_iccmax_stream_hw_params()
417 if (hstream->posbuf) in hda_dsp_iccmax_stream_hw_params()
418 *hstream->posbuf = 0; in hda_dsp_iccmax_stream_hw_params()
428 hstream->frags = 0; in hda_dsp_iccmax_stream_hw_params()
430 ret = hda_dsp_stream_setup_bdl(sdev, dmab, hstream); in hda_dsp_iccmax_stream_hw_params()
439 (u32)hstream->bdl.addr); in hda_dsp_iccmax_stream_hw_params()
442 upper_32_bits(hstream->bdl.addr)); in hda_dsp_iccmax_stream_hw_params()
447 hstream->bufsize); in hda_dsp_iccmax_stream_hw_params()
452 0xffff, (hstream->frags - 1)); in hda_dsp_iccmax_stream_hw_params()
479 struct hdac_stream *hstream = &hext_stream->hstream; in hda_dsp_stream_hw_params() local
480 int sd_offset = SOF_STREAM_SD_OFFSET(hstream); in hda_dsp_stream_hw_params()
497 mask = 0x1 << hstream->index; in hda_dsp_stream_hw_params()
513 char *stream_name = hda_hstream_dbg_get_stream_info_str(hstream); in hda_dsp_stream_hw_params()
528 ret = hda_dsp_stream_reset(sdev, hstream); in hda_dsp_stream_hw_params()
532 if (hstream->posbuf) in hda_dsp_stream_hw_params()
533 *hstream->posbuf = 0; in hda_dsp_stream_hw_params()
555 char *stream_name = hda_hstream_dbg_get_stream_info_str(hstream); in hda_dsp_stream_hw_params()
569 hstream->frags = 0; in hda_dsp_stream_hw_params()
571 ret = hda_dsp_stream_setup_bdl(sdev, dmab, hstream); in hda_dsp_stream_hw_params()
580 hstream->stream_tag << in hda_dsp_stream_hw_params()
586 hstream->bufsize); in hda_dsp_stream_hw_params()
610 0xffff, hstream->format_val); in hda_dsp_stream_hw_params()
621 0xffff, (hstream->frags - 1)); in hda_dsp_stream_hw_params()
626 (u32)hstream->bdl.addr); in hda_dsp_stream_hw_params()
629 upper_32_bits(hstream->bdl.addr)); in hda_dsp_stream_hw_params()
648 if (hstream->direction == SNDRV_PCM_STREAM_PLAYBACK) { in hda_dsp_stream_hw_params()
649 hstream->fifo_size = in hda_dsp_stream_hw_params()
653 hstream->fifo_size &= 0xffff; in hda_dsp_stream_hw_params()
654 hstream->fifo_size += 1; in hda_dsp_stream_hw_params()
656 hstream->fifo_size = 0; in hda_dsp_stream_hw_params()
665 struct hdac_stream *hstream = substream->runtime->private_data; in hda_dsp_stream_hw_free() local
666 struct hdac_ext_stream *hext_stream = container_of(hstream, in hda_dsp_stream_hw_free()
668 hstream); in hda_dsp_stream_hw_free()
670 u32 mask = 0x1 << hstream->index; in hda_dsp_stream_hw_free()
673 ret = hda_dsp_stream_reset(sdev, hstream); in hda_dsp_stream_hw_free()
686 hstream->substream = NULL; in hda_dsp_stream_hw_free()
713 hda_dsp_compr_bytes_transferred(struct hdac_stream *hstream, int direction) in hda_dsp_compr_bytes_transferred() argument
715 u64 buffer_size = hstream->bufsize; in hda_dsp_compr_bytes_transferred()
718 div64_u64_rem(hstream->curr_pos, buffer_size, &prev_pos); in hda_dsp_compr_bytes_transferred()
719 pos = hda_dsp_stream_get_position(hstream, direction, false); in hda_dsp_compr_bytes_transferred()
726 hstream->curr_pos += num_bytes; in hda_dsp_compr_bytes_transferred()
814 struct hdac_stream *hstream; in hda_dsp_stream_init() local
897 hstream = &hext_stream->hstream; in hda_dsp_stream_init()
898 hstream->bus = bus; in hda_dsp_stream_init()
899 hstream->sd_int_sta_mask = 1 << i; in hda_dsp_stream_init()
900 hstream->index = i; in hda_dsp_stream_init()
901 sd_offset = SOF_STREAM_SD_OFFSET(hstream); in hda_dsp_stream_init()
902 hstream->sd_addr = sdev->bar[HDA_DSP_HDA_BAR] + sd_offset; in hda_dsp_stream_init()
903 hstream->stream_tag = i + 1; in hda_dsp_stream_init()
904 hstream->opened = false; in hda_dsp_stream_init()
905 hstream->running = false; in hda_dsp_stream_init()
906 hstream->direction = SNDRV_PCM_STREAM_CAPTURE; in hda_dsp_stream_init()
910 HDA_DSP_BDL_SIZE, &hstream->bdl); in hda_dsp_stream_init()
915 hstream->posbuf = (__le32 *)(bus->posbuf.area + in hda_dsp_stream_init()
916 (hstream->index) * 8); in hda_dsp_stream_init()
918 list_add_tail(&hstream->list, &bus->stream_list); in hda_dsp_stream_init()
953 hstream = &hext_stream->hstream; in hda_dsp_stream_init()
954 hstream->bus = bus; in hda_dsp_stream_init()
955 hstream->sd_int_sta_mask = 1 << i; in hda_dsp_stream_init()
956 hstream->index = i; in hda_dsp_stream_init()
957 sd_offset = SOF_STREAM_SD_OFFSET(hstream); in hda_dsp_stream_init()
958 hstream->sd_addr = sdev->bar[HDA_DSP_HDA_BAR] + sd_offset; in hda_dsp_stream_init()
959 hstream->stream_tag = i - num_capture + 1; in hda_dsp_stream_init()
960 hstream->opened = false; in hda_dsp_stream_init()
961 hstream->running = false; in hda_dsp_stream_init()
962 hstream->direction = SNDRV_PCM_STREAM_PLAYBACK; in hda_dsp_stream_init()
966 HDA_DSP_BDL_SIZE, &hstream->bdl); in hda_dsp_stream_init()
972 hstream->posbuf = (__le32 *)(bus->posbuf.area + in hda_dsp_stream_init()
973 (hstream->index) * 8); in hda_dsp_stream_init()
975 list_add_tail(&hstream->list, &bus->stream_list); in hda_dsp_stream_init()
1015 snd_pcm_uframes_t hda_dsp_stream_get_position(struct hdac_stream *hstream, in hda_dsp_stream_get_position() argument
1018 struct hdac_ext_stream *hext_stream = stream_to_hdac_ext_stream(hstream); in hda_dsp_stream_get_position()
1047 hstream->index)); in hda_dsp_stream_get_position()
1067 hstream->index)); in hda_dsp_stream_get_position()
1068 pos = snd_hdac_stream_get_pos_posbuf(hstream); in hda_dsp_stream_get_position()
1078 hstream->index)); in hda_dsp_stream_get_position()
1086 pos = snd_hdac_stream_get_pos_posbuf(hstream); in hda_dsp_stream_get_position()
1095 if (pos >= hstream->bufsize) in hda_dsp_stream_get_position()