Commit 942ccdd8 authored by Yanteng Si's avatar Yanteng Si Committed by Takashi Iwai

ALSA: hda: Workaround for SDnCTL register on loongson

On loongson controller, after calling snd_hdac_stream_updateb()
to enable DMA engine, the SDnCTL.STRM will become to zero.  We
need to access SDnCTL in dword to keep SDnCTL.STRM is not changed.
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/27aeddf5ebbe7c69631cec0e489c1b264be94990.1686128807.git.siyanteng@loongson.cnSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent cbc3e98a
...@@ -348,6 +348,7 @@ struct hdac_bus { ...@@ -348,6 +348,7 @@ struct hdac_bus {
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 */ bool not_use_interrupts:1; /* prohibiting the RIRB IRQ */
bool access_sdnctl_in_dword:1; /* accessing the sdnctl register by dword */
int poll_count; int poll_count;
......
...@@ -150,6 +150,10 @@ void snd_hdac_stream_start(struct hdac_stream *azx_dev) ...@@ -150,6 +150,10 @@ void snd_hdac_stream_start(struct hdac_stream *azx_dev)
stripe_ctl); stripe_ctl);
} }
/* set DMA start and interrupt mask */ /* set DMA start and interrupt mask */
if (bus->access_sdnctl_in_dword)
snd_hdac_stream_updatel(azx_dev, SD_CTL,
0, SD_CTL_DMA_START | SD_INT_MASK);
else
snd_hdac_stream_updateb(azx_dev, SD_CTL, snd_hdac_stream_updateb(azx_dev, SD_CTL,
0, SD_CTL_DMA_START | SD_INT_MASK); 0, SD_CTL_DMA_START | SD_INT_MASK);
azx_dev->running = true; azx_dev->running = true;
......
...@@ -1878,6 +1878,7 @@ static int azx_first_init(struct azx *chip) ...@@ -1878,6 +1878,7 @@ static int azx_first_init(struct azx *chip)
if (chip->driver_type == AZX_DRIVER_LOONGSON) { if (chip->driver_type == AZX_DRIVER_LOONGSON) {
bus->polling_mode = 1; bus->polling_mode = 1;
bus->not_use_interrupts = 1; bus->not_use_interrupts = 1;
bus->access_sdnctl_in_dword = 1;
} }
err = pcim_iomap_regions(pci, 1 << 0, "ICH HD audio"); err = pcim_iomap_regions(pci, 1 << 0, "ICH HD audio");
......
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