Re: [PATCH v1 0/4] rust: Add basic I2C driver abstractions
From: Igor Korotin
Date: Thu Jun 26 2025 - 13:49:43 EST
On 6/26/25 18:33, Igor Korotin wrote:
> This patch series introduces basic Rust I2C driver abstractions
> and optional ACPI match-table support and provides a sample driver
> demonstrating both OF and ACPI binding
>
> Currently Rust I2C abstractions support only Open Firmware OF device
> matching. This series splits the work into four patches so that the
> core abstractions and sample driver can land immediately while ACPI
> integration may be reviewed once the ACPI macros are upstream
>
> Changes include
> - core I2C abstractions `i2c::Device` `i2c::Driver` `i2c::Adapter`
> built on `struct i2c_client` and `struct i2c_driver`
> - a standalone Rust sample driver exercising Legacy I2C ID and OF ID
> matching
> - optional ACPI ID-table support in the `i2c::Driver` abstraction
> - ACPI-enabled sample driver showing `kernel::acpi_device_table!`
> usage
>
> This separation lets maintainers review and merge the non-ACPI portions
> immediately while patches 3 and 4 both depending on the ACPI
> infrastructure can be queued once the ACPI macros are upstream
>
> Patch series:
>
> 1 rust: i2c: add basic I2C device and driver abstractions
> 2 samples: rust: add I2C sample driver (OF only)
> 3 rust: i2c: support ACPI match-table in driver abstractions
> Depends-on: 20250620152425.285683-1-igor.korotin.linux@xxxxxxxxx
> 4 samples: rust: show ACPI ID-table in I2C sample driver
> Depends-on: 20250620152425.285683-1-igor.korotin.linux@xxxxxxxxx
>
> Igor Korotin (4):
> rust: i2c: add basic I2C device and driver abstractions
> samples: rust: add Rust I2C sample driver
> rust: i2c: ACPI ID-table support for I2C abstractions
> samples: rust: show ACPI ID-table in I2C sample driver
>
> MAINTAINERS | 3 +
> rust/bindings/bindings_helper.h | 1 +
> rust/helpers/helpers.c | 1 +
> rust/helpers/i2c.c | 15 ++
> rust/kernel/i2c.rs | 386 ++++++++++++++++++++++++++++++++
> rust/kernel/lib.rs | 2 +
> samples/rust/Kconfig | 11 +
> samples/rust/Makefile | 1 +
> samples/rust/rust_driver_i2c.rs | 69 ++++++
> 9 files changed, 489 insertions(+)
> create mode 100644 rust/helpers/i2c.c
> create mode 100644 rust/kernel/i2c.rs
> create mode 100644 samples/rust/rust_driver_i2c.rs
>
>
> base-commit: 63dafeb392139b893a73b6331f347613f0929702
Please ignore. Was sent by mistake.
Thanks
Igor