From bef3fa014f116dcfbf3d2bb6aaa13bf2712d168b Mon Sep 17 00:00:00 2001 From: Adam Wojasinski Date: Mon, 24 Jul 2023 14:23:12 +0200 Subject: [PATCH] drivers: i2c: i2c_nrfx_twim: Add support for new instances This patch intoduces new instances in TWIM SHIM for i2c driver. (cherry picked from commit 97b351fb666b47ea4b222e19a8d938ffd4de65a8) Original-Signed-off-by: Adam Wojasinski GitOrigin-RevId: 97b351fb666b47ea4b222e19a8d938ffd4de65a8 Change-Id: Ia963eeb3cd2f69244593d57d568116605625c50a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/4962272 Tested-by: Fabio Baltieri Reviewed-by: Fabio Baltieri Reviewed-by: Al Semjonovs Tested-by: Al Semjonovs Commit-Queue: Fabio Baltieri --- drivers/i2c/Kconfig.nrfx | 13 ++++++++++ drivers/i2c/i2c_nrfx_twim.c | 52 +++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) diff --git a/drivers/i2c/Kconfig.nrfx b/drivers/i2c/Kconfig.nrfx index bfde27721a8..78967177a3a 100644 --- a/drivers/i2c/Kconfig.nrfx +++ b/drivers/i2c/Kconfig.nrfx @@ -27,6 +27,19 @@ config I2C_NRFX_TWIM select NRFX_TWIM1 if HAS_HW_NRF_TWIM1 select NRFX_TWIM2 if HAS_HW_NRF_TWIM2 select NRFX_TWIM3 if HAS_HW_NRF_TWIM3 + select NRFX_TWIM20 if HAS_HW_NRF_TWIM20 + select NRFX_TWIM21 if HAS_HW_NRF_TWIM21 + select NRFX_TWIM22 if HAS_HW_NRF_TWIM22 + select NRFX_TWIM30 if HAS_HW_NRF_TWIM30 + select NRFX_TWIM120 if HAS_HW_NRF_TWIM120 + select NRFX_TWIM130 if HAS_HW_NRF_TWIM130 + select NRFX_TWIM131 if HAS_HW_NRF_TWIM131 + select NRFX_TWIM132 if HAS_HW_NRF_TWIM132 + select NRFX_TWIM133 if HAS_HW_NRF_TWIM133 + select NRFX_TWIM134 if HAS_HW_NRF_TWIM134 + select NRFX_TWIM135 if HAS_HW_NRF_TWIM135 + select NRFX_TWIM136 if HAS_HW_NRF_TWIM136 + select NRFX_TWIM137 if HAS_HW_NRF_TWIM137 config I2C_NRFX_TRANSFER_TIMEOUT int "Transfer timeout [ms]" diff --git a/drivers/i2c/i2c_nrfx_twim.c b/drivers/i2c/i2c_nrfx_twim.c index 13df5051ac7..55160a44c72 100644 --- a/drivers/i2c/i2c_nrfx_twim.c +++ b/drivers/i2c/i2c_nrfx_twim.c @@ -455,3 +455,55 @@ I2C_NRFX_TWIM_DEVICE(2); #ifdef CONFIG_HAS_HW_NRF_TWIM3 I2C_NRFX_TWIM_DEVICE(3); #endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM20 +I2C_NRFX_TWIM_DEVICE(20); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM21 +I2C_NRFX_TWIM_DEVICE(21); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM22 +I2C_NRFX_TWIM_DEVICE(22); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM30 +I2C_NRFX_TWIM_DEVICE(30); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM120 +I2C_NRFX_TWIM_DEVICE(120); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM130 +I2C_NRFX_TWIM_DEVICE(130); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM131 +I2C_NRFX_TWIM_DEVICE(131); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM132 +I2C_NRFX_TWIM_DEVICE(132); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM133 +I2C_NRFX_TWIM_DEVICE(133); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM134 +I2C_NRFX_TWIM_DEVICE(134); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM135 +I2C_NRFX_TWIM_DEVICE(135); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM136 +I2C_NRFX_TWIM_DEVICE(136); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM137 +I2C_NRFX_TWIM_DEVICE(137); +#endif