[Sound-open-firmware] [PATCH] apl: probe all SSP ports in platform init

Liam Girdwood liam.r.girdwood at linux.intel.com
Tue Mar 6 16:02:01 CET 2018


Fix. We must probe all our SSP ports in platform init.

Signed-off-by: Liam Girdwood <liam.r.girdwood at linux.intel.com>
---
 src/platform/apollolake/dai.c                       |  3 ++-
 src/platform/apollolake/include/platform/platform.h |  3 +++
 src/platform/apollolake/platform.c                  | 14 +++++++++-----
 3 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/src/platform/apollolake/dai.c b/src/platform/apollolake/dai.c
index 6149d26..7c2aaa9 100644
--- a/src/platform/apollolake/dai.c
+++ b/src/platform/apollolake/dai.c
@@ -34,6 +34,7 @@
 #include <reef/ssp.h>
 #include <reef/stream.h>
 #include <reef/audio/component.h>
+#include <platform/platform.h>
 #include <platform/memory.h>
 #include <platform/interrupt.h>
 #include <platform/dma.h>
@@ -41,7 +42,7 @@
 #include <string.h>
 #include <config.h>
 
-static struct dai ssp[6] = {
+static struct dai ssp[PLATFORM_NUM_SSP] = {
 {
 	.type = SOF_DAI_INTEL_SSP,
 	.index = 0,
diff --git a/src/platform/apollolake/include/platform/platform.h b/src/platform/apollolake/include/platform/platform.h
index 995efca..8a84308 100644
--- a/src/platform/apollolake/include/platform/platform.h
+++ b/src/platform/apollolake/include/platform/platform.h
@@ -109,6 +109,9 @@ struct reef;
 /* platform has low power memory type */
 #define PLATFORM_MEM_HAS_LP_RAM
 
+/* number of SSP ports in platform */
+#define PLATFORM_NUM_SSP	6
+
 /* Platform defined panic code */
 #define platform_panic(__x) \
 	sw_reg_write(SRAM_REG_FW_STATUS, (0xdead000 | __x) & 0x3fffffff)
diff --git a/src/platform/apollolake/platform.c b/src/platform/apollolake/platform.c
index ae8a854..9574970 100644
--- a/src/platform/apollolake/platform.c
+++ b/src/platform/apollolake/platform.c
@@ -178,7 +178,8 @@ static void platform_memory_windows_init(void)
 int platform_init(struct reef *reef)
 {
 	struct dma *dmac;
-	struct dai *ssp2;
+	struct dai *ssp;
+	int i;
 
 	platform_interrupt_init();
 
@@ -254,9 +255,12 @@ int platform_init(struct reef *reef)
 
 	/* init SSP ports */
 	trace_point(TRACE_BOOT_PLATFORM_SSP);
-	ssp2 = dai_get(SOF_DAI_INTEL_SSP, 4);
-	if (ssp2 == NULL)
-		return -ENODEV;
-	dai_probe(ssp2);
+	for (i = 0; i < PLATFORM_NUM_SSP; i++) {
+		ssp = dai_get(SOF_DAI_INTEL_SSP, i);
+		if (ssp == NULL)
+			return -ENODEV;
+		dai_probe(ssp);
+	}
+
 	return 0;
 }
-- 
2.14.1



More information about the Sound-open-firmware mailing list