Re: [PATCH 1/3] rust: gpio: add GPIO module with common definitions

From: Kohei Ito

Date: Sat Oct 03 2026 - 13:00:40 EST


Hi Linus,

thank you for your comments.

> > Add the top-level GPIO module with minimal common definitions. This
> > module is the basis for future Rust GPIO extensions.
>
> Describe what you want to enable by this patch.
>
> - Enabling in-kernel Rust code to use things from the
> GPIO subsystem? (It looks like so.)
>
> - Writing GPIO drivers in rust? (It seems like not.)

This patch is the first step to enable in-kernel Rust code to use things
from the GPIO subsystem. I'll clarify this in the commit message. The
patch series does not add Rust GPIO provider APIs or Rust GPIO provider
drivers, but it is intended to be the basis for them.

> > +/// Describes the raw GPIO level, i.e. the value of its physical line without regard for its
> > +/// ACTIVE_LOW status.
> > +#[derive(Clone, Copy, PartialEq, Eq)]
> > +pub enum PhysicalLineLevel {
>
> No thanks.
>
> We want to hide the actual physical line level inside the
> gpiolib (encapsulation).
>
> We should not expose the physical line level at all
> unless there is a consumer in the kernel that absolutely
> needs this, and there is none.

Sure. I have no need to use the physical line level right now, so I'll
remove it and the related definitions.

Best regards,
Kohei Ito