Lines Matching defs:azx_dev

577 static int azx_get_delay_from_lpib(struct azx *chip, struct azx_dev *azx_dev,
580 struct snd_pcm_substream *substream = azx_dev->core.substream;
582 unsigned int lpib_pos = azx_get_pos_lpib(chip, azx_dev);
590 if (delay >= azx_dev->core.delay_negative_threshold)
593 delay += azx_dev->core.bufsize;
596 if (delay >= azx_dev->core.period_bytes) {
599 delay, azx_dev->core.period_bytes);
608 static int azx_position_ok(struct azx *chip, struct azx_dev *azx_dev);
611 static int azx_position_check(struct azx *chip, struct azx_dev *azx_dev)
616 ok = azx_position_ok(chip, azx_dev);
618 azx_dev->irq_pending = 0;
622 azx_dev->irq_pending = 1;
642 static int azx_position_ok(struct azx *chip, struct azx_dev *azx_dev)
644 struct snd_pcm_substream *substream = azx_dev->core.substream;
658 wallclk = azx_readl(chip, WALLCLK) - azx_dev->core.start_wallclk;
659 if (wallclk < (azx_dev->core.period_wallclk * 2) / 3)
663 pos = chip->get_position[stream](chip, azx_dev);
665 pos = azx_get_pos_posbuf(chip, azx_dev);
673 pos = azx_get_pos_lpib(chip, azx_dev);
682 if (pos >= azx_dev->core.bufsize)
685 if (WARN_ONCE(!azx_dev->core.period_bytes,
686 "hda-intel: zero azx_dev->period_bytes"))
688 if (wallclk < (azx_dev->core.period_wallclk * 5) / 4 &&
689 pos % azx_dev->core.period_bytes > azx_dev->core.period_bytes / 2)
692 azx_dev->core.start_wallclk += wallclk;
694 if (azx_dev->core.no_period_wakeup)
736 struct azx_dev *azx_dev = stream_to_azx_dev(s);
737 if (!azx_dev->irq_pending ||
741 ok = azx_position_ok(chip, azx_dev);
743 azx_dev->irq_pending = 0;
767 struct azx_dev *azx_dev = stream_to_azx_dev(s);
768 azx_dev->irq_pending = 0;
795 struct azx_dev *azx_dev)
801 link_pos = snd_hdac_stream_get_pos_lpib(azx_stream(azx_dev));
802 if (azx_dev->core.substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
811 mod_dma_pos = le32_to_cpu(*azx_dev->core.posbuf);
812 mod_dma_pos %= azx_dev->core.period_bytes;
814 fifo_size = azx_stream(azx_dev)->fifo_size;
816 if (azx_dev->insufficient) {
821 azx_dev->insufficient = 0;
825 mini_pos = azx_dev->core.bufsize + link_pos - fifo_size;
830 mod_mini_pos = mini_pos % azx_dev->core.period_bytes;
831 mod_link_pos = link_pos % azx_dev->core.period_bytes;
837 bound_pos = mini_pos - mod_mini_pos + azx_dev->core.period_bytes;
838 if (bound_pos >= azx_dev->core.bufsize)
849 static unsigned int azx_get_pos_fifo(struct azx *chip, struct azx_dev *azx_dev)
851 struct snd_pcm_substream *substream = azx_dev->core.substream;
855 pos = snd_hdac_stream_get_pos_lpib(azx_stream(azx_dev));
861 if (azx_dev->insufficient) {
866 azx_dev->insufficient = 0;
873 pos += azx_dev->core.bufsize;
880 static int azx_get_delay_from_fifo(struct azx *chip, struct azx_dev *azx_dev,
883 struct snd_pcm_substream *substream = azx_dev->core.substream;