Skip to content

Commit e678264

Browse files
Yanteng Sichenhuacai
Yanteng Si
authored andcommitted
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: Yanteng Si <[email protected]> Yingkun Meng <[email protected]> Signed-off-by: Huacai Chen <[email protected]>
1 parent b39abd8 commit e678264

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

include/sound/hdaudio.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ struct hdac_bus {
348348
bool polling_mode:1;
349349
bool needs_damn_long_delay:1;
350350
bool not_use_interrupts:1; /* prohibiting the RIRB IRQ */
351+
bool access_sdnctl_in_dword:1; /* accessing the sdnctl register by dword */
351352

352353
int poll_count;
353354

sound/hda/hdac_stream.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,11 @@ void snd_hdac_stream_start(struct hdac_stream *azx_dev)
150150
stripe_ctl);
151151
}
152152
/* set DMA start and interrupt mask */
153-
snd_hdac_stream_updateb(azx_dev, SD_CTL,
153+
if (bus->access_sdnctl_in_dword)
154+
snd_hdac_stream_updatel(azx_dev, SD_CTL,
155+
0, SD_CTL_DMA_START | SD_INT_MASK);
156+
else
157+
snd_hdac_stream_updateb(azx_dev, SD_CTL,
154158
0, SD_CTL_DMA_START | SD_INT_MASK);
155159
azx_dev->running = true;
156160
}

sound/pci/hda/hda_intel.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1878,6 +1878,7 @@ static int azx_first_init(struct azx *chip)
18781878
if (chip->driver_type == AZX_DRIVER_LOONGSON) {
18791879
bus->polling_mode = 1;
18801880
bus->not_use_interrupts = 1;
1881+
bus->access_sdnctl_in_dword = 1;
18811882
}
18821883

18831884
err = pcim_iomap_regions(pci, 1 << 0, "ICH HD audio");

0 commit comments

Comments
 (0)