Linux LED subsystem development
 help / color / mirror / Atom feed
* [PATCH v2 0/5] Rust LED Driver Abstractions and Lenovo SE10 Driver with DMI and I/O Port Support
@ 2025-01-13 12:16 Fiona Behrens
  2025-01-13 12:16 ` [PATCH v2 1/5] rust: dmi: Add abstractions for DMI Fiona Behrens
                   ` (4 more replies)
  0 siblings, 5 replies; 17+ messages in thread
From: Fiona Behrens @ 2025-01-13 12:16 UTC (permalink / raw)
  To: Miguel Ojeda, Alex Gaynor, Pavel Machek, Lee Jones, Jean Delvare
  Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, Trevor Gross, Fiona Behrens,
	Mark Pearson, Peter Koch, rust-for-linux, linux-leds,
	linux-kernel

This patch series introduces Rust LED abstractions and provides a driver for the Lenovo ThinkEdge SE10 using those abstractions.

1. DMI Abstraction:
    - Introduced Rust macros and types for DMI-based system matching, providing functionality similar to the `MODULE_DEVICE_TABLE(dmi, x)` macro in C. This abstraction allows system-specific matching using DMI fields.

2. LED Abstractions:
    - Introduced a generic LED abstraction that supports on/off control, brightness levels, and hardware blinking.
    - The abstraction is implemented using a vtable, with a struct that holds the generic driver data and is pinned for direct LED registration.

3. I/O Port Abstractions:
    - Added abstractions for hardware I/O port memory access, enabling the driver to interact with hardware ports.

4. LED Driver for Lenovo ThinkEdge SE10:
    - A driver is implemented for the red LED on the front panel of the Lenovo ThinkEdge SE10, utilizing the previously introduced LED abstractions, I/O port abstractions, and DMI matching.
    - The driver supports on/off control and a WWAN hardware trigger.

Additionally, the LED abstraction has been prepared to support multicolor LEDs in the future. While this functionality is planned, it has not yet been implemented, as I do not have a consumer for it at this time.

Would it make sense to add the Rust DMI abstractions to the existing DMI/SMBIOS SUPPORT entry in the MAINTAINERS file?

This series depends on `rust: time: Introduce Delta type` by FUJITA Tomonori[1].

I send this previously without the SE10 driver as an RFC[2], and now have a driver to consume the APIs.

[1]: https://lore.kernel.org/rust-for-linux/20241220061853.2782878-3-fujita.tomonori@gmail.com/
[2]: https://lore.kernel.org/rust-for-linux/20241009105759.579579-1-me@kloenk.dev/

Fiona Behrens (5):
  rust: dmi: Add abstractions for DMI
  rust: leds: Add Rust bindings for LED subsystem
  rust: leds: Add hardware trigger support for hardware-controlled LEDs
  rust: add I/O port abstractions with resource management
  leds: leds_lenovo_se10: LED driver for Lenovo SE10 platform

 MAINTAINERS                      |   2 +
 drivers/leds/Kconfig             |  10 +
 drivers/leds/Makefile            |   1 +
 drivers/leds/leds_lenovo_se10.rs | 132 ++++++++
 rust/bindings/bindings_helper.h  |   1 +
 rust/helpers/helpers.c           |   1 +
 rust/helpers/ioport.c            |  42 +++
 rust/kernel/dmi.rs               | 533 +++++++++++++++++++++++++++++++
 rust/kernel/ioport.rs            | 169 ++++++++++
 rust/kernel/leds.rs              | 416 ++++++++++++++++++++++++
 rust/kernel/leds/triggers.rs     | 128 ++++++++
 rust/kernel/lib.rs               |   6 +
 rust/kernel/time.rs              |   7 +
 13 files changed, 1448 insertions(+)
 create mode 100644 drivers/leds/leds_lenovo_se10.rs
 create mode 100644 rust/helpers/ioport.c
 create mode 100644 rust/kernel/dmi.rs
 create mode 100644 rust/kernel/ioport.rs
 create mode 100644 rust/kernel/leds.rs
 create mode 100644 rust/kernel/leds/triggers.rs

-- 
2.47.0


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

end of thread, other threads:[~2025-01-20 14:19 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-13 12:16 [PATCH v2 0/5] Rust LED Driver Abstractions and Lenovo SE10 Driver with DMI and I/O Port Support Fiona Behrens
2025-01-13 12:16 ` [PATCH v2 1/5] rust: dmi: Add abstractions for DMI Fiona Behrens
2025-01-13 12:16 ` [PATCH v2 2/5] rust: leds: Add Rust bindings for LED subsystem Fiona Behrens
2025-01-13 13:10   ` Miguel Ojeda
2025-01-13 12:16 ` [PATCH v2 3/5] rust: leds: Add hardware trigger support for hardware-controlled LEDs Fiona Behrens
2025-01-20 10:35   ` Marek Behún
2025-01-20 10:59     ` Fiona Behrens
2025-01-20 14:18       ` Marek Behún
2025-01-13 12:16 ` [PATCH v2 4/5] rust: add I/O port abstractions with resource management Fiona Behrens
2025-01-13 13:15   ` Daniel Almeida
2025-01-13 13:28     ` Fiona Behrens
2025-01-13 12:16 ` [PATCH v2 5/5] leds: leds_lenovo_se10: LED driver for Lenovo SE10 platform Fiona Behrens
2025-01-17 17:21   ` Mark Pearson
2025-01-17 17:31     ` Fiona Behrens
2025-01-17 18:02       ` Mark Pearson
2025-01-17 17:43     ` Miguel Ojeda
2025-01-20 10:47   ` Marek Behún

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox