Pi 5: Unable to Disable "lg" GPIO Driver via Overlay or Kernel Command Line (HATs Cannot Access GPIO)

Open
#6,932 5 comments 0 reactions 0 assignees View on GitHub

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

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

Possible AI hallucination
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:

  1. Fresh install of Raspberry Pi OS Bookworm (64-bit) on Raspberry Pi 5.
  2. Add dtoverlay=gpio-no-lg to /boot/firmware/config.txt and reboot.
  3. Alternatively, add gpiolib_lg=0 to /boot/firmware/cmdline.txt and reboot.
  4. 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=0
  • uname -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/Linux
    
  • cat /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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from raspberrypi/linux

All issues in raspberrypi/linux

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.