Lines Matching refs:azx_dev

579 static int azx_get_delay_from_lpib(struct azx *chip, struct azx_dev *azx_dev,  in azx_get_delay_from_lpib()  argument
582 struct snd_pcm_substream *substream = azx_dev->core.substream; in azx_get_delay_from_lpib()
584 unsigned int lpib_pos = azx_get_pos_lpib(chip, azx_dev); in azx_get_delay_from_lpib()
592 if (delay >= azx_dev->core.delay_negative_threshold) in azx_get_delay_from_lpib()
595 delay += azx_dev->core.bufsize; in azx_get_delay_from_lpib()
598 if (delay >= azx_dev->core.period_bytes) { in azx_get_delay_from_lpib()
601 delay, azx_dev->core.period_bytes); in azx_get_delay_from_lpib()
610 static int azx_position_ok(struct azx *chip, struct azx_dev *azx_dev);
613 static int azx_position_check(struct azx *chip, struct azx_dev *azx_dev) in azx_position_check() argument
618 ok = azx_position_ok(chip, azx_dev); in azx_position_check()
620 azx_dev->irq_pending = 0; in azx_position_check()
624 azx_dev->irq_pending = 1; in azx_position_check()
644 static int azx_position_ok(struct azx *chip, struct azx_dev *azx_dev) in azx_position_ok() argument
646 struct snd_pcm_substream *substream = azx_dev->core.substream; in azx_position_ok()
660 wallclk = azx_readl(chip, WALLCLK) - azx_dev->core.start_wallclk; in azx_position_ok()
661 if (wallclk < (azx_dev->core.period_wallclk * 2) / 3) in azx_position_ok()
665 pos = chip->get_position[stream](chip, azx_dev); in azx_position_ok()
667 pos = azx_get_pos_posbuf(chip, azx_dev); in azx_position_ok()
675 pos = azx_get_pos_lpib(chip, azx_dev); in azx_position_ok()
684 if (pos >= azx_dev->core.bufsize) in azx_position_ok()
687 if (WARN_ONCE(!azx_dev->core.period_bytes, in azx_position_ok()
690 if (wallclk < (azx_dev->core.period_wallclk * 5) / 4 && in azx_position_ok()
691 pos % azx_dev->core.period_bytes > azx_dev->core.period_bytes / 2) in azx_position_ok()
694 azx_dev->core.start_wallclk += wallclk; in azx_position_ok()
696 if (azx_dev->core.no_period_wakeup) in azx_position_ok()
738 struct azx_dev *azx_dev = stream_to_azx_dev(s); in azx_irq_pending_work() local
739 if (!azx_dev->irq_pending || in azx_irq_pending_work()
743 ok = azx_position_ok(chip, azx_dev); in azx_irq_pending_work()
745 azx_dev->irq_pending = 0; in azx_irq_pending_work()
769 struct azx_dev *azx_dev = stream_to_azx_dev(s); in azx_clear_irq_pending() local
770 azx_dev->irq_pending = 0; in azx_clear_irq_pending()
804 struct azx_dev *azx_dev) in azx_via_get_position() argument
810 link_pos = snd_hdac_stream_get_pos_lpib(azx_stream(azx_dev)); in azx_via_get_position()
811 if (azx_dev->core.substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { in azx_via_get_position()
820 mod_dma_pos = le32_to_cpu(*azx_dev->core.posbuf); in azx_via_get_position()
821 mod_dma_pos %= azx_dev->core.period_bytes; in azx_via_get_position()
823 fifo_size = azx_stream(azx_dev)->fifo_size; in azx_via_get_position()
825 if (azx_dev->insufficient) { in azx_via_get_position()
830 azx_dev->insufficient = 0; in azx_via_get_position()
834 mini_pos = azx_dev->core.bufsize + link_pos - fifo_size; in azx_via_get_position()
839 mod_mini_pos = mini_pos % azx_dev->core.period_bytes; in azx_via_get_position()
840 mod_link_pos = link_pos % azx_dev->core.period_bytes; in azx_via_get_position()
846 bound_pos = mini_pos - mod_mini_pos + azx_dev->core.period_bytes; in azx_via_get_position()
847 if (bound_pos >= azx_dev->core.bufsize) in azx_via_get_position()
858 static unsigned int azx_get_pos_fifo(struct azx *chip, struct azx_dev *azx_dev) in azx_get_pos_fifo() argument
860 struct snd_pcm_substream *substream = azx_dev->core.substream; in azx_get_pos_fifo()
864 pos = snd_hdac_stream_get_pos_lpib(azx_stream(azx_dev)); in azx_get_pos_fifo()
870 if (azx_dev->insufficient) { in azx_get_pos_fifo()
875 azx_dev->insufficient = 0; in azx_get_pos_fifo()
882 pos += azx_dev->core.bufsize; in azx_get_pos_fifo()
889 static int azx_get_delay_from_fifo(struct azx *chip, struct azx_dev *azx_dev, in azx_get_delay_from_fifo() argument
892 struct snd_pcm_substream *substream = azx_dev->core.substream; in azx_get_delay_from_fifo()