Lines Matching refs:azx_dev

437 static inline void mark_runtime_wc(struct azx *chip, struct azx_dev *azx_dev,  in mark_runtime_wc()  argument
440 if (azx_dev->wc_marked != on) { in mark_runtime_wc()
442 azx_dev->wc_marked = on; in mark_runtime_wc()
451 static inline void mark_runtime_wc(struct azx *chip, struct azx_dev *azx_dev, in mark_runtime_wc() argument
674 static int azx_get_delay_from_lpib(struct azx *chip, struct azx_dev *azx_dev, in azx_get_delay_from_lpib() argument
677 struct snd_pcm_substream *substream = azx_dev->core.substream; in azx_get_delay_from_lpib()
679 unsigned int lpib_pos = azx_get_pos_lpib(chip, azx_dev); in azx_get_delay_from_lpib()
687 if (delay >= azx_dev->core.delay_negative_threshold) in azx_get_delay_from_lpib()
690 delay += azx_dev->core.bufsize; in azx_get_delay_from_lpib()
693 if (delay >= azx_dev->core.period_bytes) { in azx_get_delay_from_lpib()
696 delay, azx_dev->core.period_bytes); in azx_get_delay_from_lpib()
705 static int azx_position_ok(struct azx *chip, struct azx_dev *azx_dev);
708 static int azx_position_check(struct azx *chip, struct azx_dev *azx_dev) in azx_position_check() argument
713 ok = azx_position_ok(chip, azx_dev); in azx_position_check()
715 azx_dev->irq_pending = 0; in azx_position_check()
719 azx_dev->irq_pending = 1; in azx_position_check()
742 static int azx_position_ok(struct azx *chip, struct azx_dev *azx_dev) in azx_position_ok() argument
744 struct snd_pcm_substream *substream = azx_dev->core.substream; in azx_position_ok()
749 wallclk = azx_readl(chip, WALLCLK) - azx_dev->core.start_wallclk; in azx_position_ok()
750 if (wallclk < (azx_dev->core.period_wallclk * 2) / 3) in azx_position_ok()
754 pos = chip->get_position[stream](chip, azx_dev); in azx_position_ok()
756 pos = azx_get_pos_posbuf(chip, azx_dev); in azx_position_ok()
764 pos = azx_get_pos_lpib(chip, azx_dev); in azx_position_ok()
773 if (pos >= azx_dev->core.bufsize) in azx_position_ok()
776 if (WARN_ONCE(!azx_dev->core.period_bytes, in azx_position_ok()
779 if (wallclk < (azx_dev->core.period_wallclk * 5) / 4 && in azx_position_ok()
780 pos % azx_dev->core.period_bytes > azx_dev->core.period_bytes / 2) in azx_position_ok()
783 azx_dev->core.start_wallclk += wallclk; in azx_position_ok()
809 struct azx_dev *azx_dev = stream_to_azx_dev(s); in azx_irq_pending_work() local
810 if (!azx_dev->irq_pending || in azx_irq_pending_work()
814 ok = azx_position_ok(chip, azx_dev); in azx_irq_pending_work()
816 azx_dev->irq_pending = 0; in azx_irq_pending_work()
840 struct azx_dev *azx_dev = stream_to_azx_dev(s); in azx_clear_irq_pending() local
841 azx_dev->irq_pending = 0; in azx_clear_irq_pending()
867 struct azx_dev *azx_dev) in azx_via_get_position() argument
873 link_pos = snd_hdac_stream_get_pos_lpib(azx_stream(azx_dev)); in azx_via_get_position()
874 if (azx_dev->core.substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { in azx_via_get_position()
883 mod_dma_pos = le32_to_cpu(*azx_dev->core.posbuf); in azx_via_get_position()
884 mod_dma_pos %= azx_dev->core.period_bytes; in azx_via_get_position()
892 if (azx_dev->insufficient) { in azx_via_get_position()
897 azx_dev->insufficient = 0; in azx_via_get_position()
901 mini_pos = azx_dev->core.bufsize + link_pos - fifo_size; in azx_via_get_position()
906 mod_mini_pos = mini_pos % azx_dev->core.period_bytes; in azx_via_get_position()
907 mod_link_pos = link_pos % azx_dev->core.period_bytes; in azx_via_get_position()
913 bound_pos = mini_pos - mod_mini_pos + azx_dev->core.period_bytes; in azx_via_get_position()
914 if (bound_pos >= azx_dev->core.bufsize) in azx_via_get_position()
923 struct azx_dev *azx_dev) in azx_skl_get_dpib_pos() argument
928 azx_dev->core.index)); in azx_skl_get_dpib_pos()
932 static unsigned int azx_get_pos_skl(struct azx *chip, struct azx_dev *azx_dev) in azx_get_pos_skl() argument
935 if (azx_dev->core.substream->stream == SNDRV_PCM_STREAM_PLAYBACK) in azx_get_pos_skl()
936 return azx_skl_get_dpib_pos(chip, azx_dev); in azx_get_pos_skl()
943 azx_skl_get_dpib_pos(chip, azx_dev); in azx_get_pos_skl()
944 return azx_get_pos_posbuf(chip, azx_dev); in azx_get_pos_skl()
2116 struct azx_dev *azx_dev = get_azx_dev(substream); in substream_alloc_pages() local
2119 mark_runtime_wc(chip, azx_dev, substream, false); in substream_alloc_pages()
2123 mark_runtime_wc(chip, azx_dev, substream, true); in substream_alloc_pages()
2130 struct azx_dev *azx_dev = get_azx_dev(substream); in substream_free_pages() local
2131 mark_runtime_wc(chip, azx_dev, substream, false); in substream_free_pages()