Skip to content

Commit f82d638

Browse files
committed
drivers: i2c: rts5912 i2c dirver
base on DesignWare I2C driver to implement RTS5912 I2C driver. 1. support customize bus recovery function. 2. fix isr timing issue by enable tx empty control. 3. support stuck at low handle by enable bus clear feature. 4. support custom stuck at low timeout set from dts 5. disable block mode in rts5912 i2c. 6. support I2C_ALLOW_NO_STOP_TRANSACTIONS Signed-off-by: Titan Chen <[email protected]>
1 parent 72509c3 commit f82d638

File tree

11 files changed

+788
-42
lines changed

11 files changed

+788
-42
lines changed

drivers/i2c/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ zephyr_library_sources_ifdef(CONFIG_I2C_RCAR i2c_rcar.c)
5757
zephyr_library_sources_ifdef(CONFIG_I2C_RENESAS_RA_IIC i2c_renesas_ra_iic.c)
5858
zephyr_library_sources_ifdef(CONFIG_I2C_RENESAS_RA_SCI_B i2c_renesas_ra_sci_b.c)
5959
zephyr_library_sources_ifdef(CONFIG_I2C_RENESAS_RZ_RIIC i2c_renesas_rz_riic.c)
60+
zephyr_library_sources_ifdef(CONFIG_I2C_RTS5912 i2c_realtek_rts5912.c)
6061
zephyr_library_sources_ifdef(CONFIG_I2C_RV32M1_LPI2C i2c_rv32m1_lpi2c.c)
6162
zephyr_library_sources_ifdef(CONFIG_I2C_SAM0 i2c_sam0.c)
6263
zephyr_library_sources_ifdef(CONFIG_I2C_SAM_TWI i2c_sam_twi.c)

drivers/i2c/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ config I2C_ALLOW_NO_STOP_TRANSACTIONS
6161
depends on !I2C_STM32
6262
depends on !I2C_GD32
6363
depends on !I2C_ESP32
64-
depends on !I2C_DW
64+
depends on (!I2C_DW || I2C_RTS5912)
6565
select DEPRECATED
6666
help
6767
Allow I2C transactions with no STOP on the last message. This is
@@ -146,6 +146,7 @@ source "drivers/i2c/Kconfig.omap"
146146
source "drivers/i2c/Kconfig.rcar"
147147
source "drivers/i2c/Kconfig.renesas_ra"
148148
source "drivers/i2c/Kconfig.renesas_rz"
149+
source "drivers/i2c/Kconfig.rts5912"
149150
source "drivers/i2c/Kconfig.sam0"
150151
source "drivers/i2c/Kconfig.sam_twihs"
151152
source "drivers/i2c/Kconfig.sbcon"

drivers/i2c/Kconfig.dw

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ menuconfig I2C_DW
1212
config I2C_DW_CLOCK_SPEED
1313
int "Set the clock speed for I2C"
1414
depends on I2C_DW
15+
default 110 if I2C_RTS5912
1516
default 32
1617

1718
config I2C_DW_LPSS_DMA
1819
bool "Use I2C integrated DMA for asynchronous transfer"
19-
depends on I2C_DW
20+
depends on (I2C_DW && !I2C_RTS5912)
2021
select DMA
2122
select DMA_INTEL_LPSS
2223
help

drivers/i2c/Kconfig.rts5912

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright (c) 2025 Realtek, SIBG-SD7
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config I2C_DW_EXTENDED_SUPPORT
5+
bool "Extended DW features"
6+
help
7+
This option enables support for the SCL/SDA timeout registers and some
8+
additional features of the DW I2C controller.
9+
10+
menuconfig I2C_RTS5912
11+
bool "Realtek RTS5912 I2C support"
12+
default y
13+
depends on DT_HAS_REALTEK_RTS5912_I2C_ENABLED
14+
select I2C_ALLOW_NO_STOP_TRANSACTIONS
15+
select I2C_DW_EXTENDED_SUPPORT
16+
help
17+
Enable the Realtek RTS5912 I2C driver
18+
19+
config I2C_RTS5912_INIT_PRIORITY
20+
int "RTS5912 Init priority"
21+
depends on I2C_RTS5912
22+
default 51
23+
help
24+
I2C device driver initialization priority.

0 commit comments

Comments
 (0)