[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
Open
Conversation
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>
Collaborator
BaseOS Kernel ReviewWarning
|
Collaborator
|
Contributor
PR Validation ReportPatchscan ✅ No Missing FixesAll cherry-picked commits checked — no missing upstream fixes found. PR Lint ❌ Errors foundDetailsChecking 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.