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

Commit 775bc971 authored by Jassi Brar's avatar Jassi Brar Committed by Mark Brown
Browse files

ASoC: Samsung: I2S: Flush FIFO after stop



Flush the FIFO while stopping the channel rather than starting.
This saves time during stream start and keeps the FIFOs clean
when the channel is idling.

Signed-off-by: default avatarJassi Brar <jassi.brar@samsung.com>
Acked-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 6ce534aa
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -843,11 +843,6 @@ static int i2s_trigger(struct snd_pcm_substream *substream,
	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
		local_irq_save(flags);
		local_irq_save(flags);


		if (capture)
			i2s_fifo(i2s, FIC_RXFLUSH);
		else
			i2s_fifo(i2s, FIC_TXFLUSH);

		if (config_setup(i2s)) {
		if (config_setup(i2s)) {
			local_irq_restore(flags);
			local_irq_restore(flags);
			return -EINVAL;
			return -EINVAL;
@@ -870,6 +865,11 @@ static int i2s_trigger(struct snd_pcm_substream *substream,
		else
		else
			i2s_txctrl(i2s, 0);
			i2s_txctrl(i2s, 0);


		if (capture)
			i2s_fifo(i2s, FIC_RXFLUSH);
		else
			i2s_fifo(i2s, FIC_TXFLUSH);

		local_irq_restore(flags);
		local_irq_restore(flags);
		break;
		break;
	}
	}