Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e8de9859 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ALSA: x86: Allow no-period-wakeup setup



In the current implementation, the driver may update the BDs even at
PCM pointer callback.  This allows us to skip the period interrupt
effectively.

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 8d48c016
Loading
Loading
Loading
Loading
+5 −2
Original line number Original line Diff line number Diff line
@@ -133,7 +133,8 @@ static const struct channel_map_table map_tables[] = {
static const struct snd_pcm_hardware had_pcm_hardware = {
static const struct snd_pcm_hardware had_pcm_hardware = {
	.info =	(SNDRV_PCM_INFO_INTERLEAVED |
	.info =	(SNDRV_PCM_INFO_INTERLEAVED |
		SNDRV_PCM_INFO_MMAP |
		SNDRV_PCM_INFO_MMAP |
		SNDRV_PCM_INFO_MMAP_VALID),
		SNDRV_PCM_INFO_MMAP_VALID |
		SNDRV_PCM_INFO_NO_PERIOD_WAKEUP),
	.formats = SNDRV_PCM_FMTBIT_S24,
	.formats = SNDRV_PCM_FMTBIT_S24,
	.rates = SNDRV_PCM_RATE_32000 |
	.rates = SNDRV_PCM_RATE_32000 |
		SNDRV_PCM_RATE_44100 |
		SNDRV_PCM_RATE_44100 |
@@ -840,7 +841,9 @@ static void had_prog_bd(struct snd_pcm_substream *substream,
	int ofs = intelhaddata->pcmbuf_filled * intelhaddata->period_bytes;
	int ofs = intelhaddata->pcmbuf_filled * intelhaddata->period_bytes;
	u32 addr = substream->runtime->dma_addr + ofs;
	u32 addr = substream->runtime->dma_addr + ofs;


	addr |= AUD_BUF_VALID | AUD_BUF_INTR_EN;
	addr |= AUD_BUF_VALID;
	if (!substream->runtime->no_period_wakeup)
		addr |= AUD_BUF_INTR_EN;
	had_write_register(intelhaddata, AUD_BUF_ADDR(idx), addr);
	had_write_register(intelhaddata, AUD_BUF_ADDR(idx), addr);
	had_write_register(intelhaddata, AUD_BUF_LEN(idx),
	had_write_register(intelhaddata, AUD_BUF_LEN(idx),
			   intelhaddata->period_bytes);
			   intelhaddata->period_bytes);