Skip to content

Commit d5ac86b

Browse files
committed
tests: drivers: i2s: Replace deprecated I2S option macros
- I2S_OPT_BIT_CLK_MASTER with I2S_OPT_BIT_CLK_CONTROLLER - I2S_OPT_BIT_CLK_SLAVE with I2S_OPT_BIT_CLK_TARGET - I2S_OPT_FRAME_CLK_MASTER with I2S_OPT_FRAME_CLK_CONTROLLER - I2S_OPT_FRAME_CLK_SLAVE with I2S_OPT_FRAME_CLK_TARGET Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
1 parent 8c48b62 commit d5ac86b

8 files changed

Lines changed: 28 additions & 28 deletions

File tree

tests/benchmarks/i2s_freq/src/main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,12 @@ static int configure_stream(const struct device *dev_i2s, enum i2s_dir dir, uint
141141

142142
if (dir == I2S_DIR_TX) {
143143
/* Configure the Transmit port as Master */
144-
i2s_cfg.options = I2S_OPT_FRAME_CLK_MASTER | I2S_OPT_BIT_CLK_MASTER;
144+
i2s_cfg.options = I2S_OPT_FRAME_CLK_CONTROLLER | I2S_OPT_BIT_CLK_CONTROLLER;
145145
} else if (dir == I2S_DIR_RX) {
146146
/* Configure the Receive port as Slave */
147-
i2s_cfg.options = I2S_OPT_FRAME_CLK_SLAVE | I2S_OPT_BIT_CLK_SLAVE;
147+
i2s_cfg.options = I2S_OPT_FRAME_CLK_TARGET | I2S_OPT_BIT_CLK_TARGET;
148148
} else { /* dir == I2S_DIR_BOTH */
149-
i2s_cfg.options = I2S_OPT_FRAME_CLK_MASTER | I2S_OPT_BIT_CLK_MASTER;
149+
i2s_cfg.options = I2S_OPT_FRAME_CLK_CONTROLLER | I2S_OPT_BIT_CLK_CONTROLLER;
150150
}
151151

152152
if (dir == I2S_DIR_TX || dir == I2S_DIR_BOTH) {

tests/benchmarks/peripheral_load/src/i2s_thread.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ static int configure_stream(const struct device *dev_i2s, enum i2s_dir dir)
6565

6666
if (dir == I2S_DIR_TX) {
6767
/* Configure the Transmit port as Master */
68-
i2s_cfg.options = I2S_OPT_FRAME_CLK_MASTER
69-
| I2S_OPT_BIT_CLK_MASTER;
68+
i2s_cfg.options = I2S_OPT_FRAME_CLK_CONTROLLER
69+
| I2S_OPT_BIT_CLK_CONTROLLER;
7070
} else if (dir == I2S_DIR_RX) {
7171
/* Configure the Receive port as Slave */
72-
i2s_cfg.options = I2S_OPT_FRAME_CLK_SLAVE
73-
| I2S_OPT_BIT_CLK_SLAVE;
72+
i2s_cfg.options = I2S_OPT_FRAME_CLK_TARGET
73+
| I2S_OPT_BIT_CLK_TARGET;
7474
} else { /* dir == I2S_DIR_BOTH */
75-
i2s_cfg.options = I2S_OPT_FRAME_CLK_MASTER
76-
| I2S_OPT_BIT_CLK_MASTER;
75+
i2s_cfg.options = I2S_OPT_FRAME_CLK_CONTROLLER
76+
| I2S_OPT_BIT_CLK_CONTROLLER;
7777
}
7878

7979
if (dir == I2S_DIR_TX || dir == I2S_DIR_BOTH) {

tests/drivers/i2s/i2s_buffer/src/i2s_buffer.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ static const struct i2s_config default_i2s_cfg = {
6161
.frame_clk_freq = 44100U,
6262
.block_size = BLOCK_SIZE,
6363
.timeout = TIMEOUT,
64-
.options = I2S_OPT_FRAME_CLK_MASTER | I2S_OPT_BIT_CLK_MASTER,
64+
.options = I2S_OPT_FRAME_CLK_CONTROLLER | I2S_OPT_BIT_CLK_CONTROLLER,
6565
.mem_slab = &tx_0_mem_slab,
6666
};
6767

@@ -147,12 +147,12 @@ static int configure_stream(const struct device *dev, enum i2s_dir dir,
147147

148148
if (dir == I2S_DIR_TX) {
149149
/* Configure the Transmit port as Master */
150-
i2s_cfg->options = I2S_OPT_FRAME_CLK_MASTER | I2S_OPT_BIT_CLK_MASTER;
150+
i2s_cfg->options = I2S_OPT_FRAME_CLK_CONTROLLER | I2S_OPT_BIT_CLK_CONTROLLER;
151151
} else if (dir == I2S_DIR_RX) {
152152
/* Configure the Receive port as Slave */
153-
i2s_cfg->options = I2S_OPT_FRAME_CLK_SLAVE | I2S_OPT_BIT_CLK_SLAVE;
153+
i2s_cfg->options = I2S_OPT_FRAME_CLK_TARGET | I2S_OPT_BIT_CLK_TARGET;
154154
} else { /* dir == I2S_DIR_BOTH */
155-
i2s_cfg->options = I2S_OPT_FRAME_CLK_MASTER | I2S_OPT_BIT_CLK_MASTER;
155+
i2s_cfg->options = I2S_OPT_FRAME_CLK_CONTROLLER | I2S_OPT_BIT_CLK_CONTROLLER;
156156
}
157157

158158
if (dir == I2S_DIR_TX || dir == I2S_DIR_BOTH) {

tests/drivers/i2s/i2s_instances/src/i2s_instances.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ static void test_transmit_any_data_instance(const struct device *dev)
129129
i2s_cfg.frame_clk_freq = FRAME_CLK_FREQ;
130130
i2s_cfg.block_size = BLOCK_SIZE;
131131
i2s_cfg.timeout = TIMEOUT;
132-
i2s_cfg.options = I2S_OPT_FRAME_CLK_MASTER
133-
| I2S_OPT_BIT_CLK_MASTER | I2S_OPT_BIT_CLK_GATED;
132+
i2s_cfg.options = I2S_OPT_FRAME_CLK_CONTROLLER
133+
| I2S_OPT_BIT_CLK_CONTROLLER | I2S_OPT_BIT_CLK_GATED;
134134

135135
i2s_cfg.mem_slab = &tx_0_mem_slab;
136136
ret = i2s_configure(dev, I2S_DIR_TX, &i2s_cfg);

tests/drivers/i2s/i2s_latency/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ static void configure_i2s(const struct device *dev, uint32_t frame_clk_freq)
129129
i2s_cfg.frame_clk_freq = frame_clk_freq;
130130
i2s_cfg.block_size = BLOCK_SIZE;
131131
i2s_cfg.timeout = TIMEOUT_MS;
132-
i2s_cfg.options = I2S_OPT_FRAME_CLK_MASTER | I2S_OPT_BIT_CLK_MASTER;
132+
i2s_cfg.options = I2S_OPT_FRAME_CLK_CONTROLLER | I2S_OPT_BIT_CLK_CONTROLLER;
133133

134134
i2s_cfg.mem_slab = &tx_mem_slab;
135135
ret = i2s_configure(i2s_dev, I2S_DIR_TX, &i2s_cfg);

tests/drivers/i2s/i2s_mclk/src/test_i2s_mclk.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,15 +163,15 @@ static int configure_stream(const struct device *dev_i2s, enum i2s_dir dir)
163163

164164
if (dir == I2S_DIR_TX) {
165165
/* Configure the Transmit port as Master */
166-
i2s_cfg.options = I2S_OPT_FRAME_CLK_MASTER
167-
| I2S_OPT_BIT_CLK_MASTER | I2S_OPT_BIT_CLK_GATED;
166+
i2s_cfg.options = I2S_OPT_FRAME_CLK_CONTROLLER
167+
| I2S_OPT_BIT_CLK_CONTROLLER | I2S_OPT_BIT_CLK_GATED;
168168
} else if (dir == I2S_DIR_RX) {
169169
/* Configure the Receive port as Slave */
170-
i2s_cfg.options = I2S_OPT_FRAME_CLK_SLAVE
171-
| I2S_OPT_BIT_CLK_SLAVE | I2S_OPT_BIT_CLK_GATED;
170+
i2s_cfg.options = I2S_OPT_FRAME_CLK_TARGET
171+
| I2S_OPT_BIT_CLK_TARGET | I2S_OPT_BIT_CLK_GATED;
172172
} else { /* dir == I2S_DIR_BOTH */
173-
i2s_cfg.options = I2S_OPT_FRAME_CLK_MASTER
174-
| I2S_OPT_BIT_CLK_MASTER | I2S_OPT_BIT_CLK_GATED;
173+
i2s_cfg.options = I2S_OPT_FRAME_CLK_CONTROLLER
174+
| I2S_OPT_BIT_CLK_CONTROLLER | I2S_OPT_BIT_CLK_GATED;
175175
}
176176

177177
if (!IS_ENABLED(CONFIG_TEST_USE_GPIO_LOOPBACK)) {

tests/drivers/i2s/i2s_pan/src/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ ZTEST(i2s_pan, test_hmpan_46_workaround)
6464
i2s_cfg.frame_clk_freq = 44100;
6565
i2s_cfg.block_size = BLOCK_SIZE;
6666
i2s_cfg.timeout = TIMEOUT_MS;
67-
i2s_cfg.options = I2S_OPT_FRAME_CLK_MASTER | I2S_OPT_BIT_CLK_MASTER;
67+
i2s_cfg.options = I2S_OPT_FRAME_CLK_CONTROLLER | I2S_OPT_BIT_CLK_CONTROLLER;
6868

6969
i2s_cfg.mem_slab = &tx_mem_slab;
7070
ret = i2s_configure(i2s_dev, I2S_DIR_TX, &i2s_cfg);
@@ -143,7 +143,7 @@ ZTEST(i2s_pan, test_hmpan_146_not_observed)
143143
.frame_clk_freq = 44100U,
144144
.block_size = BLOCK_SIZE,
145145
.timeout = TIMEOUT_MS,
146-
.options = I2S_OPT_FRAME_CLK_MASTER | I2S_OPT_BIT_CLK_MASTER,
146+
.options = I2S_OPT_FRAME_CLK_CONTROLLER | I2S_OPT_BIT_CLK_CONTROLLER,
147147
};
148148
const uint8_t offest_1 = 11;
149149
const uint8_t offest_2 = 22;

tests/drivers/i2s/i2s_samplerate/src/test_i2s_samplerate.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ static const struct i2s_config default_i2s_cfg = {
125125
.frame_clk_freq = 44100U,
126126
.block_size = BLOCK_SIZE,
127127
.timeout = TIMEOUT,
128-
.options = I2S_OPT_FRAME_CLK_MASTER | I2S_OPT_BIT_CLK_MASTER,
128+
.options = I2S_OPT_FRAME_CLK_CONTROLLER | I2S_OPT_BIT_CLK_CONTROLLER,
129129
.mem_slab = &tx_0_mem_slab,
130130
};
131131

@@ -166,12 +166,12 @@ static int configure_stream(const struct device *dev, enum i2s_dir dir, struct i
166166

167167
if (dir == I2S_DIR_TX) {
168168
/* Configure the Transmit port as Master */
169-
i2s_cfg->options = I2S_OPT_FRAME_CLK_MASTER | I2S_OPT_BIT_CLK_MASTER;
169+
i2s_cfg->options = I2S_OPT_FRAME_CLK_CONTROLLER | I2S_OPT_BIT_CLK_CONTROLLER;
170170
} else if (dir == I2S_DIR_RX) {
171171
/* Configure the Receive port as Slave */
172-
i2s_cfg->options = I2S_OPT_FRAME_CLK_SLAVE | I2S_OPT_BIT_CLK_SLAVE;
172+
i2s_cfg->options = I2S_OPT_FRAME_CLK_TARGET | I2S_OPT_BIT_CLK_TARGET;
173173
} else { /* dir == I2S_DIR_BOTH */
174-
i2s_cfg->options = I2S_OPT_FRAME_CLK_MASTER | I2S_OPT_BIT_CLK_MASTER;
174+
i2s_cfg->options = I2S_OPT_FRAME_CLK_CONTROLLER | I2S_OPT_BIT_CLK_CONTROLLER;
175175
}
176176

177177
if (dir == I2S_DIR_TX || dir == I2S_DIR_BOTH) {

0 commit comments

Comments
 (0)