Commit graph

176 commits

Author SHA1 Message Date
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
Henrik Brix Andersen
c0c8952739 shell: do not enable subsystem/driver shell modules by default
Do not enable subsystem/driver shell modules by default and stop abusing
CONFIG_SHELL_MINIMAL, which is internal to the shell subsystem, to decide
when to enable a driver shell.

The list of shell modules has grown considerably through the
years. Enabling CONFIG_SHELL for doing e.g. an interactive debug session
leads to a large number of shell modules also being enabled unless
explicitly disabled, which again leads to non-negligible increases in
RAM/ROM usage.

This commit attempts to establish a policy of subsystem/driver shell
modules being disabled by default, requiring the user/application to
explicitly enable only those needed.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-11-20 09:21:40 +01:00
Ayush Singh
dfe1c3a32b drivers: i2c: add gpio_i2c_switch
Add drivers for gpio_i2c_switch which is present in beagleconnect freedom

Signed-off-by: Vaishnav Achath <vaishnav@beagleboard.org>
Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2023-11-09 15:33:54 +01:00
Michał Barnaś
2bc7dcdc2e i2c: add filtering of i2c dumped messages
This commit adds option to dump i2c messages of only specified
devices. It makes it easier to debug communication of specific
i2c device instead of logging all i2c communication.
The filter of devices is specifiec in device-tree using the
node with "zephyr,i2c-dump-filter" compatible string.

Example of device-tree node:
i2c-dump-filter {
	compatible = "zephyr,i2c-dump-filter";
	devices = < &display0 >, < &sensor3 >;
};

Signed-off-by: Michał Barnaś <mb@semihalf.com>
2023-09-06 17:54:53 +02:00
Michał Barnaś
4aac1756a9 i2c: use device instead of name for i2c dump messages
This commit changes the parameter of i2c_dump_msgs function from
string name to pointer to the device structure.
It allows for comparison of device pointers and allow to use
the printed device name in i2c shell commands.

Signed-off-by: Michał Barnaś <mb@semihalf.com>
2023-09-06 17:54:53 +02:00
Mateusz Sierszulski
47d0e79444 drivers: i2c: Add Ambiq I2C driver
This commit adds I2C master driver for Apollo4 SoCs.

Signed-off-by: Mateusz Sierszulski <msierszulski@antmicro.com>
2023-08-17 15:15:45 +02:00
Dong Wang
b774b97ff9 drivers: i2c: Add Intel SEDI driver
Adds a new I2C shim driver for Intel SoCs. Builds upon the SEDI bare
metal I2C driver in the hal-intel module.

Signed-off-by: Dong Wang <dong.d.wang@intel.com>
2023-08-04 10:46:24 +02:00
Bill Waters
541482ff20 driver: i2c: infineon: Adding XMC4 I2C driver
- This includes the driver, test app, and sample app
- Only the boards\arm\xmc47_relax_kit board is supported for now

Signed-off-by: Bill Waters <bill.waters@infineon.com>
2023-07-11 09:43:19 +02:00
Conor Paxton
a810d27935 drivers: i2c: add Microchip PolarFire SoC I2C driver
This patch adds driver support for Microchip's PolarFire SoC I2C. This
initial support implements the Controller API only.

Signed-off-by: Conor Paxton <conor.paxton@microchip.com>
2023-06-23 12:31:36 -04:00
Gerard Marull-Paretas
a3ab08b7ce drivers: i2c: cc32xx: add support for pinctrl
Driver will configure pins using the pinctrl API now.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-06-17 07:55:43 -04:00
Tom Burdick
a106a5e606 i2c: SAM Add RTIO support for I2C
Support i2c with a seperate driver for sam twihs that implements RTIO.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2023-05-19 16:10:51 +02:00
Gerard Marull-Paretas
c66f594c41 drivers: all: rv32m1: remove conditional support for pinctrl
The rvm32m1 platform always uses pinctrl, there's no need to keep
extra macrology around pinctrl. Also updated driver's Kconfig to `select
PINCTRL`.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-04-24 13:34:22 +02:00
Gerard Marull-Paretas
989d103d53 drivers: all: mcux: remove conditional support for pinctrl
The MCUX platform always uses pinctrl, there's no need to keep extra
macrology around pinctrl. Also updated driver's Kconfig options to
`select PINCTRL` (note that some already did).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-04-24 13:34:22 +02:00
Sreeram Tatapudi
185aa1c2c5 drivers: i2c: Add Infineon CAT1 i2c driver
- Add initial version of Infineon CAT1 i2c driver.
 - Add initial version of binding file for Infineon
   CAT1 I2C driver

Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
2023-04-20 10:44:18 +02:00
Robert Hancock
b1c0bf8499 drivers: i2c: add Xilinx AXI I2C driver
Add a driver to support the Xilinx AXI IIC Bus Interface logic core, as
described in Xilinx document PG090. This can be configured for use on
most Xilinx FPGA-based platforms such as the Digilent Arty.

Both the 2.00a and 2.1 versions of the core are supported. The 2.00a
revision has a bug causing dynamic read mode to not be reliable. With
this version of the core the driver falls back to reading only 1 byte
per interrupt.

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
2023-04-17 11:39:21 +02:00
Ben Lauret
6cf3fe1d3f drivers: i2c: Add driver for smartbond DA1469x device family
This adds the i2c driver for the Renesas SmartBond(tm) MCU family.
It supports blocking transfers and callback transfers.
Currently only supports controller mode.

Co-authored-by: Stan Geitel <stan@geitel.nl>

Signed-off-by: Ben Lauret <ben.lauret.wm@renesas.com>
2023-04-07 10:09:37 -05:00
Pieter De Gendt
9b36e723f4 drivers: i2c: Add NXP SC18IM704 I2C support
Implement external I2C controller driver with NXP's SC18IM704 device.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2023-04-03 20:02:51 +02:00
Henrik Brix Andersen
c41dd36de2 drivers: kconfig: unify menuconfig title strings
Unify the drivers/*/Kconfig menuconfig title strings to the format
"<class> [(acronym)] [bus] drivers".

Including both the full name of the driver class and an acronym makes
menuconfig more user friendly as some of the acronyms are less well-known
than others. It also improves Kconfig search, both via menuconfig and via
the generated Kconfig documentation.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-03-28 15:06:06 +02:00
Trent Piepho
43781ba2a0 i2c: Add an option to dump all I2C messages to the log
When turned on, the existing i2c dump code is use to log every I2C
transaction at debug level.

This can be very useful for detecting problems with I2C peripherals.

Signed-off-by: Trent Piepho <trent.piepho@igorinstitute.com>
2023-01-26 14:55:44 -05:00
Andrei Emeltchenko
3f36584c72 i2c: shell: Update outdated help
Mention currently supported operations in I2C shell.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2022-09-07 16:04:39 -04:00
Wei-Tai Lee
0f8d12d4ed drivers: i2c: add Andes atciic100 driver
Add I2C driver for Andes atciic100. Driver supports I2C target mode and
tested on adp_xc7k_ae350 in runtime.

Signed-off-by: Wei-Tai Lee <wtlee@andestech.com>
2022-09-01 10:29:12 +02:00
Tom Burdick
a45ece6984 i2c: Adds i2c_transfer_async API for I2C
i2c_transfer_async is the asynchronous version of i2c_transfer where
the completion of the transfer is notified to the caller using a callback.

This can be used in conjuction with the common callbacks and datatypes
in async.h for directly doing an async transfer with an IPC object
to notify a thread.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-08-11 14:12:13 -04:00