|
|
Log in / Subscribe / Register

rust: extend I2C functionality

From:  Igor Korotin via B4 Relay <devnull+igor.korotin.linux.gmail.com-AT-kernel.org>
To:  Danilo Krummrich <dakr-AT-kernel.org>, Daniel Almeida <daniel.almeida-AT-collabora.com>, Miguel Ojeda <ojeda-AT-kernel.org>, Boqun Feng <boqun.feng-AT-gmail.com>, Gary Guo <gary-AT-garyguo.net>, Björn Roy Baron <bjorn3_gh-AT-protonmail.com>, Benno Lossin <lossin-AT-kernel.org>, Andreas Hindborg <a.hindborg-AT-kernel.org>, Alice Ryhl <aliceryhl-AT-google.com>, Trevor Gross <tmgross-AT-umich.edu>, Wolfram Sang <wsa+renesas-AT-sang-engineering.com>
Subject:  [PATCH 0/5] rust: extend I2C functionality
Date:  Sat, 31 Jan 2026 14:12:42 +0000
Message-ID:  <20260131-i2c-adapter-v1-0-5a436e34cd1a@gmail.com>
Cc:  linux-kernel-AT-vger.kernel.org, rust-for-linux-AT-vger.kernel.org, linux-i2c-AT-vger.kernel.org, markus.probst-AT-posteo.de, Igor Korotin <igor.korotin.linux-AT-gmail.com>
Archive-link:  Article

This patch series extend the existing I2C functionality with:
- Abstractions allowing to implement I2C algorithms used by I2C adapters;
- Abstractions allowing to create and add new I2C adapters;
- Safe wrappers upon I2C and SMbus transferring C API: read/write
  bytes/words/byte arrays.

The patch series contains additional new sample driver `rust_i2c_adapter`
presenting the new functionality. 

Patch series depend on 
message-id: <20260107103511.570525-1-dakr@kernel.org>

Signed-off-by: Igor Korotin <igor.korotin.linux@gmail.com>
---
Igor Korotin (5):
      rust: i2c: split client and adapter code into separate files
      rust: bits: add define_flags macro
      rust: i2c: Add I2C Adapter registration abstractions
      rust: i2c: add I2C wrappers
      samples: rust: add Rust I2C adapter registration sample

 MAINTAINERS                      |   4 +-
 include/linux/i2c.h              |   6 +
 rust/helpers/helpers.c           |   1 +
 rust/helpers/i2c.c               |  15 ++
 rust/kernel/bits.rs              |  57 ++++++++
 rust/kernel/i2c.rs               | 254 ++-------------------------------
 rust/kernel/i2c/adapter.rs       | 200 ++++++++++++++++++++++++++
 rust/kernel/i2c/algo.rs          | 300 +++++++++++++++++++++++++++++++++++++++
 rust/kernel/i2c/client.rs        | 284 ++++++++++++++++++++++++++++++++++++
 samples/rust/Kconfig             |  12 ++
 samples/rust/Makefile            |   1 +
 samples/rust/rust_driver_i2c.rs  |  10 +-
 samples/rust/rust_i2c_adapter.rs | 170 ++++++++++++++++++++++
 samples/rust/rust_i2c_client.rs  |  15 +-
 14 files changed, 1069 insertions(+), 260 deletions(-)
---
base-commit: a7c013f779530190d0c1e1aa5e7c8a61f0bd479e
change-id: 20260131-i2c-adapter-d38d330c4c25
prerequisite-message-id: <20260107103511.570525-1-dakr@kernel.org>
prerequisite-patch-id: 6e4d28a06d842ddfc7db82f410532a35b8fe317d
prerequisite-patch-id: 9739295d85b688257fca29be1e1217a05a69c9e7
prerequisite-patch-id: 78eaed3746a40713f44f13508fcf43653b0a4528
prerequisite-patch-id: 99f1881bc896896297a903affcfa4f62cab1a307
prerequisite-patch-id: ea8baa9d648f1178d6f39d140b98bddf3c183f6f
prerequisite-patch-id: f8a9e049d204bde04e80151a67dfff5ec2633e7a

Best regards,
-- 
Igor Korotin <igor.korotin.linux@gmail.com>





Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds