Pi 5: Unable to Disable "lg" GPIO Driver via Overlay or Kernel Command Line (HATs Cannot Access GPIO)
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- c, linux, raspberry-pi
- Domain
- embedded-iot, operating-systems
Research direction
Start by reproducing the reported state with gpioinfo after applying dtoverlay=gpio-no-lg in /boot/firmware/config.txt and gpiolib_lg=0 in /boot/firmware/cmdline.txt. Trace how the Raspberry Pi 5 "lg" GPIO driver handles those settings; done means GPIO17 and GPIO22 are no longer claimed and the HAT can access them.
Written by the indexing model from the issue text.
Description
Describe the bug
Summary:
On Raspberry Pi 5 running Raspberry Pi OS Bookworm (kernel 6.12.25, aarch64), the new "lg" GPIO driver claims GPIO pins (e.g., 17 and 22) by default. Attempts to disable the "lg" driver using dtoverlay=gpio-no-lg in /boot/firmware/config.txt or gpiolib_lg=0 in /boot/firmware/cmdline.txt have no effect. This prevents HATs like the Pimoroni Inky Impression from working, as they cannot access the required GPIO pins.
Steps to reproduce the behaviour
Steps to Reproduce:
- Fresh install of Raspberry Pi OS Bookworm (64-bit) on Raspberry Pi 5.
- Add
dtoverlay=gpio-no-lgto/boot/firmware/config.txtand reboot. - Alternatively, add
gpiolib_lg=0to/boot/firmware/cmdline.txtand reboot. - Check pin status with
gpioinfo | grep -E "17|22".
Device (s)
Raspberry Pi 5
Bootloader configuration.
Expected Result:
GPIO17 and GPIO22 should be unused and available for HATs after disabling the "lg" driver.
Actual Result:
GPIO17 and GPIO22 remain claimed by the "lg" driver, regardless of overlay or kernel command line settings.
Diagnostics:
/boot/firmware/config.txt(last lines):dtoverlay=i2c1 dtoverlay=i2c1-pi5 dtoverlay=spi0-0cs dtoverlay=gpio-no-lg/boot/firmware/cmdline.txt(added at end of line):
gpiolib_lg=0uname -a:Linux raspberrypi 6.12.25+rpt-rpi-v8 raspberrypi/rpi-eeprom#1 SMP PREEMPT Debian 1:6.12.25-1+rpt1 (2025-04-30) aarch64 GNU/Linuxcat /etc/os-release:PRETTY_NAME="Raspbian GNU/Linux 12 (bookworm)"gpioinfo | grep -E "17|22"(after reboot):line 17: "GPIO17" "lg" output active-high [used] line 22: "GPIO22" "lg" input active-high [used pull-up]
What I've Tried:
- Verified correct config file (
/boot/firmware/config.txt). - Tried both overlay and kernel command line methods.
- Fully updated OS and firmware.
- Rebooted after each change.
Impact:
This prevents use of HATs and add-ons that require direct GPIO access on Pi 5 with Bookworm.
Request:
Please advise on a workaround or fix, or clarify if this is a known issue with the current Pi 5/Bookworm stack.
Thank you!
System
No response
Bootloader logs
No response
USB boot
No response
NVMe boot
No response
Network (TFTP boot)
No response
- Dominant language
- C
- Stars
- 13.2k
- Forks
- 5.5k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 21
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from raspberrypi/linux
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
raspberrypi/linux#7415 · 2 comments · 1 reaction ·
-
rp1-cfe doesn't forward V4L2_EVENT_SOURCE_CHANGE event from csi-2 sensor driver to userspace app Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
raspberrypi/linux#7399 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
raspberrypi/linux#7357 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
raspberrypi/linux#7054 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
raspberrypi/linux#7634 · 8 comments · 1 reaction ·
All issues in raspberrypi/linux
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
zephyrproject-rtos/zephyr#119726 ·
-
[Bounty proposal] fix(web): memory insights count an evening memory on the next day ($25 proposed) Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
BasedHardware/omi#15320 ·
-
[adam] AdamNet network read doesn't cap to MAX_ADAM_PACKET_LEN, overflows client receive buffers Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
FujiNetWIFI/fujinet-firmware#1649 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
HarbourMasters/Shipwright#7229 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
riscv-software-src/riscv-isa-sim#2435 · 1 comment ·