rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Add first led driver written in Rust
@ 2025-10-08 18:10 Markus Probst
  2025-10-08 18:10 ` [PATCH 1/4] rust: i2c: add read and write byte data abstractions Markus Probst
  0 siblings, 1 reply; 14+ messages in thread
From: Markus Probst @ 2025-10-08 18:10 UTC (permalink / raw)
  To: Lee Jones, Pavel Machek, Danilo Krummrich, Miguel Ojeda,
	Alex Gaynor, Igor Korotin
  Cc: Markus Probst, Lorenzo Stoakes, Vlastimil Babka, Liam R. Howlett,
	Uladzislau Rezki, Boqun Feng, Gary Guo, bjorn3_gh, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, Trevor Gross, Daniel Almeida,
	linux-leds, rust-for-linux, linux-kernel

This patch series adds the first led driver written in Rust to the
kernel.

The following changes were made:
* extends the not-yet-merged i2c patch series (see below) to include
  abstractions for reading and writing to i2c clients.

* add a wrapper of Vec, that allows to initialize PinInit items with
  the gurantee that these will never be moved.

* add basic led classdev abstractions to register and unregister leds

* add a driver for the atmega1608 microcontroller used in synology
  devices.

This patch series requires and is based on:
https://lore.kernel.org/rust-for-linux/20251005102226.41876-1-igor.korotin.linux@gmail.com/T/#t

Atmega1608 is a programmable microcontroller. It has been preprogrammed
to allow leds being controlled via the i2c bus. This driver can only be
used on synology devices using this microcontroller.

Information on how to interact with it, has been gained by viewing the
drivers/leds/leds-atmega1608.c file licensed under GPL found here (thats the only documentation):
https://global.synologydownload.com/download/ToolChain/Synology%20NAS%20GPL%20Source/7.2-72806/r1000/linux-4.4.x.txz

Markus Probst (4):
  rust: i2c: add read and write byte data abstractions
  rust: add pinned wrapper of Vec
  rust: leds: add basic led classdev abstractions
  leds: add driver for synology atmega1608 controlled LEDs

 MAINTAINERS                     |   6 +
 drivers/leds/Kconfig            |   9 +
 drivers/leds/Makefile           |   1 +
 drivers/leds/leds_atmega1608.rs | 377 ++++++++++++++++++++++++++++++++
 rust/kernel/alloc/kvec.rs       |  86 ++++++++
 rust/kernel/i2c.rs              |  45 ++++
 rust/kernel/led.rs              | 299 +++++++++++++++++++++++++
 rust/kernel/lib.rs              |   1 +
 8 files changed, 824 insertions(+)
 create mode 100644 drivers/leds/leds_atmega1608.rs
 create mode 100644 rust/kernel/led.rs

-- 
2.49.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2025-10-09 13:11 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-08 18:10 [PATCH 0/4] Add first led driver written in Rust Markus Probst
2025-10-08 18:10 ` [PATCH 1/4] rust: i2c: add read and write byte data abstractions Markus Probst
2025-10-08 18:10   ` [PATCH 2/4] rust: add pinned wrapper of Vec Markus Probst
2025-10-08 18:10     ` [PATCH 3/4] rust: leds: add basic led classdev abstractions Markus Probst
2025-10-08 18:10       ` [PATCH 4/4] leds: add driver for synology atmega1608 controlled LEDs Markus Probst
2025-10-09 12:20         ` Danilo Krummrich
2025-10-09 12:30           ` Markus Probst
2025-10-09 12:41             ` Danilo Krummrich
2025-10-09 13:11               ` Alexandre Courbot
2025-10-09 11:36       ` [PATCH 3/4] rust: leds: add basic led classdev abstractions Danilo Krummrich
2025-10-09 11:23     ` [PATCH 2/4] rust: add pinned wrapper of Vec Alice Ryhl
2025-10-09 12:06       ` Markus Probst
2025-10-09 11:29   ` [PATCH 1/4] rust: i2c: add read and write byte data abstractions Alice Ryhl
2025-10-09 12:08   ` Danilo Krummrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).