@@ -48,6 +48,8 @@ EXPORT_SYMBOL_GPL(snd_hdac_stream_init);
void snd_hdac_stream_start(struct hdac_stream *azx_dev, bool fresh_start)
{
struct hdac_bus *bus = azx_dev->bus;
+ int timeout = 300;
+ unsigned char val;
trace_snd_hdac_stream_start(bus, azx_dev);
@@ -60,6 +62,20 @@ void snd_hdac_stream_start(struct hdac_stream *azx_dev, bool fresh_start)
/* set DMA start and interrupt mask */
snd_hdac_stream_updateb(azx_dev, SD_CTL,
0, SD_CTL_DMA_START | SD_INT_MASK);
+
+ do {
+ udelay(3);
+ val = snd_hdac_stream_readb(azx_dev, SD_CTL) & SD_CTL_DMA_START;
+ if (val)
+ break;
+ } while (--timeout);
+
+ if (!timeout) {
+ azx_dev->running = false;
+ dev_err(azx_dev->bus->dev, "unable to start the stream\n");
+ return;
+ }
+
azx_dev->running = true;
}
EXPORT_SYMBOL_GPL(snd_hdac_stream_start);