fw: wire USB HID power commands to power_suspend and add PTN3460 safeguards - #16
Open
genneth wants to merge 1 commit into
Open
fw: wire USB HID power commands to power_suspend and add PTN3460 safeguards#16genneth wants to merge 1 commit into
genneth wants to merge 1 commit into
Conversation
UavL
added a commit
to UavL/Glider
that referenced
this pull request
Aug 2, 2026
Cherry-picked from the ptn3460.c portion of upstream PR Modos-Labs#16 (Modos-Labs#16, genneth:feat/hid-power-control, commit ced3fa1 "fw: hook USB HID power commands to power_suspend and add PTN3460 safeguards"). Two independent fixes: - ptn3460_init() logged "PTN3460 boot timeout" after 500 ticks but kept looping forever, so a PTN3460 that never raises DP_HPD hangs ui_task before the display pipeline ever starts. Break out instead. - ptn3460_early_init() drove DP_PDN high and immediately returned; give the part 50 ms to come out of power-down before the first I2C access. The usbapp.c portion of PR Modos-Labs#16 is deliberately NOT taken: this tree already wires USBCMD_POWERDOWN/USBCMD_POWERUP through power_post_request(), which defers the work to ui_task. PR Modos-Labs#16 instead calls power_suspend() directly from the TinyUSB HID set_report callback, which would race ui_task's FPGA CSR polling. Not compile-verified: no arm-none-eabi toolchain in this environment.
UavL
added a commit
to UavL/Glider
that referenced
this pull request
Aug 2, 2026
…riage Static analysis of the video-loss path, power/suspend state machine, and upstream PRs Modos-Labs#16 and Modos-Labs#17, plus an ordered hardware test plan. No hardware was observed; every claim is labelled code-derived, inferred, estimated, or needing a test.
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.
This PR completes the stubbed USB HID power control commands (
USBCMD_POWERDOWNandUSBCMD_POWERUP) infw/User/usbapp.cby wiring them to the newpower_suspend(POWER_SUSPEND_USER)andpower_request_resume(POWER_WAKE_USB)APIs.It also adds two DisplayPort bridge (PTN3460) safeguards:
ptn3460_early_init()to allow the chip's internal bootloader to finish powering up before receiving I2C writes.break;inside the HPD boot timeout condition inptn3460_init()to prevent an infinite loop if HPD fails to assert.Replaces #15.