Lines Matching refs:azx_dev

619 static int azx_get_delay_from_lpib(struct azx *chip, struct azx_dev *azx_dev,
622 struct snd_pcm_substream *substream = azx_dev->core.substream;
624 unsigned int lpib_pos = azx_get_pos_lpib(chip, azx_dev);
632 if (delay >= azx_dev->core.delay_negative_threshold)
635 delay += azx_dev->core.bufsize;
638 if (delay >= azx_dev->core.period_bytes) {
641 delay, azx_dev->core.period_bytes);
650 static int azx_position_ok(struct azx *chip, struct azx_dev *azx_dev);
653 static int azx_position_check(struct azx *chip, struct azx_dev *azx_dev)
658 ok = azx_position_ok(chip, azx_dev);
660 azx_dev->irq_pending = 0;
664 azx_dev->irq_pending = 1;
684 static int azx_position_ok(struct azx *chip, struct azx_dev *azx_dev)
686 struct snd_pcm_substream *substream = azx_dev->core.substream;
693 wallclk = azx_readl(chip, WALLCLK) - azx_dev->core.start_wallclk;
694 if (wallclk < (azx_dev->core.period_wallclk * 2) / 3)
698 pos = chip->get_position[stream](chip, azx_dev);
700 pos = azx_get_pos_posbuf(chip, azx_dev);
708 pos = azx_get_pos_lpib(chip, azx_dev);
717 if (pos >= azx_dev->core.bufsize)
720 if (WARN_ONCE(!azx_dev->core.period_bytes,
721 "hda-intel: zero azx_dev->period_bytes"))
723 if (wallclk < (azx_dev->core.period_wallclk * 5) / 4 &&
724 pos % azx_dev->core.period_bytes > azx_dev->core.period_bytes / 2)
727 azx_dev->core.start_wallclk += wallclk;
729 if (azx_dev->core.no_period_wakeup)
771 struct azx_dev *azx_dev = stream_to_azx_dev(s);
772 if (!azx_dev->irq_pending ||
776 ok = azx_position_ok(chip, azx_dev);
778 azx_dev->irq_pending = 0;
802 struct azx_dev *azx_dev = stream_to_azx_dev(s);
803 azx_dev->irq_pending = 0;
830 struct azx_dev *azx_dev)
836 link_pos = snd_hdac_stream_get_pos_lpib(azx_stream(azx_dev));
837 if (azx_dev->core.substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
846 mod_dma_pos = le32_to_cpu(*azx_dev->core.posbuf);
847 mod_dma_pos %= azx_dev->core.period_bytes;
849 fifo_size = azx_stream(azx_dev)->fifo_size - 1;
851 if (azx_dev->insufficient) {
856 azx_dev->insufficient = 0;
860 mini_pos = azx_dev->core.bufsize + link_pos - fifo_size;
865 mod_mini_pos = mini_pos % azx_dev->core.period_bytes;
866 mod_link_pos = link_pos % azx_dev->core.period_bytes;
872 bound_pos = mini_pos - mod_mini_pos + azx_dev->core.period_bytes;
873 if (bound_pos >= azx_dev->core.bufsize)
884 static unsigned int azx_get_pos_fifo(struct azx *chip, struct azx_dev *azx_dev)
886 struct snd_pcm_substream *substream = azx_dev->core.substream;
890 pos = snd_hdac_stream_get_pos_lpib(azx_stream(azx_dev));
896 if (azx_dev->insufficient) {
901 azx_dev->insufficient = 0;
908 pos += azx_dev->core.bufsize;
915 static int azx_get_delay_from_fifo(struct azx *chip, struct azx_dev *azx_dev,
918 struct snd_pcm_substream *substream = azx_dev->core.substream;