Commit cbc3e98a authored by Yanteng Si's avatar Yanteng Si Committed by Takashi Iwai

ALSA: hda: Using polling mode for loongson controller by default

On loongson controller, RIRBSTS.RINTFL cannot be cleared,
azx_interrupt() is called all the time. We disable RIRB
interrupt, and use polling mode by default.
Signed-off-by: default avatarYanteng Si <siyanteng@loongson.cn>
Signed-off-by: default avatarYingkun Meng <mengyingkun@loongson.cn>
Acked-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
Link: https://lore.kernel.org/r/d309a75424d438b958d90d797b4f1ba45468e090.1686128807.git.siyanteng@loongson.cnSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 28bd137a
...@@ -347,6 +347,7 @@ struct hdac_bus { ...@@ -347,6 +347,7 @@ struct hdac_bus {
bool corbrp_self_clear:1; /* CORBRP clears itself after reset */ bool corbrp_self_clear:1; /* CORBRP clears itself after reset */
bool polling_mode:1; bool polling_mode:1;
bool needs_damn_long_delay:1; bool needs_damn_long_delay:1;
bool not_use_interrupts:1; /* prohibiting the RIRB IRQ */
int poll_count; int poll_count;
......
...@@ -79,7 +79,10 @@ void snd_hdac_bus_init_cmd_io(struct hdac_bus *bus) ...@@ -79,7 +79,10 @@ void snd_hdac_bus_init_cmd_io(struct hdac_bus *bus)
/* set N=1, get RIRB response interrupt for new entry */ /* set N=1, get RIRB response interrupt for new entry */
snd_hdac_chip_writew(bus, RINTCNT, 1); snd_hdac_chip_writew(bus, RINTCNT, 1);
/* enable rirb dma and response irq */ /* enable rirb dma and response irq */
snd_hdac_chip_writeb(bus, RIRBCTL, AZX_RBCTL_DMA_EN | AZX_RBCTL_IRQ_EN); if (bus->not_use_interrupts)
snd_hdac_chip_writeb(bus, RIRBCTL, AZX_RBCTL_DMA_EN);
else
snd_hdac_chip_writeb(bus, RIRBCTL, AZX_RBCTL_DMA_EN | AZX_RBCTL_IRQ_EN);
/* Accept unsolicited responses */ /* Accept unsolicited responses */
snd_hdac_chip_updatel(bus, GCTL, AZX_GCTL_UNSOL, AZX_GCTL_UNSOL); snd_hdac_chip_updatel(bus, GCTL, AZX_GCTL_UNSOL, AZX_GCTL_UNSOL);
spin_unlock_irq(&bus->reg_lock); spin_unlock_irq(&bus->reg_lock);
......
...@@ -1875,6 +1875,11 @@ static int azx_first_init(struct azx *chip) ...@@ -1875,6 +1875,11 @@ static int azx_first_init(struct azx *chip)
if (chip->driver_type == AZX_DRIVER_GFHDMI) if (chip->driver_type == AZX_DRIVER_GFHDMI)
bus->polling_mode = 1; bus->polling_mode = 1;
if (chip->driver_type == AZX_DRIVER_LOONGSON) {
bus->polling_mode = 1;
bus->not_use_interrupts = 1;
}
err = pcim_iomap_regions(pci, 1 << 0, "ICH HD audio"); err = pcim_iomap_regions(pci, 1 << 0, "ICH HD audio");
if (err < 0) if (err < 0)
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment