File tree Expand file tree Collapse file tree 4 files changed +499
-8
lines changed Expand file tree Collapse file tree 4 files changed +499
-8
lines changed Original file line number Diff line number Diff line change 33zephyr_library()
44
55zephyr_library_sources(i2c_common.c)
6+
7+ if (CONFIG_I2C_RTIO)
8+ zephyr_library_sources(i2c_rtio.c)
9+ zephyr_library_sources_ifdef(CONFIG_I2C_SAM_TWIHS i2c_sam_twihs_rtio.c)
10+ else ()
611zephyr_library_sources_ifdef(CONFIG_I2C_SHELL i2c_shell.c)
712zephyr_library_sources_ifdef(CONFIG_I2C_BITBANG i2c_bitbang.c)
813zephyr_library_sources_ifdef(CONFIG_I2C_TELINK_B91 i2c_b91.c)
@@ -52,10 +57,10 @@ zephyr_library_sources_ifdef(CONFIG_I2C_STM32_V2
5257 i2c_ll_stm32_v2.c
5358 i2c_ll_stm32.c
5459 )
60+ endif ()
5561
5662zephyr_library_sources_ifdef(CONFIG_I2C_TEST i2c_test.c)
5763
58- zephyr_library_sources_ifdef(CONFIG_I2C_RTIO i2c_rtio.c)
5964zephyr_library_sources_ifdef(CONFIG_USERSPACE i2c_handlers.c)
6065
6166add_subdirectory_ifdef(CONFIG_I2C_TARGET target )
Original file line number Diff line number Diff line change @@ -40,6 +40,11 @@ config I2C_CALLBACK
4040 help
4141 API and implementations of i2c_transfer_cb.
4242
43+ config I2C_RTIO
44+ bool "I2C RTIO API"
45+ help
46+ API and implementations of I2C for RTIO
47+
4348# Include these first so that any properties (e.g. defaults) below can be
4449# overridden (by defining symbols in multiple locations)
4550source "drivers/i2c/Kconfig.b91"
@@ -56,6 +61,7 @@ source "drivers/i2c/Kconfig.sbcon"
5661source "drivers/i2c/Kconfig.sifive"
5762source "drivers/i2c/Kconfig.stm32"
5863source "drivers/i2c/Kconfig.sam0"
64+ source "drivers/i2c/Kconfig.sam_twihs"
5965source "drivers/i2c/Kconfig.litex"
6066source "drivers/i2c/Kconfig.lpc11u6x"
6167source "drivers/i2c/Kconfig.npcx"
@@ -88,13 +94,6 @@ config I2C_GECKO
8894 help
8995 Enable the SiLabs Gecko I2C bus driver.
9096
91- config I2C_SAM_TWIHS
92- bool "Atmel SAM (TWIHS) I2C driver"
93- default y
94- depends on DT_HAS_ATMEL_SAM_I2C_TWIHS_ENABLED
95- help
96- Enable Atmel SAM MCU Family (TWIHS) I2C bus driver.
97-
9897config I2C_SAM_TWIM
9998 bool "Atmel SAM (TWIM) I2C driver"
10099 default y
Original file line number Diff line number Diff line change 1+ # sam twihs I2C support
2+
3+ # Copyright (c) 2023 Intel Corporation
4+ # SPDX-License-Identifier: Apache-2.0
5+
6+ menuconfig I2C_SAM_TWIHS
7+ bool "Atmel SAM (TWIHS) I2C driver"
8+ default y
9+ depends on DT_HAS_ATMEL_SAM_I2C_TWIHS_ENABLED
10+ help
11+ Enable Atmel SAM MCU Family (TWIHS) I2C bus driver.
12+
13+ if I2C_SAM_TWIHS
14+ if I2C_RTIO
15+
16+ config I2C_SAM_TWIHS_SQ_SIZE
17+ int "Submission queue size for blocking calls"
18+ default 4
19+ help
20+ Blocking i2c calls when I2C_RTIO is enabled are copied into a per driver
21+ submission queue. The queue depth determines the number of possible i2c_msg
22+ structs that may be in the array given to i2c_transfer. A sensible default
23+ is going to be 4 given the device address, register address, and a value
24+ to be read or written.
25+
26+ config I2C_SAM_TWIHS_CQ_SIZE
27+ int "Completion queue size for blocking calls"
28+ default 4
29+ help
30+ Blocking i2c calls when I2C_RTIO is enabled are copied into a per driver
31+ submission queue. The queue depth determines the number of possible i2c_msg
32+ structs that may be in the array given to i2c_transfer. A sensible default
33+ is going to be 4 given the device address, register address, and a value
34+ to be read or written.
35+
36+ endif # I2C_RTIO
37+ endif # I2C_SAM_TWIHS
You can’t perform that action at this time.
0 commit comments