Skip to content

Commit a14ae39

Browse files
kv2019ihenrikbrixandersen
authored andcommitted
driver: ssp: remove use of out-of-tree CONFIG_INTEL_MN
The SSP driver has odd dependency to outside definition of CONFIG_INTEL_NM. This is in practise tied to SSP hardware version and always enabled for SSP block version 1.0. Use the new SSP_IP_VER define to replace the CONFIG_INTEL_MN preprocssor checks. Also modify the board test case to remove the obsolete config setting. Signed-off-by: Kai Vehmanen <[email protected]>
1 parent 5b29fff commit a14ae39

File tree

4 files changed

+9
-17
lines changed

4 files changed

+9
-17
lines changed

drivers/dai/intel/ssp/ssp.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ static void dai_ssp_update_bits(struct dai_intel_ssp *dp, uint32_t reg, uint32_t
122122
sys_write32((sys_read32(dest) & (~mask)) | (val & mask), dest);
123123
}
124124

125-
#if CONFIG_INTEL_MN
125+
#if SSP_IP_VER == SSP_IP_VER_1_0
126126
static int dai_ssp_gcd(int a, int b)
127127
{
128128
int aux;
@@ -411,7 +411,7 @@ static void dai_ssp_mn_release_mclk(struct dai_intel_ssp *dp, uint32_t mclk_id)
411411
k_spin_unlock(&mp->lock, key);
412412
}
413413

414-
#if CONFIG_INTEL_MN
414+
#if SSP_IP_VER == SSP_IP_VER_1_0
415415
/**
416416
* \brief Finds valid M/(N * SCR) values for given frequencies.
417417
* \param[in] freq SSP clock frequency.
@@ -1156,7 +1156,7 @@ static void dai_ssp_mclk_disable_unprepare(struct dai_intel_ssp *dp)
11561156

11571157
static int dai_ssp_bclk_prepare_enable(struct dai_intel_ssp *dp)
11581158
{
1159-
#if !(CONFIG_INTEL_MN)
1159+
#if SSP_IP_VER != SSP_IP_VER_1_0
11601160
struct dai_intel_ssp_freq_table *ft = dai_get_ftable(dp);
11611161
#endif
11621162
struct dai_intel_ssp_plat_data *ssp_plat_data = dai_get_plat_data(dp);
@@ -1170,7 +1170,7 @@ static int dai_ssp_bclk_prepare_enable(struct dai_intel_ssp *dp)
11701170

11711171
sscr0 = sys_read32(dai_base(dp) + SSCR0);
11721172

1173-
#if CONFIG_INTEL_MN
1173+
#if SSP_IP_VER == SSP_IP_VER_1_0
11741174
bool need_ecs = false;
11751175
/* BCLK config */
11761176
ret = dai_ssp_mn_set_bclk(dp, dp->dai_index, ssp_plat_data->params.bclk_rate,
@@ -1191,12 +1191,10 @@ static int dai_ssp_bclk_prepare_enable(struct dai_intel_ssp *dp)
11911191
mdiv = ft[DAI_INTEL_SSP_DEFAULT_IDX].freq / ssp_plat_data->params.bclk_rate;
11921192
#endif
11931193

1194-
#if SSP_IP_VER < CONFIG_SOC_INTEL_ACE30
1195-
#if CONFIG_INTEL_MN
1194+
#if SSP_IP_VER == SSP_IP_VER_1_0
11961195
if (need_ecs) {
11971196
sscr0 |= SSCR0_ECS;
11981197
}
1199-
#endif
12001198
#endif
12011199

12021200
/* clock divisor is SCR + 1 */
@@ -1231,7 +1229,7 @@ static void dai_ssp_bclk_disable_unprepare(struct dai_intel_ssp *dp)
12311229
if (!(ssp_plat_data->clk_active & SSP_CLK_BCLK_ACTIVE)) {
12321230
return;
12331231
}
1234-
#if CONFIG_INTEL_MN
1232+
#if SSP_IP_VER == SSP_IP_VER_1_0
12351233
dai_ssp_mn_release_bclk(dp, ssp_plat_data->ssp_index);
12361234
#endif
12371235
ssp_plat_data->clk_active &= ~SSP_CLK_BCLK_ACTIVE;
@@ -2611,7 +2609,7 @@ static int dai_ssp_probe(struct dai_intel_ssp *dp)
26112609
dp->state[DAI_DIR_PLAYBACK] = DAI_STATE_READY;
26122610
dp->state[DAI_DIR_CAPTURE] = DAI_STATE_READY;
26132611

2614-
#if CONFIG_INTEL_MN
2612+
#if SSP_IP_VER == SSP_IP_VER_1_0
26152613
/* Reset M/N, power-gating functions need it */
26162614
dai_ssp_mn_reset_bclk_divider(dp, ssp_plat_data->ssp_index);
26172615
#endif

drivers/dai/intel/ssp/ssp.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
#error "Missing ssp definitions"
7777
#endif
7878

79-
#if CONFIG_INTEL_MN
79+
#if SSP_IP_VER == SSP_IP_VER_1_0
8080
/** \brief BCLKs can be driven by multiple sources - M/N or XTAL directly.
8181
* Even in the case of M/N, the actual clock source can be XTAL,
8282
* Audio cardinal clock (24.576) or 96 MHz PLL.
@@ -104,7 +104,7 @@ struct dai_intel_ssp_mn {
104104
int mclk_rate[DAI_INTEL_SSP_NUM_MCLK];
105105
int mclk_source_clock;
106106

107-
#if CONFIG_INTEL_MN
107+
#if SSP_IP_VER == SSP_IP_VER_1_0
108108
enum bclk_source bclk_sources[(CONFIG_DAI_INTEL_SSP_NUM_BASE +
109109
CONFIG_DAI_INTEL_SSP_NUM_EXT)];
110110
int bclk_source_mn_clock;

tests/boards/intel_adsp/ssp/Kconfig

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,3 @@
77
mainmenu "Dai SSP Test"
88

99
source "Kconfig.zephyr"
10-
11-
config INTEL_MN
12-
bool "Use mn divider"
13-
help
14-
Use MN divider.

tests/boards/intel_adsp/ssp/prj.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
CONFIG_ZTEST=y
22
CONFIG_DAI=y
3-
CONFIG_INTEL_MN=y
43
CONFIG_DMA_DW_HOST_MASK=1
54
CONFIG_HEAP_MEM_POOL_SIZE=512
65
CONFIG_PM=y

0 commit comments

Comments
 (0)