Skip to content

Commit 7808b31

Browse files
[nrf fromlist] tests: drivers: i2s: Align tests to TDM peripheral
nRF54H series has TDM peripheral instead of I2S. Upstream PR #: 82144 Signed-off-by: Adam Kondraciuk <[email protected]>
1 parent 7c71737 commit 7808b31

File tree

4 files changed

+68
-6
lines changed

4 files changed

+68
-6
lines changed

tests/drivers/i2s/i2s_api/Kconfig

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ config I2S_TEST_SEPARATE_DEVICES
1515

1616
config I2S_TEST_USE_I2S_DIR_BOTH
1717
bool "Use I2S_DIR_BOTH value to perform RX/TX transfers"
18-
default y if DT_HAS_NORDIC_NRF_I2S_ENABLED
18+
default y if DT_HAS_NORDIC_NRF_I2S_ENABLED || DT_HAS_NORDIC_NRF_TDM_ENABLED
1919
help
2020
Use the I2S_DIR_BOTH enumeration value to trigger commands in test
2121
cases involving both reception and transmission. Use of this option
@@ -24,15 +24,15 @@ config I2S_TEST_USE_I2S_DIR_BOTH
2424

2525
config I2S_TEST_USE_GPIO_LOOPBACK
2626
bool "Use GPIO loopback"
27-
default y if DT_HAS_NORDIC_NRF_I2S_ENABLED
27+
default y if DT_HAS_NORDIC_NRF_I2S_ENABLED || DT_HAS_NORDIC_NRF_TDM_ENABLED
2828
help
2929
Use wiring between the data-out and data-in pins for looping back
3030
data. This option is intended to be used for devices that do not
3131
provide the internal loopback functionality.
3232

3333
config I2S_TEST_ALLOWED_DATA_OFFSET
3434
int "Allowed offset in received data"
35-
default 2 if DT_HAS_NORDIC_NRF_I2S_ENABLED
35+
default 10 if DT_HAS_NORDIC_NRF_I2S_ENABLED || DT_HAS_NORDIC_NRF_TDM_ENABLED
3636
default 0
3737
help
3838
Maximum allowed offset between sent and received samples. Non-zero
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (c) 2024 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/* i2s-node0 is the transmitter/receiver */
8+
9+
/ {
10+
aliases {
11+
i2s-node0 = &tdm130;
12+
};
13+
};
14+
15+
&pinctrl {
16+
tdm130_default_alt: tdm130_default_alt {
17+
group1 {
18+
psels = <NRF_PSEL(TDM_SCK_M, 1, 3)>,
19+
<NRF_PSEL(TDM_FSYNC_M, 1, 6)>,
20+
<NRF_PSEL(TDM_SDOUT, 1, 4)>,
21+
<NRF_PSEL(TDM_SDIN, 1, 5)>;
22+
};
23+
};
24+
};
25+
26+
&tdm130 {
27+
status = "okay";
28+
pinctrl-0 = <&tdm130_default_alt>;
29+
pinctrl-names = "default";
30+
memory-regions = <&cpuapp_dma_region>;
31+
};

tests/drivers/i2s/i2s_speed/Kconfig

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ config I2S_TEST_SEPARATE_DEVICES
1515

1616
config I2S_TEST_USE_I2S_DIR_BOTH
1717
bool "Use I2S_DIR_BOTH value to perform RX/TX transfers"
18-
default y if DT_HAS_NORDIC_NRF_I2S_ENABLED
18+
default y if DT_HAS_NORDIC_NRF_I2S_ENABLED || DT_HAS_NORDIC_NRF_TDM_ENABLED
1919
help
2020
Use the I2S_DIR_BOTH enumeration value to trigger commands in test
2121
cases involving both reception and transmission. Use of this option
@@ -24,15 +24,15 @@ config I2S_TEST_USE_I2S_DIR_BOTH
2424

2525
config I2S_TEST_USE_GPIO_LOOPBACK
2626
bool "Use GPIO loopback"
27-
default y if DT_HAS_NORDIC_NRF_I2S_ENABLED
27+
default y if DT_HAS_NORDIC_NRF_I2S_ENABLED || DT_HAS_NORDIC_NRF_TDM_ENABLED
2828
help
2929
Use wiring between the data-out and data-in pins for looping back
3030
data. This option is intended to be used for devices that do not
3131
provide the internal loopback functionality.
3232

3333
config I2S_TEST_ALLOWED_DATA_OFFSET
3434
int "Allowed offset in received data"
35-
default 2 if DT_HAS_NORDIC_NRF_I2S_ENABLED
35+
default 2 if DT_HAS_NORDIC_NRF_I2S_ENABLED || DT_HAS_NORDIC_NRF_TDM_ENABLED
3636
default 0
3737
help
3838
Maximum allowed offset between sent and received samples. Non-zero
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (c) 2024 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/* i2s-node0 is the transmitter/receiver */
8+
9+
/ {
10+
aliases {
11+
i2s-node0 = &tdm130;
12+
};
13+
};
14+
15+
&pinctrl {
16+
tdm130_default_alt: tdm130_default_alt {
17+
group1 {
18+
psels = <NRF_PSEL(TDM_SCK_M, 1, 3)>,
19+
<NRF_PSEL(TDM_FSYNC_M, 1, 6)>,
20+
<NRF_PSEL(TDM_SDOUT, 1, 4)>,
21+
<NRF_PSEL(TDM_SDIN, 1, 5)>;
22+
};
23+
};
24+
};
25+
26+
&tdm130 {
27+
status = "okay";
28+
pinctrl-0 = <&tdm130_default_alt>;
29+
pinctrl-names = "default";
30+
memory-regions = <&cpuapp_dma_region>;
31+
};

0 commit comments

Comments
 (0)