Repository navigation
usb: typec: tipd: key the native display HPD path on a DT property, not T8140/T8142 - #2399
Draft
RyanTheTide wants to merge 2 commits into
Draft
RyanTheTide wants to merge 2 commits into
RyanTheTide wants to merge 2 commits into
Conversation
Three CD321x/SN201202x display policies were keyed on the SoC: on T8140 and T8142 the driver does not follow the partner's DP status (event 37 stays masked), does not synthesize an IRQ_HPD pulse for a quick HPD low/high, and does not send the display connector a recheck when a USB4 route starts. The reason is the display route, not the SoC: on those machines the display coprocessor's Type-C route has its own HPD path, which is why the gates came with it (46e2253: "Integration's DP status interrupt and its HPD rules stay off on those SoCs"). A new board with the same route would need another compatible in three places. Describe it on the controller instead: apple,display-native-hpd, read in tipd_init() into tps->display_native_hpd, and set on every SN201202x node of the T8140 and T8142 boards (J700, J704, J813, J815). Those boards keep their behavior, and every other board is unchanged. h17_display was also only set in tipd_resume(), so it was false from probe until the first resume on T8140 and T8142. The property is read at probe, so the IRQ_HPD rule holds from boot. Fixes: 7220ae0 ("usb: typec: tipd: follow the DP status of an SN201202x partner") Fixes: 3c9a8c5 ("usb: typec: tipd: key the CD321x display route on the selected mode") Fixes: 46e2253 ("usb: typec: keep the H17 display route handshake") Suggested-by: Chris Kearney <303316+iconidentify@users.noreply.github.com> Suggested-by: Diljit Singh <hey@djdev.me> Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…iption The description of apple,display-native-hpd has a ": " in a plain scalar, which YAML reads as a mapping, so the schema does not parse. Make it a literal block. Fixes: ea26780 ("usb: typec: tipd: key the native display HPD path on a DT property") Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
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.
Problem
drivers/usb/typec/tipd/core.cpicks three DisplayPort policies by SoC compatible:cd321x_uses_dp_sid():!apple,t8140 && !apple,t8142. Follow the partner's DP status (event 37). From 7220ae0, scoped in the adaptation.cd321x_update_work():!apple,t8140 && !apple,t8142. On a USB4 start, ask the display connector to recheck. From 3c9a8c5.tipd_resume():h17_display = apple,t8140 || apple,t8142. Do not synthesize an IRQ_HPD pulse. From 46e2253.The reason is not the SoC. On those machines the display coprocessor's Type-C route has its own HPD path (46e2253: "Integration's DP status interrupt and its HPD rules stay off on those SoCs"). A new board with that route would need its compatible added in three places.
h17_displaywas also set only intipd_resume(), so it was false from probe until the first resume.Change
apple,display-native-hpdon the SN201202x node (documented inapple,sn201202x.yaml).tipd_init()reads it intotps->display_native_hpd, and the three sites use that flag.t8140-j700.dts(2),t8142-j704-usb.dtsi(3),t8142-j813-usb.dtsi(2, used by J813 and J815).DT coverage
From
dtc -I dtb -O dtsof the built DTBs:t8140-j700,t8142-j704,t8142-j813andt8142-j815are every T8140/T8142 DTB in the Makefile.Credit
Chris Kearney wrote the DP status follow and the display-route keying (7220ae0, 3c9a8c5). Diljit Singh wrote the H17 route handshake (46e2253). Both are credited with Suggested-by.
Testing
Build (buildbox, LLVM=1, release config +
TYPEC_SN201202X=m, both tipd KUnit suites=m,TYPEC_TPS6598X_DEBUG_COMMANDS=y, W=1), tree = this branch plus #2398:make -j8 W=1 drivers/usb/typec/tipd/passes.core.o,i2c.o,spmi.oand all six KUnit test objects build. The only warning is the existingi2c.c:21enum cast, which is untouched.KUnit was not run: the build host is at load ~450. The test objects compile.
DTBs build:
apple/t8140-j700 t8142-j704 t8142-j813 t8142-j815 t6040-j616s t6041-j614c. The binding YAML parses. dtschema is not installed on the build host, sodt_binding_checkwas not run.Still to run
Hardware rows: pending.
ls /sys/class/typecshows port0 and port1. With the dock and display on the rear port: hot-unplug and replug the display. Expect the display to come back as on the current kernel, and no "Invalid DP pin assignment" or mux errors injournalctl -k -b | grep -iE 'cd321x|sn201202x|typec'.Assisted-by: LLM (Claude:Opus 5.5)