[Sound-open-firmware] [PATCH 1/3] DAI: Check DAI type in dai_get() in APL platform
Signed-off-by: Seppo Ingalsuo seppo.ingalsuo@linux.intel.com --- src/platform/apollolake/dai.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/platform/apollolake/dai.c b/src/platform/apollolake/dai.c index 7e5da44..42d7393 100644 --- a/src/platform/apollolake/dai.c +++ b/src/platform/apollolake/dai.c @@ -150,9 +150,13 @@ struct dai *dai_get(uint32_t type, uint32_t index) { int i;
- for (i = 0; i < ARRAY_SIZE(ssp); i++) { - if (ssp[i].type == type && ssp[i].index == index) - return &ssp[i]; + if (type == SOF_DAI_INTEL_SSP) { + for (i = 0; i < ARRAY_SIZE(ssp); i++) { + if (ssp[i].type == type && ssp[i].index == index) + return &ssp[i]; + } + } + }
return NULL;
Signed-off-by: Seppo Ingalsuo seppo.ingalsuo@linux.intel.com --- src/platform/cannonlake/dai.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/platform/cannonlake/dai.c b/src/platform/cannonlake/dai.c index 6b2db36..5a79614 100644 --- a/src/platform/cannonlake/dai.c +++ b/src/platform/cannonlake/dai.c @@ -99,9 +99,12 @@ struct dai *dai_get(uint32_t type, uint32_t index) { int i;
- for (i = 0; i < ARRAY_SIZE(ssp); i++) { - if (ssp[i].type == type && ssp[i].index == index) - return &ssp[i]; + if (type == SOF_DAI_INTEL_SSP) { + for (i = 0; i < ARRAY_SIZE(ssp); i++) { + if (ssp[i].type == type && ssp[i].index == index) + return &ssp[i]; + } + } }
return NULL;
The macro doesn't use the parameter x so better to remove it.
Signed-off-by: Seppo Ingalsuo seppo.ingalsuo@linux.intel.com --- src/platform/apollolake/include/platform/shim.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/platform/apollolake/include/platform/shim.h b/src/platform/apollolake/include/platform/shim.h index c7fcc8f..daff826 100644 --- a/src/platform/apollolake/include/platform/shim.h +++ b/src/platform/apollolake/include/platform/shim.h @@ -123,7 +123,7 @@
/* LP GPDMA Force Dynamic Clock Gating bits, 0--enable */ #define SHIM_CLKCTL_LPGPDMAFDCGB(x) (0x1 << (26 + x)) -#define SHIM_CLKCTL_DMICFDCGB(x) (0x1 << 24) +#define SHIM_CLKCTL_DMICFDCGB (0x1 << 24) #define SHIM_CLKCTL_I2SFDCGB(x) (0x1 << (20 + x)) #define SHIM_CLKCTL_I2SEFDCGB(x) (0x1 << (18 + x)) #define SHIM_CLKCTL_TCPLCG(x) (0x1 << (16 + x))
participants (1)
-
Seppo Ingalsuo