[Sound-open-firmware] [PATCH 1/5] ssp: rename clk_id as mclk_id, remove dead code
Pierre-Louis Bossart
pierre-louis.bossart at linux.intel.com
Mon Jun 18 21:27:30 CEST 2018
clk_id was never used so remove all the related code.
However since we need an identifier for the mclk
reclaim it with a name change.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart at linux.intel.com>
---
src/drivers/apl-ssp.c | 25 +------------------------
src/drivers/byt-ssp.c | 25 -------------------------
src/drivers/hsw-ssp.c | 25 -------------------------
src/include/uapi/ipc.h | 2 +-
4 files changed, 2 insertions(+), 75 deletions(-)
diff --git a/src/drivers/apl-ssp.c b/src/drivers/apl-ssp.c
index 6571b90..03360cb 100644
--- a/src/drivers/apl-ssp.c
+++ b/src/drivers/apl-ssp.c
@@ -233,30 +233,7 @@ static inline int ssp_set_config(struct dai *dai,
goto out;
}
-#ifdef CLK_TYPE /* not enabled, keep the code for reference */
- /* TODO: allow topology to define SSP clock type */
- config->ssp.clk_id = SSP_CLK_EXT;
-
- /* clock source */
- switch (config->ssp.clk_id) {
- case SSP_CLK_AUDIO:
- sscr0 |= SSCR0_ACS;
- break;
- case SSP_CLK_NET_PLL:
- sscr0 |= SSCR0_MOD;
- break;
- case SSP_CLK_EXT:
- sscr0 |= SSCR0_ECS;
- break;
- case SSP_CLK_NET:
- sscr0 |= SSCR0_NCS | SSCR0_MOD;
- break;
- default:
- trace_ssp_error("ec4");
- ret = -EINVAL;
- goto out;
- }
-#elif CONFIG_APOLLOLAKE
+if CONFIG_APOLLOLAKE
sscr0 |= SSCR0_MOD | SSCR0_ACS | SSCR0_ECS;
#else
sscr0 |= SSCR0_MOD | SSCR0_ACS;
diff --git a/src/drivers/byt-ssp.c b/src/drivers/byt-ssp.c
index d058c5f..0119f8d 100644
--- a/src/drivers/byt-ssp.c
+++ b/src/drivers/byt-ssp.c
@@ -239,31 +239,6 @@ static inline int ssp_set_config(struct dai *dai,
goto out;
}
-#ifdef CLK_TYPE /* not enabled, keep the code for reference */
- /* TODO: allow topology to define SSP clock type */
- config->ssp.clk_id = SSP_CLK_EXT;
-
- /* clock source */
- switch (config->ssp.clk_id) {
- case SSP_CLK_AUDIO:
- sscr0 |= SSCR0_ACS;
- break;
- case SSP_CLK_NET_PLL:
- sscr0 |= SSCR0_MOD;
- break;
- case SSP_CLK_EXT:
- sscr0 |= SSCR0_ECS;
- break;
- case SSP_CLK_NET:
- sscr0 |= SSCR0_NCS | SSCR0_MOD;
- break;
- default:
- trace_ssp_error("ec4");
- ret = -EINVAL;
- goto out;
- }
-#endif
-
/* BCLK is generated from MCLK - must be divisable */
if (config->ssp.mclk_rate % config->ssp.bclk_rate) {
trace_ssp_error("ec5");
diff --git a/src/drivers/hsw-ssp.c b/src/drivers/hsw-ssp.c
index 0d74e7d..479ae27 100644
--- a/src/drivers/hsw-ssp.c
+++ b/src/drivers/hsw-ssp.c
@@ -172,31 +172,6 @@ static inline int ssp_set_config(struct dai *dai,
goto out;
}
-#ifdef CLK_TYPE /* not enabled, keep the code for reference */
- /* TODO: allow topology to define SSP clock type */
- config->ssp.clk_id = SSP_CLK_EXT;
-
- /* clock source */
- switch (config->ssp.clk_id) {
- case SSP_CLK_AUDIO:
- sscr0 |= SSCR0_ACS;
- break;
- case SSP_CLK_NET_PLL:
- sscr0 |= SSCR0_MOD;
- break;
- case SSP_CLK_EXT:
- sscr0 |= SSCR0_ECS;
- break;
- case SSP_CLK_NET:
- sscr0 |= SSCR0_NCS | SSCR0_MOD;
- break;
- default:
- trace_ssp_error("ec4");
- ret = -EINVAL;
- goto out;
- }
-#endif
-
/* BCLK is generated from MCLK - must be divisable */
if (config->ssp.mclk_rate % config->ssp.bclk_rate) {
trace_ssp_error("ec5");
diff --git a/src/include/uapi/ipc.h b/src/include/uapi/ipc.h
index 88de113..aa48631 100644
--- a/src/include/uapi/ipc.h
+++ b/src/include/uapi/ipc.h
@@ -237,7 +237,7 @@ enum sof_ipc_dai_type {
/* SSP Configuration Request - SOF_IPC_DAI_SSP_CONFIG */
struct sof_ipc_dai_ssp_params {
uint16_t mode; // FIXME: do we need this?
- uint16_t clk_id; // FIXME: do we need this?
+ uint16_t mclk_id;
uint32_t mclk_rate; /* mclk frequency in Hz */
uint32_t fsync_rate; /* fsync frequency in Hz */
--
2.14.1
More information about the Sound-open-firmware
mailing list