Lines Matching refs:hstream

28 static inline const char *hda_hstream_direction_str(struct hdac_stream *hstream)  in hda_hstream_direction_str()  argument
30 if (hstream->direction == SNDRV_PCM_STREAM_PLAYBACK) in hda_hstream_direction_str()
36 static char *hda_hstream_dbg_get_stream_info_str(struct hdac_stream *hstream) in hda_hstream_dbg_get_stream_info_str() argument
40 if (hstream->substream) in hda_hstream_dbg_get_stream_info_str()
41 rtd = asoc_substream_to_rtd(hstream->substream); in hda_hstream_dbg_get_stream_info_str()
42 else if (hstream->cstream) in hda_hstream_dbg_get_stream_info_str()
43 rtd = hstream->cstream->private_data; in hda_hstream_dbg_get_stream_info_str()
47 hda_hstream_direction_str(hstream), in hda_hstream_dbg_get_stream_info_str()
48 hstream->stream_tag); in hda_hstream_dbg_get_stream_info_str()
51 rtd->dai_link->name, hda_hstream_direction_str(hstream), in hda_hstream_dbg_get_stream_info_str()
52 hstream->stream_tag); in hda_hstream_dbg_get_stream_info_str()
60 struct hdac_stream *hstream, in hda_setup_bdle() argument
71 if (hstream->frags >= HDA_DSP_MAX_BDL_ENTRIES) { in hda_setup_bdle()
94 hstream->frags++; in hda_setup_bdle()
108 struct hdac_stream *hstream) in hda_dsp_stream_setup_bdl() argument
115 period_bytes = hstream->period_bytes; in hda_dsp_stream_setup_bdl()
118 period_bytes = hstream->bufsize; in hda_dsp_stream_setup_bdl()
120 periods = hstream->bufsize / period_bytes; in hda_dsp_stream_setup_bdl()
124 remain = hstream->bufsize % period_bytes; in hda_dsp_stream_setup_bdl()
129 bdl = (struct sof_intel_dsp_bdl *)hstream->bdl.area; in hda_dsp_stream_setup_bdl()
131 hstream->frags = 0; in hda_dsp_stream_setup_bdl()
138 !hstream->no_period_wakeup : 0; in hda_dsp_stream_setup_bdl()
144 hstream, &bdl, offset, in hda_dsp_stream_setup_bdl()
148 hstream, &bdl, offset, in hda_dsp_stream_setup_bdl()
159 struct hdac_stream *hstream = &hext_stream->hstream; in hda_dsp_stream_spib_config() local
167 mask = (1 << hstream->index); in hda_dsp_stream_spib_config()
172 enable << hstream->index); in hda_dsp_stream_spib_config()
175 sof_io_write(sdev, hstream->spib_addr, size); in hda_dsp_stream_spib_config()
288 static int hda_dsp_stream_reset(struct snd_sof_dev *sdev, struct hdac_stream *hstream) in hda_dsp_stream_reset() argument
290 int sd_offset = SOF_STREAM_SD_OFFSET(hstream); in hda_dsp_stream_reset()
330 struct hdac_stream *hstream = &hext_stream->hstream; in hda_dsp_stream_trigger() local
331 int sd_offset = SOF_STREAM_SD_OFFSET(hstream); in hda_dsp_stream_trigger()
343 if (hstream->running) in hda_dsp_stream_trigger()
347 1 << hstream->index, in hda_dsp_stream_trigger()
348 1 << hstream->index); in hda_dsp_stream_trigger()
365 hstream->running = true; in hda_dsp_stream_trigger()
390 hstream->running = false; in hda_dsp_stream_trigger()
393 1 << hstream->index, 0x0); in hda_dsp_stream_trigger()
402 char *stream_name = hda_hstream_dbg_get_stream_info_str(hstream); in hda_dsp_stream_trigger()
418 struct hdac_stream *hstream = &hext_stream->hstream; in hda_dsp_iccmax_stream_hw_params() local
419 int sd_offset = SOF_STREAM_SD_OFFSET(hstream); in hda_dsp_iccmax_stream_hw_params()
421 u32 mask = 0x1 << hstream->index; in hda_dsp_iccmax_stream_hw_params()
433 if (hstream->posbuf) in hda_dsp_iccmax_stream_hw_params()
434 *hstream->posbuf = 0; in hda_dsp_iccmax_stream_hw_params()
444 hstream->frags = 0; in hda_dsp_iccmax_stream_hw_params()
446 ret = hda_dsp_stream_setup_bdl(sdev, dmab, hstream); in hda_dsp_iccmax_stream_hw_params()
455 (u32)hstream->bdl.addr); in hda_dsp_iccmax_stream_hw_params()
458 upper_32_bits(hstream->bdl.addr)); in hda_dsp_iccmax_stream_hw_params()
463 hstream->bufsize); in hda_dsp_iccmax_stream_hw_params()
468 0xffff, (hstream->frags - 1)); in hda_dsp_iccmax_stream_hw_params()
496 struct hdac_stream *hstream; in hda_dsp_stream_hw_params() local
512 hstream = &hext_stream->hstream; in hda_dsp_stream_hw_params()
513 sd_offset = SOF_STREAM_SD_OFFSET(hstream); in hda_dsp_stream_hw_params()
514 mask = BIT(hstream->index); in hda_dsp_stream_hw_params()
533 char *stream_name = hda_hstream_dbg_get_stream_info_str(hstream); in hda_dsp_stream_hw_params()
548 ret = hda_dsp_stream_reset(sdev, hstream); in hda_dsp_stream_hw_params()
552 if (hstream->posbuf) in hda_dsp_stream_hw_params()
553 *hstream->posbuf = 0; in hda_dsp_stream_hw_params()
575 char *stream_name = hda_hstream_dbg_get_stream_info_str(hstream); in hda_dsp_stream_hw_params()
589 hstream->frags = 0; in hda_dsp_stream_hw_params()
591 ret = hda_dsp_stream_setup_bdl(sdev, dmab, hstream); in hda_dsp_stream_hw_params()
600 hstream->stream_tag << in hda_dsp_stream_hw_params()
606 hstream->bufsize); in hda_dsp_stream_hw_params()
629 0xffff, hstream->format_val); in hda_dsp_stream_hw_params()
639 0xffff, (hstream->frags - 1)); in hda_dsp_stream_hw_params()
644 (u32)hstream->bdl.addr); in hda_dsp_stream_hw_params()
647 upper_32_bits(hstream->bdl.addr)); in hda_dsp_stream_hw_params()
666 if (hstream->direction == SNDRV_PCM_STREAM_PLAYBACK) { in hda_dsp_stream_hw_params()
667 hstream->fifo_size = in hda_dsp_stream_hw_params()
671 hstream->fifo_size &= 0xffff; in hda_dsp_stream_hw_params()
672 hstream->fifo_size += 1; in hda_dsp_stream_hw_params()
674 hstream->fifo_size = 0; in hda_dsp_stream_hw_params()
683 struct hdac_stream *hstream = substream->runtime->private_data; in hda_dsp_stream_hw_free() local
684 struct hdac_ext_stream *hext_stream = container_of(hstream, in hda_dsp_stream_hw_free()
686 hstream); in hda_dsp_stream_hw_free()
689 ret = hda_dsp_stream_reset(sdev, hstream); in hda_dsp_stream_hw_free()
695 u32 mask = BIT(hstream->index); in hda_dsp_stream_hw_free()
707 hstream->substream = NULL; in hda_dsp_stream_hw_free()
735 hda_dsp_compr_bytes_transferred(struct hdac_stream *hstream, int direction) in hda_dsp_compr_bytes_transferred() argument
737 u64 buffer_size = hstream->bufsize; in hda_dsp_compr_bytes_transferred()
740 div64_u64_rem(hstream->curr_pos, buffer_size, &prev_pos); in hda_dsp_compr_bytes_transferred()
741 pos = hda_dsp_stream_get_position(hstream, direction, false); in hda_dsp_compr_bytes_transferred()
748 hstream->curr_pos += num_bytes; in hda_dsp_compr_bytes_transferred()
819 struct hdac_stream *hstream; in hda_dsp_stream_init() local
894 hstream = &hext_stream->hstream; in hda_dsp_stream_init()
898 hstream->spib_addr = sdev->bar[HDA_DSP_SPIB_BAR] + in hda_dsp_stream_init()
902 hstream->fifo_addr = sdev->bar[HDA_DSP_SPIB_BAR] + in hda_dsp_stream_init()
907 hstream->bus = bus; in hda_dsp_stream_init()
908 hstream->sd_int_sta_mask = 1 << i; in hda_dsp_stream_init()
909 hstream->index = i; in hda_dsp_stream_init()
910 sd_offset = SOF_STREAM_SD_OFFSET(hstream); in hda_dsp_stream_init()
911 hstream->sd_addr = sdev->bar[HDA_DSP_HDA_BAR] + sd_offset; in hda_dsp_stream_init()
912 hstream->opened = false; in hda_dsp_stream_init()
913 hstream->running = false; in hda_dsp_stream_init()
916 hstream->stream_tag = i + 1; in hda_dsp_stream_init()
917 hstream->direction = SNDRV_PCM_STREAM_CAPTURE; in hda_dsp_stream_init()
919 hstream->stream_tag = i - num_capture + 1; in hda_dsp_stream_init()
920 hstream->direction = SNDRV_PCM_STREAM_PLAYBACK; in hda_dsp_stream_init()
925 HDA_DSP_BDL_SIZE, &hstream->bdl); in hda_dsp_stream_init()
931 hstream->posbuf = (__le32 *)(bus->posbuf.area + in hda_dsp_stream_init()
932 (hstream->index) * 8); in hda_dsp_stream_init()
934 list_add_tail(&hstream->list, &bus->stream_list); in hda_dsp_stream_init()
972 snd_pcm_uframes_t hda_dsp_stream_get_position(struct hdac_stream *hstream, in hda_dsp_stream_get_position() argument
975 struct hdac_ext_stream *hext_stream = stream_to_hdac_ext_stream(hstream); in hda_dsp_stream_get_position()
1004 hstream->index)); in hda_dsp_stream_get_position()
1024 hstream->index)); in hda_dsp_stream_get_position()
1025 pos = snd_hdac_stream_get_pos_posbuf(hstream); in hda_dsp_stream_get_position()
1035 hstream->index)); in hda_dsp_stream_get_position()
1043 pos = snd_hdac_stream_get_pos_posbuf(hstream); in hda_dsp_stream_get_position()
1052 if (pos >= hstream->bufsize) in hda_dsp_stream_get_position()