Skip to content

Commit

Permalink
[nrf fromlist] tests: drivers: i2s: Align tests to TDM peripheral
Browse files Browse the repository at this point in the history
nRF54H series has TDM peripheral instead of I2S.

Upstream PR #: 82144

Signed-off-by: Adam Kondraciuk <[email protected]>
  • Loading branch information
adamkondraciuk committed Jan 14, 2025
1 parent 7c71737 commit 7808b31
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 6 deletions.
6 changes: 3 additions & 3 deletions tests/drivers/i2s/i2s_api/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ config I2S_TEST_SEPARATE_DEVICES

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

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

config I2S_TEST_ALLOWED_DATA_OFFSET
int "Allowed offset in received data"
default 2 if DT_HAS_NORDIC_NRF_I2S_ENABLED
default 10 if DT_HAS_NORDIC_NRF_I2S_ENABLED || DT_HAS_NORDIC_NRF_TDM_ENABLED
default 0
help
Maximum allowed offset between sent and received samples. Non-zero
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright (c) 2024 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/

/* i2s-node0 is the transmitter/receiver */

/ {
aliases {
i2s-node0 = &tdm130;
};
};

&pinctrl {
tdm130_default_alt: tdm130_default_alt {
group1 {
psels = <NRF_PSEL(TDM_SCK_M, 1, 3)>,
<NRF_PSEL(TDM_FSYNC_M, 1, 6)>,
<NRF_PSEL(TDM_SDOUT, 1, 4)>,
<NRF_PSEL(TDM_SDIN, 1, 5)>;
};
};
};

&tdm130 {
status = "okay";
pinctrl-0 = <&tdm130_default_alt>;
pinctrl-names = "default";
memory-regions = <&cpuapp_dma_region>;
};
6 changes: 3 additions & 3 deletions tests/drivers/i2s/i2s_speed/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ config I2S_TEST_SEPARATE_DEVICES

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

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

config I2S_TEST_ALLOWED_DATA_OFFSET
int "Allowed offset in received data"
default 2 if DT_HAS_NORDIC_NRF_I2S_ENABLED
default 2 if DT_HAS_NORDIC_NRF_I2S_ENABLED || DT_HAS_NORDIC_NRF_TDM_ENABLED
default 0
help
Maximum allowed offset between sent and received samples. Non-zero
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright (c) 2024 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/

/* i2s-node0 is the transmitter/receiver */

/ {
aliases {
i2s-node0 = &tdm130;
};
};

&pinctrl {
tdm130_default_alt: tdm130_default_alt {
group1 {
psels = <NRF_PSEL(TDM_SCK_M, 1, 3)>,
<NRF_PSEL(TDM_FSYNC_M, 1, 6)>,
<NRF_PSEL(TDM_SDOUT, 1, 4)>,
<NRF_PSEL(TDM_SDIN, 1, 5)>;
};
};
};

&tdm130 {
status = "okay";
pinctrl-0 = <&tdm130_default_alt>;
pinctrl-names = "default";
memory-regions = <&cpuapp_dma_region>;
};

0 comments on commit 7808b31

Please sign in to comment.