Merge pull request #176 from zhigang-wu/topic/fw-panic

Revert "dai: ignore data on capture stop"
diff --git a/src/audio/pipeline.c b/src/audio/pipeline.c
index 77a36e0..ee8cf68 100644
--- a/src/audio/pipeline.c
+++ b/src/audio/pipeline.c
@@ -204,13 +204,18 @@
 	case COMP_TRIGGER_PAUSE:
 	case COMP_TRIGGER_STOP:
 		pipeline_schedule_cancel(p);
+		p->status = COMP_STATE_PAUSED;
 		break;
+	case COMP_TRIGGER_RELEASE:
 	case COMP_TRIGGER_START:
 		p->xrun_bytes = 0;
 
 		/* playback pipelines need scheduled now, capture pipelines are
-		 * scheduled once their initial DMA period is filled by the DAI */
-		if (comp->params.direction == SOF_IPC_STREAM_PLAYBACK) {
+		 * scheduled once their initial DMA period is filled by the DAI
+		 * or in resume process
+		 */
+		if (comp->params.direction == SOF_IPC_STREAM_PLAYBACK ||
+		    p->status == COMP_STATE_PAUSED) {
 
 			/* pipelines are either scheduled by timers or DAI/DMA interrupts */
 			if (p->ipc_pipe.timer) {
@@ -221,22 +226,7 @@
 				pipeline_schedule_copy_idle(p);
 			}
 		}
-		break;
-	case COMP_TRIGGER_RELEASE:
-		p->xrun_bytes = 0;
-
-		/* in resume process, capture must be
-		 * scheduled to to avoid the xrun in DAI component
-		 */
-		if (p->ipc_pipe.timer) {
-			/* timer - schedule initial copy */
-			pipeline_schedule_copy(p, 0);
-		} else {
-			/* DAI - schedule initial
-			 * pipeline fill when next idle
-			 */
-			pipeline_schedule_copy_idle(p);
-		}
+		p->status = COMP_STATE_ACTIVE;
 		break;
 	case COMP_TRIGGER_SUSPEND:
 	case COMP_TRIGGER_RESUME:
@@ -632,6 +622,7 @@
 		component_prepare_buffers_upstream(dev, dev, NULL);
 	}
 
+	p->status = COMP_STATE_PREPARE;
 out:
 	spin_unlock_irq(&p->lock, flags);
 	return ret;
diff --git a/src/drivers/apl-ssp.c b/src/drivers/apl-ssp.c
index f3300d0..1dd1386 100644
--- a/src/drivers/apl-ssp.c
+++ b/src/drivers/apl-ssp.c
@@ -252,7 +252,9 @@
 
 	sscr0 |= SSCR0_MOD | SSCR0_ACS;
 
-	mdivc = 0x1;
+	mdivc = mn_reg_read(0x0);
+	mdivc |= 0x1;
+
 #ifdef CONFIG_CANNONLAKE
 	if (!config->ssp.mclk_rate || config->ssp.mclk_rate > F_24000_kHz) {
 		trace_ssp_error("eci");
diff --git a/src/platform/cannonlake/include/platform/platform.h b/src/platform/cannonlake/include/platform/platform.h
index 69b06e9..30f5580 100644
--- a/src/platform/cannonlake/include/platform/platform.h
+++ b/src/platform/cannonlake/include/platform/platform.h
@@ -116,7 +116,7 @@
 #define PLATFORM_DEFAULT_DELAY	12
 
 /* minimal L1 exit time in cycles */
-#define PLATFORM_FORCE_L1_EXIT_TIME	482
+#define PLATFORM_FORCE_L1_EXIT_TIME	985
 
 /* the SSP port fifo depth */
 #define SSP_FIFO_DEPTH		16