forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 13
arm64: dts: rockchip: flipper-one: wire Type-C up port VBUS to the connector #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
munzzyy
wants to merge
1
commit into
flipperdevices:flipper-devel
Choose a base branch
from
munzzyy:vbus-connector-move
base: flipper-devel
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work, because a generic Type-C connector which is not managed by an actual device (such as the mux here) has no idea how or when to switch the VBUS on or off. It's just the dumb receptacle on the board.
VBUS management is a feature of the mux controller, so the property must belong there (either directly or in a subnode)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the driver already does exactly that, and there's a mainline board relying on it.
hd3ss3220 is the thing that requests VBUS, and it doesn't look on its own node. With no
connectorchild it walks the graph to the connector and looks there:arch/arm64/boot/dts/qcom/lemans-evk.dtshas the same shape this patch produces: a standaloneconnector-0withcompatible = "usb-c-connector"carryingvbus-supply = <&usb0_vbus>, whoseport@1endpoint links to the hd3ss3220'sport@0. That board depends on the lookup succeeding, sinceid-gpiosis only read whenhd3ss3220->vbuscame back non-NULL, and its whole VBUS-follows-ID behaviour hangs off that.It's also where the feature came from.
f8d2bf7c0c5d("usb: typec: hd3ss3220: Enable VBUS based on ID pin state") is Krishna Kurapati's, reviewed by Heikki Krogerus, and lemans-evk is the Qualcomm board it was written against.On the modelling point, I don't think we disagree. VBUS management stays with the mux, and the mux driver is still what enables and disables the regulator.
vbus-supplyon the connector isn't claiming the receptacle manages anything, it describes which regulator feeds that receptacle's VBUS pin, which is whyusb-connector.yamlis where the property is defined rather than in each controller's binding.If you'd still rather it sat on
&usbmux, that's possible but it needs two upstream changes first: a binding change, becauseti,hd3ss3220.yamlisadditionalProperties: falseand describes neithervbus-supplynor aconnectorsubnode, and a driver change, because nothing looks for the regulator on the mux node today. I'm happy to write both if that's the shape you want. The connector placement is just the one that works with no upstream changes at all.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more thing on the subnode option, since that's the other shape you floated and I don't think it does what we'd want here.
Adding a
connectorchild to&usbmuxchanges which branch probe takes:A bare
connector { vbus-supply = <&vusb_typec_up>; }has nousb-role-switchreference, and its parent is the mux rather than a role switch, sofwnode_usb_role_switch_get()comes back NULL. NULL isn't an error, so probe carries on happily, and thenusb_role_switch_set_role()opens withif (IS_ERR_OR_NULL(sw)) return 0;. Role switching would go quietly dead: no probe failure, nothing in dmesg. Same shape of bug as the VBUS one.To use the subnode we'd have to re-describe the role-switch link inside it too, on top of a binding patch to allow
connectorat all.So the three shapes, as I see them:
qcom/lemans-evk.dtsconnectorsubnode of the mux: binding patch, plus re-wiring the role switch into the subnode or role switching silently stops&usbmux: binding patch plus a driver patch, since nothing reads the regulator from the mux node todayHappy to write the patches for either of the bottom two if that's the shape you want. I just wanted the tradeoff visible before we pick one.