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

Commit 8937fd88 authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela
Browse files

[ALSA] pcxhr - Fix the sample rate changes



Modules: Digigram PCXHR driver

Fix the hardware set up when the sample rate is changed multiple times.

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent d2981393
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -744,13 +744,14 @@ static int pcxhr_prepare(struct snd_pcm_substream *subs)
		/* only the first stream can choose the sample rate */
		/* the further opened streams will be limited to its frequency (see open) */
		/* set the clock only once (first stream) */
		if (mgr->sample_rate == 0) {
		if (mgr->sample_rate != subs->runtime->rate) {
			err = pcxhr_set_clock(mgr, subs->runtime->rate);
			if (err)
				break;
			if (mgr->sample_rate == 0)
				/* start the DSP-timer */
				err = pcxhr_hardware_timer(mgr, 1);
			mgr->sample_rate = subs->runtime->rate;

			err = pcxhr_hardware_timer(mgr, 1);	/* start the DSP-timer */
		}
	} while(0);	/* do only once (so we can use break instead of goto) */