public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] gpio/pinctrl: spacemit: Add GPIO pin configuration support for K1
@ 2026-03-12  8:42 Junhui Liu
  2026-03-12  8:42 ` [PATCH 1/2] pinctrl: spacemit: return -ENOTSUPP for unsupported pin configurations Junhui Liu
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Junhui Liu @ 2026-03-12  8:42 UTC (permalink / raw)
  To: Linus Walleij, Yixun Lan, Bartosz Golaszewski
  Cc: linux-gpio, linux-riscv, spacemit, linux-kernel, Junhui Liu

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

 drivers/gpio/gpio-spacemit-k1.c       |  1 +
 drivers/pinctrl/spacemit/pinctrl-k1.c | 21 ++++++++++++---------
 2 files changed, 13 insertions(+), 9 deletions(-)
---
base-commit: b29fb8829bff243512bb8c8908fd39406f9fd4c3
change-id: 20260312-k1-gpio-set-config-f0873e92ebac

Best regards,
-- 
Junhui Liu <junhui.liu@pigmoral.tech>


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

end of thread, other threads:[~2026-03-19 12:54 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-12  8:42 [PATCH 0/2] gpio/pinctrl: spacemit: Add GPIO pin configuration support for K1 Junhui Liu
2026-03-12  8:42 ` [PATCH 1/2] pinctrl: spacemit: return -ENOTSUPP for unsupported pin configurations Junhui Liu
2026-03-13 13:37   ` Yao Zi
2026-03-13 13:52   ` Bartosz Golaszewski
2026-03-14  8:20   ` Anand Moon
2026-03-12  8:42 ` [PATCH 2/2] gpio: spacemit-k1: Add set_config callback support Junhui Liu
2026-03-13 14:05   ` Bartosz Golaszewski
2026-03-19 12:54     ` Linus Walleij
2026-03-14  8:20   ` Anand Moon
2026-03-12 11:21 ` [PATCH 0/2] gpio/pinctrl: spacemit: Add GPIO pin configuration support for K1 Yixun Lan
2026-03-19 12:53 ` Linus Walleij

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