had_write_register(intelhaddata, AUD_CONFIG, val);
}
-/* enable / disable the audio interface */
-static void had_enable_audio_int(struct snd_intelhad *ctx, bool enable)
+/* forcibly ACKs to both BUFFER_DONE and BUFFER_UNDERRUN interrupts */
+static void had_ack_irqs(struct snd_intelhad *ctx)
{
u32 status_reg;
- if (enable) {
- had_read_register(ctx, AUD_HDMI_STATUS, &status_reg);
- status_reg |= HDMI_AUDIO_BUFFER_DONE | HDMI_AUDIO_UNDERRUN;
- had_write_register(ctx, AUD_HDMI_STATUS, status_reg);
- had_read_register(ctx, AUD_HDMI_STATUS, &status_reg);
- }
+ had_read_register(ctx, AUD_HDMI_STATUS, &status_reg);
+ status_reg |= HDMI_AUDIO_BUFFER_DONE | HDMI_AUDIO_UNDERRUN;
+ had_write_register(ctx, AUD_HDMI_STATUS, status_reg);
+ had_read_register(ctx, AUD_HDMI_STATUS, &status_reg);
}
/* Reset buffer pointers */
intelhaddata->stream_info.running = true;
/* Enable Audio */
- had_enable_audio_int(intelhaddata, true);
+ had_ack_irqs(intelhaddata); /* FIXME: do we need this? */
had_enable_audio(substream, intelhaddata, true);
break;
intelhaddata->stream_info.running = false;
spin_unlock(&intelhaddata->had_spinlock);
/* Disable Audio */
- had_enable_audio_int(intelhaddata, false);
had_enable_audio(substream, intelhaddata, false);
/* Reset buffer pointers */
had_reset_audio(intelhaddata);
- had_enable_audio_int(intelhaddata, false);
break;
default:
}
/* Disable Audio */
- had_enable_audio_int(intelhaddata, false);
had_enable_audio(substream, intelhaddata, false);
intelhaddata->connected = false;
{
struct snd_intelhad *ctx = platform_get_drvdata(pdev);
- if (ctx->connected)
- had_enable_audio_int(ctx, false);
snd_card_free(ctx->card);
return 0;
}