Lines Matching refs:azx_dev
422 static inline void mark_runtime_wc(struct azx *chip, struct azx_dev *azx_dev, in mark_runtime_wc() argument
425 if (azx_dev->wc_marked != on) { in mark_runtime_wc()
427 azx_dev->wc_marked = on; in mark_runtime_wc()
436 static inline void mark_runtime_wc(struct azx *chip, struct azx_dev *azx_dev, in mark_runtime_wc() argument
563 static int azx_get_delay_from_lpib(struct azx *chip, struct azx_dev *azx_dev, in azx_get_delay_from_lpib() argument
566 struct snd_pcm_substream *substream = azx_dev->core.substream; in azx_get_delay_from_lpib()
568 unsigned int lpib_pos = azx_get_pos_lpib(chip, azx_dev); in azx_get_delay_from_lpib()
576 if (delay >= azx_dev->core.delay_negative_threshold) in azx_get_delay_from_lpib()
579 delay += azx_dev->core.bufsize; in azx_get_delay_from_lpib()
582 if (delay >= azx_dev->core.period_bytes) { in azx_get_delay_from_lpib()
585 delay, azx_dev->core.period_bytes); in azx_get_delay_from_lpib()
594 static int azx_position_ok(struct azx *chip, struct azx_dev *azx_dev);
597 static int azx_position_check(struct azx *chip, struct azx_dev *azx_dev) in azx_position_check() argument
602 ok = azx_position_ok(chip, azx_dev); in azx_position_check()
604 azx_dev->irq_pending = 0; in azx_position_check()
608 azx_dev->irq_pending = 1; in azx_position_check()
631 static int azx_position_ok(struct azx *chip, struct azx_dev *azx_dev) in azx_position_ok() argument
633 struct snd_pcm_substream *substream = azx_dev->core.substream; in azx_position_ok()
638 wallclk = azx_readl(chip, WALLCLK) - azx_dev->core.start_wallclk; in azx_position_ok()
639 if (wallclk < (azx_dev->core.period_wallclk * 2) / 3) in azx_position_ok()
643 pos = chip->get_position[stream](chip, azx_dev); in azx_position_ok()
645 pos = azx_get_pos_posbuf(chip, azx_dev); in azx_position_ok()
653 pos = azx_get_pos_lpib(chip, azx_dev); in azx_position_ok()
662 if (pos >= azx_dev->core.bufsize) in azx_position_ok()
665 if (WARN_ONCE(!azx_dev->core.period_bytes, in azx_position_ok()
668 if (wallclk < (azx_dev->core.period_wallclk * 5) / 4 && in azx_position_ok()
669 pos % azx_dev->core.period_bytes > azx_dev->core.period_bytes / 2) in azx_position_ok()
672 azx_dev->core.start_wallclk += wallclk; in azx_position_ok()
698 struct azx_dev *azx_dev = stream_to_azx_dev(s); in azx_irq_pending_work() local
699 if (!azx_dev->irq_pending || in azx_irq_pending_work()
703 ok = azx_position_ok(chip, azx_dev); in azx_irq_pending_work()
705 azx_dev->irq_pending = 0; in azx_irq_pending_work()
729 struct azx_dev *azx_dev = stream_to_azx_dev(s); in azx_clear_irq_pending() local
730 azx_dev->irq_pending = 0; in azx_clear_irq_pending()
756 struct azx_dev *azx_dev) in azx_via_get_position() argument
762 link_pos = snd_hdac_stream_get_pos_lpib(azx_stream(azx_dev)); in azx_via_get_position()
763 if (azx_dev->core.substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { in azx_via_get_position()
772 mod_dma_pos = le32_to_cpu(*azx_dev->core.posbuf); in azx_via_get_position()
773 mod_dma_pos %= azx_dev->core.period_bytes; in azx_via_get_position()
781 if (azx_dev->insufficient) { in azx_via_get_position()
786 azx_dev->insufficient = 0; in azx_via_get_position()
790 mini_pos = azx_dev->core.bufsize + link_pos - fifo_size; in azx_via_get_position()
795 mod_mini_pos = mini_pos % azx_dev->core.period_bytes; in azx_via_get_position()
796 mod_link_pos = link_pos % azx_dev->core.period_bytes; in azx_via_get_position()
802 bound_pos = mini_pos - mod_mini_pos + azx_dev->core.period_bytes; in azx_via_get_position()
803 if (bound_pos >= azx_dev->core.bufsize) in azx_via_get_position()
1912 struct azx_dev *azx_dev = get_azx_dev(substream); in substream_alloc_pages() local
1915 mark_runtime_wc(chip, azx_dev, substream, false); in substream_alloc_pages()
1919 mark_runtime_wc(chip, azx_dev, substream, true); in substream_alloc_pages()
1926 struct azx_dev *azx_dev = get_azx_dev(substream); in substream_free_pages() local
1927 mark_runtime_wc(chip, azx_dev, substream, false); in substream_free_pages()