Skip to content

[26.04_linux-nvidia-bos] pinctrl: mediatek: MT8901 ACPI wake-event EINT support and bus-hold bias - #565

Open
kmaddaraki wants to merge 2 commits into
NVIDIA:26.04_linux-nvidia-bosfrom
kmaddaraki:fastos-pinctrl-bos
Open

[26.04_linux-nvidia-bos] pinctrl: mediatek: MT8901 ACPI wake-event EINT support and bus-hold bias#565
kmaddaraki wants to merge 2 commits into
NVIDIA:26.04_linux-nvidia-bosfrom
kmaddaraki:fastos-pinctrl-bos

Conversation

@kmaddaraki

Copy link
Copy Markdown

Two SAUCE patches for the MediaTek MT8901 pinctrl driver under ACPI, ported from the FastOS kernel.

pinctrl: mt8901: Enable ACPI wake-event EINT support

On MT8901 ACPI platforms some EINT wake sources belong to pins that are owned by firmware and have no Linux consumer driver, so nothing calls enable_irq_wake() for them and the platform cannot be woken from system sleep through those pins. The ACPI GPIO interrupts declared for the controller (_AEI) are also never requested after the pinctrl driver probes, so the ACPI event handlers for those pins do not run. Add a wake-event pin list to mtk_eint that the SoC driver populates, program it on init and resume, force wake_mask for the declared pins so the state survives suspend/resume without a consumer driver, declare the MT8901 event pins in the SoC data, and call acpi_gpiochip_request_interrupts() once the GPIO chip has been added.

pinctrl: mediatek: Add bus-hold bias and program-by-GPIO helper

The MediaTek bias code only knows pull-up and pull-down. The pad bus-keeper mode (PU and PD both enabled) cannot be requested or read back, yet the MT8901 SoundWire pads need it: the SoundWire controller's _CRS carries PinFunction() vendor encodings asking for bus-keeper on the data lines, and without it codec enumeration fails unless the pad registers are written by hand. Add MTK_BUS_HOLD as a third pull mode in the PU/PD path, wire PIN_CONFIG_BIAS_BUS_HOLD through pinctrl-paris get/set, and reject it on the RSEL and R1R0 paths that cannot express it. Register each mtk_pinctrl instance at probe and export mtk_pinctrl_program_bias_by_gpio() through <linux/soc/mediatek/mtk-pinctrl.h> so a client driver can apply pad bias by absolute SoC GPIO number. Nothing in this tree calls the helper yet; the SoundWire manager that consumes it will follow in a separate PR.

Existing DT and pull-up/pull-down behaviour is unchanged.

Ankit Pant and others added 2 commits September 2, 2026 23:03
On MT8901-based ACPI platforms some EINT wake sources belong to pins
that are owned by firmware and have no Linux consumer driver. Nothing
calls enable_irq_wake() for them, so they are never armed as wake
sources and the platform cannot be woken from system sleep through
those pins. In addition, the ACPI GPIO interrupts declared for the
controller (_AEI) are never requested after the pinctrl driver
probes, so ACPI event handlers for those pins do not run.

Add a wake-event pin list to mtk_eint so the SoC driver can declare
the pins that must stay armed. Program them on init and on resume,
and force wake_mask for the declared pins so the state survives
suspend/resume without a consumer driver. Declare the MT8901 event
pins in the pinctrl-mt8901 SoC data, and call
acpi_gpiochip_request_interrupts() once the GPIO chip has been added
so the ACPI GPIO event handlers are installed.

Signed-off-by: Ankit Pant <ankit.pant@mediatek.com>
Signed-off-by: Kiran Maddaraki <kmaddaraki@nvidia.com>
…IO helper

The MediaTek pinctrl bias code only knows pull-up and pull-down. The
pad "bus keeper" mode, with both PU and PD enabled, cannot be
requested or read back, yet the MT8901 SoundWire pads need it: the
ACPI _CRS for the SoundWire controller carries PinFunction() vendor
encodings that ask for bus-keeper on the data lines, and without it
codec enumeration fails unless the pad registers are written by hand.

Add MTK_BUS_HOLD as a third pull mode in the PU/PD bias path and wire
PIN_CONFIG_BIAS_BUS_HOLD through the pinctrl-paris get/set handlers.
The RSEL and R1R0 bias paths cannot express bus-hold and reject it
explicitly. The bias getters report PU=1, PD=1 back as MTK_BUS_HOLD.

Register every mtk_pinctrl instance in a global list at probe and
export mtk_pinctrl_program_bias_by_gpio() through
<linux/soc/mediatek/mtk-pinctrl.h>, so a client driver that parses
PinFunction() vendor encodings from its own _CRS can apply pad bias
by absolute SoC GPIO number without going through pinctrl states.
The instance is unregistered via a devm action so it leaves the list
before devm frees it.

Signed-off-by: shubham.paralikar <shubham.paralikar@mediatek.com>
Signed-off-by: Kiran Maddaraki <kmaddaraki@nvidia.com>
@nirmoy nirmoy added the help wanted Extra attention is needed label Sep 2, 2026
@nirmoy

nirmoy commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

BaseOS Kernel Review

Warning

⚠️ Review needs attention

Generic bias-bus-hold disables both pulls instead of enabling keeper mode. The GPIO helper may also program the wrong controller when local pin numbers overlap, while the wake-mask changelog overstates the implementation.

Findings: Critical 0 · High 1 · Medium 1 · Low 1

🔍 Review artifacts

📦 Kernel deb builds — 🟢 2/2 passed

Note

Build reports and debs are retained for 10 days after the PR closes.

Review metadata
  • Reviewed head: 5b65481a10d2
  • Overall status: attention needed
  • Architectures: 2/2 successful

This comment is maintained by BaseOS Reviewer and updated when the GitHub watcher publishes a newer review.

@nvmochs

nvmochs commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

@kmaddaraki

  • What are the upstream plans for these?
  • Are these related to a specific NVbug?

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

PR Validation Report

Patchscan ✅ No Missing Fixes

All cherry-picked commits checked — no missing upstream fixes found.

PR Lint ❌ Errors found

Details
Checking 2 commits...

Cherry-pick digest:
┌──────────────┬──────────────────────────────────────────────────────────────────┬────────────┬─────────┬───────────────────────────┐
│ Local        │ Referenced upstream / Patch subject                              │ Patch-ID   │ Subject │ SoB chain                 │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 5b65481a10d2 │ [SAUCE] pinctrl: mediatek: add bus-hold bias and program-by-gpio │ N/A        │ N/A     │ paralika, kmaddara        │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 89a9c4ad35a5 │ [SAUCE] pinctrl: mt8901: enable acpi wake-event eint support     │ N/A        │ N/A     │ pant, kmaddara            │
└──────────────┴──────────────────────────────────────────────────────────────────┴────────────┴─────────┴───────────────────────────┘

Lint: all checks passed.

PR metadata:
E: PR targets 26.04_linux-nvidia-bos but body has no https://bugs.launchpad.net/... link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

help wanted Extra attention is needed pending_review_comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants