[PATCH 0/2] gpio/pinctrl: spacemit: Add GPIO pin configuration support for K1

Linus Walleij linusw at kernel.org
Thu Mar 19 05:53:28 PDT 2026


Thank Junhui,

On Thu, Mar 12, 2026 at 9:43 AM Junhui Liu <junhui.liu at pigmoral.tech> wrote:

> This add GPIO pin configuration support for the Spacemit K1 SoC. Some
> use cases require configuring pin attributes like pull-up/down when using
> GPIO lines.
>
> A practical example is the SD card detection pin on the Banana Pi BPI-F3
> board. Since it lacks an external pull-up circuit, the pin must be
> configured with an internal pull-up to function correctly. Such
> configurations can be specified directly in the devicetree:
>
>     cd-gpios = <&gpio K1_GPIO(80) (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
>
> To address this, add the set_config() callback to the gpio-spacemit-k1
> driver to enable pin configuration through pinctrl, and modify the
> pinctrl driver to return -ENOTSUPP instead of -EINVAL for unsupported
> parameters, allowing the GPIO subsystem to gracefully handle them.
>
> ---
> Junhui Liu (2):
>       pinctrl: spacemit: return -ENOTSUPP for unsupported pin configurations
>       gpio: spacemit-k1: Add set_config callback support

Both patches applied to the pinctrl tree.

Yours,
Linus Walleij



More information about the linux-riscv mailing list