Skip to content

board: orangepi-5b: fix BT host-wake IRQ direction - #10372

Merged
igorpecovnik merged 2 commits into
armbian:mainfrom
defcom5-rockchip:patch-1
Aug 10, 2026
Merged

board: orangepi-5b: fix BT host-wake IRQ direction#10372
igorpecovnik merged 2 commits into
armbian:mainfrom
defcom5-rockchip:patch-1

Conversation

@defcom5-rockchip

@defcom5-rockchip defcom5-rockchip commented Aug 8, 2026

Copy link
Copy Markdown
Member

Description

Fixes #10370.

GPIO0_C5 boots as an output, so gpiochip_lock_as_irq() returns -EIO and the
BT host-wake IRQ never registers - two error lines every boot, and wake-on-BT
does not work. pcfg_pull_down sets bias only, not direction;
PIN_CONFIG_INPUT_ENABLE forces the GPIO mux and calls direction_input().

rockchip-pinconf.dtsi has no pcfg node carrying input-enable (only
pcfg_output_high / pcfg_output_low), so one is declared locally.

Follow-up to #10289, which was untested on the 5B.

How Has This Been Tested?

  • Tested on Orange Pi 5B hardware

Before: gpioinfo shows line 21 as output, unclaimed; no host_wake entry in
/proc/interrupts.

After: line 21 reads input, and the IRQ registers and delivers:

99:  20  0  0  0  0  0  0  0  rockchip_gpio_irq  21 Edge  host_wake

WiFi and Bluetooth are otherwise unchanged. Verified on a mainline 7.1.3 kernel
using this DT wiring rather than via an Armbian build.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings

Summary by CodeRabbit

  • Bug Fixes
    • Improved Bluetooth host-wakeup pin handling on supported Orange Pi 5B devices.
    • Prevented unintended pull-down bias while keeping the wake-up input enabled.

GPIO0_C5 boots as an output, so gpiochip_lock_as_irq() returns -EIO and the
bcm_host_wake IRQ never registers. pcfg_pull_down sets bias only;
PIN_CONFIG_INPUT_ENABLE forces the GPIO mux and calls direction_input().

Tested on Orange Pi 5B: the IRQ registers and delivers, WiFi and Bluetooth
otherwise unchanged.

Fixes armbian#10370.
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The device trees add pcfg_input_enable with disabled bias and enabled input mode. The Bluetooth host-wakeup pin uses this configuration across the Rockchip 6.18, 7.1, and 7.2 device trees.

Changes

Bluetooth host-wakeup configuration

Layer / File(s) Summary
Input-enabled host-wakeup pin
patch/kernel/archive/rockchip64-6.18/dt/rk3588s-orangepi-5b.dts, patch/kernel/archive/rockchip64-7.1/dt/rk3588s-orangepi-5b.dts, patch/kernel/archive/rockchip64-7.2/dt/rk3588s-orangepi-5b.dts
Adds the reusable pcfg_input_enable configuration and applies it to the Bluetooth host-wakeup pin instead of pull-down bias.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

  • armbian/build#10289: Adds the Orange Pi 5B Bluetooth host-wakeup pin configuration updated by this PR.
  • armbian/build#10374: Implements the same Orange Pi 5B Bluetooth host-wake pinctrl fix.

Suggested reviewers: igorpecovnik, iav, superkali, ahoneybun, amazingfate

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes add input-enable configuration for GPIO0_C5 across 7.1, 6.18, and 7.2, satisfying issue #10370.
Out of Scope Changes check ✅ Passed All changes address the linked IRQ issue, and applying the fix to 6.18 and 7.2 is explicitly requested.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: fixing the Orange Pi 5B Bluetooth host-wake IRQ GPIO direction.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added 08 Milestone: Third quarter release Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... labels Aug 8, 2026
@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Hey @defcom5-rockchip! 👋

Thanks for submitting your first pull request to the Armbian project — we're excited to have you contributing! 🧡
Your effort doesn’t just improve Armbian — it benefits the entire community of users and developers.

If you'd like to stay informed about project updates or collaborate more closely with the team,
you can optionally share some personal contact preferences at armbian.com/update-data.
This helps us keep in touch without relying solely on GitHub notifications.

Also, don’t forget to ⭐ star the repo if you haven’t already — and welcome aboard! 🚀

@EvilOlaf

EvilOlaf commented Aug 9, 2026

Copy link
Copy Markdown
Member

changes must go into 6.18 and 7.2 patchsets as well if applicable, otherwise on transition they will be lost

The same bt_wake_host_irq pin config is present in rockchip64-6.18 and
rockchip64-7.2, so the fix would otherwise be lost on transition to either
branch. All three dts files are byte-identical, so this is the same two
hunks applied unchanged.

rockchip64-6.12 has no bt_wake_host_irq node and is not affected.

Tested on hardware with 7.1 only; 6.18 and 7.2 carry the identical pin
config and pinctrl-rockchip has implemented PIN_CONFIG_INPUT_ENABLE for
many releases, but those branches are not separately boot-tested here.
@defcom5-rockchip

Copy link
Copy Markdown
Member Author

Done — added to rockchip64-6.18 and rockchip64-7.2. All three dts files were byte-identical, so it's the same two hunks; the resulting blobs hash the same across all three.

rockchip64-6.12 has no bt_wake_host_irq node, so it isn't affected.

Hardware-tested on 7.1 only — flagged in the commit message.

@github-actions github-actions Bot added the Ready to merge Reviewed, tested and ready for merge label Aug 9, 2026
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

✅ This PR has been reviewed and approved — all set for merge!

@github-actions github-actions Bot removed the Needs review Seeking for review label Aug 9, 2026
@igorpecovnik
igorpecovnik merged commit 948ff52 into armbian:main Aug 10, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

08 Milestone: Third quarter release Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... Ready to merge Reviewed, tested and ready for merge size/small PR with less then 50 lines

Development

Successfully merging this pull request may close these issues.

[Bug]: Orange Pi 5B: AP6275P BT host-wake IRQ fails with -EIO (5B test result for #10289)

3 participants