Commit d0e9b1a2 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: x86: Drop flag_underrun field

The flag_underrun flag is used to indicate to escalate the XRUN
reporting at the next position inquiry, but there is a much simpler
method to achieve it: just call snd_pcm_stop_xrun().
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 8f8d1d7f
...@@ -1297,11 +1297,6 @@ static snd_pcm_uframes_t snd_intelhad_pcm_pointer( ...@@ -1297,11 +1297,6 @@ static snd_pcm_uframes_t snd_intelhad_pcm_pointer(
if (intelhaddata->drv_status == HAD_DRV_DISCONNECTED) if (intelhaddata->drv_status == HAD_DRV_DISCONNECTED)
return SNDRV_PCM_POS_XRUN; return SNDRV_PCM_POS_XRUN;
if (intelhaddata->flag_underrun) {
intelhaddata->flag_underrun = false;
return SNDRV_PCM_POS_XRUN;
}
/* Use a hw register to calculate sub-period position reports. /* Use a hw register to calculate sub-period position reports.
* This makes PulseAudio happier. * This makes PulseAudio happier.
*/ */
...@@ -1642,8 +1637,7 @@ static int had_process_buffer_underrun(struct snd_intelhad *intelhaddata) ...@@ -1642,8 +1637,7 @@ static int had_process_buffer_underrun(struct snd_intelhad *intelhaddata)
if (stream_type == HAD_RUNNING_STREAM) { if (stream_type == HAD_RUNNING_STREAM) {
/* Report UNDERRUN error to above layers */ /* Report UNDERRUN error to above layers */
intelhaddata->flag_underrun = true; snd_pcm_stop_xrun(stream->had_substream);
had_period_elapsed(stream->had_substream);
} }
return 0; return 0;
...@@ -1965,7 +1959,6 @@ static int hdmi_lpe_audio_probe(struct platform_device *pdev) ...@@ -1965,7 +1959,6 @@ static int hdmi_lpe_audio_probe(struct platform_device *pdev)
ctx->drv_status = HAD_DRV_DISCONNECTED; ctx->drv_status = HAD_DRV_DISCONNECTED;
ctx->dev = &pdev->dev; ctx->dev = &pdev->dev;
ctx->card = card; ctx->card = card;
ctx->flag_underrun = false;
ctx->aes_bits = SNDRV_PCM_DEFAULT_CON_SPDIF; ctx->aes_bits = SNDRV_PCM_DEFAULT_CON_SPDIF;
strcpy(card->driver, INTEL_HAD); strcpy(card->driver, INTEL_HAD);
strcpy(card->shortname, INTEL_HAD); strcpy(card->shortname, INTEL_HAD);
......
...@@ -123,7 +123,6 @@ struct snd_intelhad { ...@@ -123,7 +123,6 @@ struct snd_intelhad {
enum intel_had_aud_buf_type curr_buf; enum intel_had_aud_buf_type curr_buf;
int valid_buf_cnt; int valid_buf_cnt;
unsigned int aes_bits; unsigned int aes_bits;
bool flag_underrun;
struct had_stream_data stream_data; struct had_stream_data stream_data;
spinlock_t had_spinlock; spinlock_t had_spinlock;
enum intel_had_aud_buf_type buff_done; enum intel_had_aud_buf_type buff_done;
......
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