Commit graph zephyr/drivers/i2c/Kconfig
Author SHA1 Message Date
Benjamin Cabé
3820679807 drivers: i2c: add VIRTIO I2C adapter driver
Add a driver for the VIRTIO I2C adapter device (virtio spec 1.3, section
5.16), letting a Zephyr guest drive an I2C bus exposed by a hypervisor or
a vhost-user backend.

One i2c_msg is one descriptor chain, and the whole batch is queued before
the device is notified, so a multi-message transfer costs one round trip
instead of one per message. FAIL_NEXT groups the messages the device runs
back to back; a message that ends in a stop closes its group, so a failure
takes the rest of that group with it.

Every operation is a round trip to the device, so the I2C API can only be
used from a thread. VIRTIO_I2C_F_ZERO_LENGTH_REQUEST is mandatory, so a
device that does not offer it is refused. 10-bit addressing is not
supported, and the bus speed is accepted and ignored.

Assisted-by: Claude Code:opus-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-08-28 15:27:52 -04:00
Etienne Carriere
a17a6d7a71 drivers: i2c: Fix CONFIG_I2C_MCUX_*_BUS_RECOVERY default values
Since recover-bus-on-init DT property if of boolean type, use of
dt_compat_any_has_prop() without an explicit value argument of True
makes that function to always return true and
CONFIG_I2C_MCUX_LPI2C_BUS_RECOVERY and
CONFIG_I2C_MCUX_FLEXCOMM_BUS_RECOVERY configuration options always enabled
(when their dependencies are met).

Set function argument value to True to get the expected behavior.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-08-27 21:24:05 +01:00
Michael Zimmermann
8a7ae0bed1 modules: hal_silabs: rename gecko kconfigs
- Kconfigs in modules/ should not define configs with an SOC_ prefix.
  Furthermore, these options are SDK specific, not SoC specific.
- The simplicity_sdk configs do the same.

Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
2026-06-17 08:05:45 +02:00
minyuan xue
a3d6575d2a drivers: i2c: add ameba i2c driver support
Add Realtek Ameba I2C driver with DMA-based TX/RX support.

Signed-off-by: minyuan xue <minyuan_xue@realsil.com.cn>
2026-06-08 10:39:14 +01:00
Muhammad Waleed Badar
c0e74f0c14 drivers: i2c: add support for bcm2711 i2c controller
Add support for the bcm2711 i2c controller found on
Raspberry Pi SBC platforms.

Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-06-01 12:37:46 -04:00
Josuah Demangeon
1d35748d5c style: remove whitespace in < ... >; syntax from doc/comments
Fix devicetree coding style regarding whitespaces through the tree.
This affects code snippets inside documentation, comments, error messages
as to encourage a style that passes CI. Follow-up of #101619

Signed-off-by: Josuah Demangeon <me@josuah.net>
2026-05-29 20:53:20 -07:00
Jason Yu
dcafd5118e driver: i2c: lpi2c: Add option to recover bus on init
When `recover_bus_on_init` is defined, recover the
i2c bus during driver initialization.

Signed-off-by: Jason Yu <zejiang.yu@nxp.com>
2026-05-27 21:30:18 -04:00
Jason Yu
bf8f47beda i2c: lpi2c: kconfig: Auto select BUS RECOVERY
When LPI2C driver is used, and I2C_BUS_RECOVERY is selected,
then enable I2C_MCUX_LPI2C_BUS_RECOVERY.

Signed-off-by: Jason Yu <zejiang.yu@nxp.com>
2026-05-27 21:30:18 -04:00
Fabio Baltieri
37fb15e9ea i2c: add a generic I2C_TRANSFER_TIMEOUT_MS option
Add a generic I2C_TRANSFER_TIMEOUT_MS option, not tied to any specific
driver, as well as a I2C_TRANSFER_TIMEOUT helper to handle conversions
and infinite timeout and a helper for driver that only supports finite
timeouts.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2026-05-05 09:47:27 +02:00
Muhammad Waleed Badar
f7b348a6de drivers: i2c: add global bus recovery Kconfig
Introduce a new Kconfig option `I2C_BUS_RECOVERY` to provide
a common switch for enabling I2C bus recovery support.

This ensures consistent behavior across drivers and simplifies
configuration for platforms requiring i2c bus recovery.

Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-04-16 11:40:50 -05:00
Yuzhuo Liu
f368878072 drivers: i2c: add Realtek Bee series driver
Add I2C driver support for Realtek Bee series SoCs,
including RTL87x2G and RTL8752H.

This driver supports:
- Master mode operation
- 7-bit and 10-bit addressing
- Standard and Fast mode speeds

Signed-off-by: Yuzhuo Liu <yuzhuo_liu@realsil.com.cn>
2026-04-14 22:14:35 -04:00
Scott Worley
4ada22932d drivers: i2c: microchip: xec: Port I2C v2 driver to MEC174x/5x
We modified the Microchip XEC/MEC version 2 I2C byte mode driver
to work on v3.8 I2C hardware in MEC174x/5x/165x SoCs. The changes
are as follows:
1. Add a local header file containing register and bit field definitions
2. Use Zephyr inline register access functions (sys_read/write)
   instead of CMSIS register structures.
3. Change DT bindings to require GPIO references for the SCL and SDA
   pins. MEC172x will use GPIO driver to get line states. MEC174x/5x
   have v3.8 I2C hardware with read-only live values of SCL/SDA pin
   states in the bit-bang control register. The MEC172x SoC code to
   read I2C GPIO's is no longer needed and is removed in a later
   commit in this series.
4. Use WAIT_FOR macro in place of custom spin loops.
5. SonarQube code check recommendations except WAIT_FOR macro which is
   based on a GNU compiler extension.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2026-03-12 14:03:48 -05:00
Keith Short
46a60bb7d9 drivers: i2c: Fix default setting for I2C dump allowlist
The option CONFIG_I2C_DUMP_MESSAGES_ALLOWLIST should automatically be
turned on if the depedencies are satisfied.

Signed-off-by: Keith Short <keithshort@google.com>
2025-12-11 16:34:17 -05:00
Sreeram Tatapudi
5ecf248ba3 drivers: infineon: Drop cat1 from the files names
Drop cat1 from the file names to enable reuse by other
category devices as well

Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
2025-12-07 21:19:38 -05:00
Fabio Baltieri
6850470587 i2c: shell: make the buffer configurable
Add a Kconfig option to tweak the i2c shell command buffer size,
similarly to other shell commands.

This is allocated on the stack so add a note about it.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-12-05 10:54:31 +02:00
Camille BAUD
3da4a2a2f4 drivers: i2c: Introduce basic bflb I2C driver
Introduce synchronous i2c driver

Signed-off-by: Camille BAUD <mail@massdriver.space>
2025-11-15 11:43:59 +01:00
Fabin V Martin
e4e36f5f28 drivers: i2c: microchip: Add I2C g1 driver
- Add I2C driver for Microchip SERCOM g1.
- Add and update Kconfig files to support the driver.
- Update CMakeLists.txt to include the new driver.

Signed-off-by: Fabin V Martin <Fabinv.Martin@microchip.com>
2025-11-14 15:25:25 +02:00
Qingsong Gou
1b8e3bdaf7 drivers: i2c: add i2c driver for sf32lb platform
Add i2c driver for sf32lb platform

Signed-off-by: Qingsong Gou <gouqs@hotmail.com>
2025-11-14 12:19:20 +02:00
Stoyan Bogdanov
49ef7d460c drivers: i2c: Add support for cc23x0 I2C
Add support for I2C to cc23x0 SoC. Only controller mode is implemented.

Signed-off-by: Stoyan Bogdanov <sbogdanov@baylibre.com>
2025-09-13 21:23:34 -04:00
S Mohamed Fiaz
ea6ec6b15a drivers: i2c: silabs: i2c driver for EFR series 2 devices
Added the i2c driver for EFR series 2 devices.

Signed-off-by: S Mohamed Fiaz <Fiaz.Mohamed@silabs.com>
2025-09-08 15:52:34 -04:00
Duy Nguyen
92a631e836 drivers: i2c: Add support i2c driver for Renesas RX MCU
Add initial support for i2c on Renesas RX MCU
This driver is controlling the RIIC HW of RX MCU for i2c bus
interface on Zephyr
Only master mode is supported

Signed-off-by: Duy Nguyen <duy.nguyen.xa@renesas.com>
2025-06-23 16:26:51 -05:00
Titan Chen
748789eadf 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 <titan.chen@realtek.com>
2025-05-29 20:17:05 +02:00
Tim Lin
f7d381fef1 drivers/i2c: Add I2C driver of it51xxx
Implement the functions of I2C host and target.
I2CM: supports nine hosts and each one able located at I2C interface
      0~12.
      supports two 32 bytes dedicated FIFO mode for read and write.
I2CS: supports three targets and each one able located at I2C
      interface 0~8.
      supports 16 bytes dedicated FIFO mode that only supports write or
      read mode and the maximum buffer size is 256 bytes.
      support non-FIFO write to shared FIFO read mode. The maximum
      shared FIFO size for read is 256 bytes.
The APIs test include: i2c_write(), i2c_read(), i2c_burst_read(),
                       i2c_burst_write(), i2c_write_read()

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2025-04-29 16:48:06 +02:00
Andrei-Edward Popa
e4c2cecb7d drivers: i2c: added wch i2c driver
added i2c driver for wch platforms

Signed-off-by: Andrei-Edward Popa <andrei.popa105@yahoo.com>
2025-04-17 21:17:06 +02:00
Sven Ginka
046fbdecfa drivers: i2c: sy1xx add support for i2c
Add i2c support for the sensry soc sy1xx.

Signed-off-by: Sven Ginka <s.ginka@sensry.de>
2025-03-14 14:39:55 +01:00
Ajay Neeli
d2519c1192 drivers: i2c: Add Cadence I2C support
This patch adds support for Cadence I2C Controller
 - Enables I2C Master Mode functionality

Signed-off-by: Ajay Neeli <ajay.neeli@amd.com>
2025-03-12 19:02:04 +01:00
Hoang Nguyen
1d7faca97e drivers: i2c: Initial support for RZ/G3S
Add I2C driver support for Renesas RZ/G3S

Signed-off-by: Hoang Nguyen <hoang.nguyen.jx@bp.renesas.com>
Signed-off-by: Binh Nguyen <binh.nguyen.xw@renesas.com>
2025-03-07 19:45:11 +01:00
Jiafei Pan
b97c1d7999 drivers: i2c: add NXP i2c driver used on imx8m platforms
This native i2c driver works together with ii2c drive in hal_nxp.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2025-01-24 19:15:57 +01:00
Dhruv Menon
1d8ea45a8d drivers: i2c: Base OMAP I2C support for TI-K3 processor
The OMAP I2C provides support for I2C serial interface on TI K3 series.
It is compatible with Philips I2C physical layer.
The commit includes:
Zephyr i2c api implementation
Polling Mode

Signed-off-by: Dhruv Menon <dhruvmenon1104@gmail.com>
2025-01-09 23:26:23 +01:00
Daniel Schultz
307eca452e drivers: i2c: Add zephyr-keep-sorted defines
The previous re-organization has the zephyr-keep-sorted defines
missing. Add them for the I2C drivers and targets. Also
moved lines to fix out-of-order violations.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
2025-01-08 01:30:34 +01:00
Daniel Schultz
fe472aefad drivers: i2c: Reorganize Driver List
Organize all drivers in alphabetic order and move common
parts at the beginning.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
2024-12-16 18:26:23 +01:00
Manuel Argüelles
1428fd02a2 dts: bindings: rename nxp,imx-lpi2c compatible
Rename "nxp,imx-lpi2c" compatible to "nxp,lpi2c" to remove the
device family from its name.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2024-12-04 14:15:52 -05:00
Johan Hedberg
4bd61408c7 drivers: i2c: gecko: Add PINCTRL dependency
This driver should use PINCTRL on all Series 2 boards.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2024-11-26 15:42:02 -05:00
Gerson Fernando Budke
0cc8f93e8a soc: atmel: Drop PINCTRL from Kconfig.defconfig
This Kconfig has wrongly been added to defconfig files. It is not the
right place for it. It has never been the right place for it. Drivers
that need it should select the symbol in their Kconfig entries. Drop
PINCTL from Kconfig.defconfig and add proper select at Kconfig.sam*.

Fixes #78619

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2024-11-04 13:43:26 -06:00
Tom Burdick
24762115d4 i2c: Fix default RTIO handler transactions
Transactions from RTIO should result in single calls to i2c_transfer.
This corrects the default handler to first count the number of
submissions in the transaction, allocate on the stack, and then copy
over each submission to an equivalent i2c_msg.

It also cleans up the helper functions to be infallible, taking only the
submission and msg to copy to.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2024-10-22 18:29:34 -04:00
Emilio Benavente
82a192c8a9 boards: nxp: Removing CONFIG_PINCTRL from the boards defconfig
The Drivers using Pinctrl should be turning Pinctrl on
this should not be the responsibility of the board. This
commit removes CONFIG_PINCTRL from the boards side for nxp boards.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2024-10-15 19:09:45 -04:00
Fabio Baltieri
61f4ba27ad drivers: i2c: add an option to skip auto-sending stop on last message
The I2C transfer API has been recently changed to always automatically
set a STOP on the last message, which was well documented but
implemented only by few drivers.

Unfortunately, while documented, this is a change in the current
behavior and it turns out that some applications depended on it for some
complex operations.

Add a flag to temporarily restore the old behavior, buying time to fix
the application code depending on this.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-09-23 14:07:49 +01:00
Yuval Peress
8974c248cf rtio: Add default i2c submit handler
Use the RTIO work queue to fake the i2c submit calls for drivers which
haven't yet implemented the API. Applications can change the size of
the work queue pool depending on how much traffic they have on the buses.

Signed-off-by: Yuval Peress <peress@google.com>
2024-09-04 21:28:26 +02:00
Thao Luong
8bcfbf4d80 drivers: i2c: Add I2C driver support for Renesas RA8 devices
Add implemetation of I2C driver use IIC Master for Renesas RA8 devices

Signed-off-by: Ha Nguyen <ha.nguyen.fz@bp.renesas.com>
Signed-off-by: Thao Luong <thao.luong.uw@renesas.com>
Signed-off-by: Duy Phuong Hoang. Nguyen <duy.nguyen.xa@renesas.com>
2024-08-14 15:53:50 -05:00
Tahsin Mutlugun
f037b95549 drivers: i2c: Add MAX32690 I2C driver
Add I2C driver for Analog Devices MAX32690 MCU. Supports target mode.

Co-Authored-By: Sadik Ozer <sadik.ozer@analog.com>
Co-Authored-By: Mert Vatansever <mert.vatansever@analog.com>
Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
2024-06-07 13:01:50 +02:00
Yong Cong Sin
97ba7fd48d drivers: i2c: add Broadcom iProc I2C driver
Add device driver, bindings and build-only test for
Broadcom iProc I2C.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-28 09:57:40 +02:00
Tom Burdick
cb384cd5a9 i2c: LPI2C selects HAS_I2C_RTIO
LPI2C from NXP supports the RTIO interface and therefore now selects the
HAS_I2C_RTIO Kconfig.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2024-05-04 13:23:22 +03:00
Tom Burdick
06e025aeee i2c: Add Kconfig HAS_I2C_RTIO
This config should be selected by any driver that supports the RTIO
interface and can then be checked on by things like tests or drivers
that subsequently require the feature exist.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2024-05-04 13:23:22 +03:00
Benjamin Cabé
c165446993 drivers: i2c: fix leaking Kconfig option for mcux driver
Fix leaking I2C_NXP_TRANSFER_TIMEOUT option. It was showing up for all
I2C drivers.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-04-26 19:48:11 +01:00
Steven Chang
b231905e38 drivers: i2c: initial device driver for ENE KB1200
Add i2c driver for ENE KB1200

Signed-off-by: Steven Chang <steven@ene.com.tw>
2024-03-15 09:39:48 +00:00
Tom Burdick
bafac2c689 i2c: Add helpers and context for i2c rtio drivers
Implementing RTIO drivers, in theory, should be as simple as the normal
i2c drivers and generally be more consistent across implementations. To
do that some common code that calls driver specific code is needed much
like the venerable spi_context and its helpers.

This adds struct i2c_rtio as well as helpers to perform blocking i2c
transfers, i2c bus recovery, and similar such tasks.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2024-03-05 09:43:38 -05:00
Tom Burdick
e8b528321a i2c: Select rtio when I2C_RTIO is selected
Rather than a depends on, which leaves it up to every single usage
of I2C_RTIO to then go and select RTIO, by selecting I2C_RTIO Kconfig
inherently selects RTIO now.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2024-03-05 09:43:38 -05:00
Tom Burdick
c3a0ea02a7 i2c: Add a new API test using (f/s/nv)ram
RAM allows for very fast reads and writes and lets us explore most of
the I2C controller APIs including RTIO. Theoretically supports any form
of i2c connected RAM but requires some tweaking to work with specific
parts potentially. Tested with Fujitsu's MB85 FeRAM part using an
arduino breakout.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2024-03-05 09:43:38 -05:00
Guilherme Casa Nova
583f24e7e8 i2c_mcux_flexcomm: add transaction timeout option
With the device_sync_sem semaphore, there is the possibility of
the code not returning to give it back
(mcux_flexcomm_master_transfer_callback is never called),
causing it to get stuck in k_sem_take(&data->device_sync_sem, K_FOREVER)
in subsequent calls.

The i2c driver recovers by other means
(enabling FSL_FEATURE_I2C_TIMEOUT_RECOVERY)
but the callback might not return.

Adding a timeout option allows for this occurrence to be avoided.

Signed-off-by: Guilherme Casa Nova <guilherme.casa_nova@dell.com>
2024-02-02 15:24:26 -06:00
cyliang tw
dfff1107b8 drivers: i2c: support for Nuvoton numaker series
Add Nuvoton numaker series I2C controller feature.
Support dual role and at most one slave at one time

Signed-off-by: cyliang tw <cyliang@nuvoton.com>
2023-11-27 14:34:15 +00:00