Skip to content

Commit

Permalink
sunxi64: re-enable GPIO sysfs API
Browse files Browse the repository at this point in the history
There is still a lot of software and vendor scripts for LCDs and others out there, which use the legacy GPIO sysfs API. In the meantime, libgpio is the modern replacement, hence this API has been deprecated, but it takes a while before old software and vendor scripts adjust, if ever.

It was removed from sunxi64 current configs in this commit: armbian@6380b9e
And the patch to make it independent of CONFIG_EXPERT=y was not ported to Linux 6.6.
It does not seem to have happened intentional, since the CONFIG_GPIO_SYSFS=y is still set in 32-bit sunxi and rockchip configs. There also CONFIG_EXPERT=y is set, hence the patch not required.

For reference, the original PR which added this flag and patch: armbian#3635
It still applies and is needed with recent Linux versions: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/gpio/Kconfig#n61

Signed-off-by: MichaIng <micha@dietpi.com>
  • Loading branch information
MichaIng committed May 7, 2024
1 parent 503ba57 commit cafc178
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/kernel/linux-sunxi64-current.config
Original file line number Diff line number Diff line change
Expand Up @@ -3553,6 +3553,7 @@ CONFIG_GPIOLIB=y
CONFIG_GPIOLIB_FASTPATH_LIMIT=512
CONFIG_OF_GPIO=y
CONFIG_GPIOLIB_IRQCHIP=y
CONFIG_GPIO_SYSFS=y
CONFIG_GPIO_CDEV=y
CONFIG_GPIO_CDEV_V1=y
CONFIG_GPIO_GENERIC=y
Expand Down
1 change: 1 addition & 0 deletions config/kernel/linux-sunxi64-edge.config
Original file line number Diff line number Diff line change
Expand Up @@ -3563,6 +3563,7 @@ CONFIG_GPIOLIB=y
CONFIG_GPIOLIB_FASTPATH_LIMIT=512
CONFIG_OF_GPIO=y
CONFIG_GPIOLIB_IRQCHIP=y
CONFIG_GPIO_SYSFS=y
CONFIG_GPIO_CDEV=y
CONFIG_GPIO_CDEV_V1=y
CONFIG_GPIO_GENERIC=y
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From daed33d0944439dd9239057763b5e03bd9dd379f Mon Sep 17 00:00:00 2001
From: schwar3kat <61094841+schwar3kat@users.noreply.github.com>
Date: Sun, 3 Apr 2022 00:20:50 +1300
Subject: [PATCH] fix-gpio-kconfig remove if EXPERT to allow normal build

Signed-off-by: schwar3kat <61094841+schwar3kat@users.noreply.github.com>
---
drivers/gpio/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index 947474f6a..0458a96a7 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -59,7 +59,7 @@ config DEBUG_GPIO
that are most common when setting up new platforms or boards.

config GPIO_SYSFS
- bool "/sys/class/gpio/... (sysfs interface)" if EXPERT
+ bool "/sys/class/gpio/... (sysfs interface)"
depends on SYSFS
select GPIO_CDEV # We need to encourage the new ABI
help
--


1 change: 1 addition & 0 deletions patch/kernel/archive/sunxi-6.6/series.armbian
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
patches.armbian/drv-iio-sun4i-gpadc-iio-don-t-force-poweroff.patch
patches.armbian/drv-staging-media-sunxi-cedrus-add-H616-variant.patch
patches.armbian/drv-soc-sunxi-sram-Add-SRAM-C1-H616-handling.patch
patches.armbian/drv-gpio-sysfs-without-expert.patch
###################
- patches.armbian/drv-media-cedrus-hevc-tiles-hack.patch
- patches.armbian/drv-media-cedrus-Add-callback-for-buffer-cleanup.patch
Expand Down
1 change: 1 addition & 0 deletions patch/kernel/archive/sunxi-6.6/series.conf
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@
patches.armbian/drv-iio-sun4i-gpadc-iio-don-t-force-poweroff.patch
patches.armbian/drv-staging-media-sunxi-cedrus-add-H616-variant.patch
patches.armbian/drv-soc-sunxi-sram-Add-SRAM-C1-H616-handling.patch
patches.armbian/drv-gpio-sysfs-without-expert.patch
###################
- patches.armbian/drv-media-cedrus-hevc-tiles-hack.patch
- patches.armbian/drv-media-cedrus-Add-callback-for-buffer-cleanup.patch
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From daed33d0944439dd9239057763b5e03bd9dd379f Mon Sep 17 00:00:00 2001
From: schwar3kat <61094841+schwar3kat@users.noreply.github.com>
Date: Sun, 3 Apr 2022 00:20:50 +1300
Subject: [PATCH] fix-gpio-kconfig remove if EXPERT to allow normal build

Signed-off-by: schwar3kat <61094841+schwar3kat@users.noreply.github.com>
---
drivers/gpio/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index 947474f6a..0458a96a7 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -59,7 +59,7 @@ config DEBUG_GPIO
that are most common when setting up new platforms or boards.

config GPIO_SYSFS
- bool "/sys/class/gpio/... (sysfs interface)" if EXPERT
+ bool "/sys/class/gpio/... (sysfs interface)"
depends on SYSFS
select GPIO_CDEV # We need to encourage the new ABI
help
--


1 change: 1 addition & 0 deletions patch/kernel/archive/sunxi-6.7/series.armbian
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
patches.armbian/drv-iio-sun4i-gpadc-iio-don-t-force-poweroff.patch
patches.armbian/drv-staging-media-sunxi-cedrus-add-H616-variant.patch
patches.armbian/drv-soc-sunxi-sram-Add-SRAM-C1-H616-handling.patch
patches.armbian/drv-gpio-sysfs-without-expert.patch
###################
- patches.armbian/drv-media-cedrus-hevc-tiles-hack.patch
- patches.armbian/drv-media-cedrus-Add-callback-for-buffer-cleanup.patch
Expand Down
1 change: 1 addition & 0 deletions patch/kernel/archive/sunxi-6.7/series.conf
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@
patches.armbian/drv-iio-sun4i-gpadc-iio-don-t-force-poweroff.patch
patches.armbian/drv-staging-media-sunxi-cedrus-add-H616-variant.patch
patches.armbian/drv-soc-sunxi-sram-Add-SRAM-C1-H616-handling.patch
patches.armbian/drv-gpio-sysfs-without-expert.patch
###################
- patches.armbian/drv-media-cedrus-hevc-tiles-hack.patch
- patches.armbian/drv-media-cedrus-Add-callback-for-buffer-cleanup.patch
Expand Down

0 comments on commit cafc178

Please sign in to comment.