]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
ALSA: hda: Fix stream fifo_size initialization
authorCezary Rojewski <cezary.rojewski@intel.com>
Fri, 6 Oct 2023 10:28:56 +0000 (12:28 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 6 Oct 2023 12:30:19 +0000 (14:30 +0200)
SDxFIFOS register indicates the fifo size directly. There is no need to
modify the value after reading the register.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20231006102857.749143-3-cezary.rojewski@intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/hda/hdac_stream.c
sound/pci/hda/hda_intel.c

index a132108fba400d50069e4c9e745f474cb12acc07..a784fd77cd4bd4d61c8ee1e23bbab21173718142 100644 (file)
@@ -308,7 +308,7 @@ int snd_hdac_stream_setup(struct hdac_stream *azx_dev)
        if (ret)
                dev_dbg(bus->dev, "polling SD_FIFOSIZE 0x%04x failed: %d\n",
                        AZX_REG_SD_FIFOSIZE, ret);
-       azx_dev->fifo_size = snd_hdac_stream_readw(azx_dev, SD_FIFOSIZE) + 1;
+       azx_dev->fifo_size = snd_hdac_stream_readw(azx_dev, SD_FIFOSIZE);
 
        /* when LPIB delay correction gives a small negative value,
         * we ignore it; currently set the threshold statically to
index ca765ac4765f4a27b77f81f466b647a9699f068d..e19274fd990d98a906196e05ff6fc73a37336558 100644 (file)
@@ -806,7 +806,7 @@ static unsigned int azx_via_get_position(struct azx *chip,
        mod_dma_pos = le32_to_cpu(*azx_dev->core.posbuf);
        mod_dma_pos %= azx_dev->core.period_bytes;
 
-       fifo_size = azx_stream(azx_dev)->fifo_size - 1;
+       fifo_size = azx_stream(azx_dev)->fifo_size;
 
        if (azx_dev->insufficient) {
                /* Link position never gather than FIFO size */