#
#asahi-re · 2021-09-13 07:55
marcanand tipd calls it (see tps6598x_set_data_role)
#asahi-re · 2021-09-13 07:55
svenok, now i get what you mean
#asahi-re · 2021-09-13 07:55
marcandwc3 is a role switch provider (see dwc3_setup_role_switch)
#asahi-re · 2021-09-13 07:55
svenoh
#asahi-re · 2021-09-13 07:54
marcanthe call path is ti -> dwc3
#asahi-re · 2021-09-13 07:54
marcansure, but I mean
#asahi-re · 2021-09-13 07:54
sven(in gadget mode. i think in host mode it does)
#asahi-re · 2021-09-13 07:54
marcanand that should be enough to get hotplug to work
#asahi-re · 2021-09-13 07:54
svenno, i mean, dwc3 doesn't trigger an interrupt for disconnects. not even in m1n1
#asahi-re · 2021-09-13 07:54
marcanthat's what this role switch stuff is for
#asahi-re · 2021-09-13 07:54
marcanbut the mode should be automatic anyway
#asahi-re · 2021-09-13 07:54
marcanvbus presence should be somewhere
#asahi-re · 2021-09-13 07:53
marcanwell, we should
#asahi-re · 2021-09-13 07:53
svenin gadget mode we don't even get disconnect events fwiw
#asahi-re · 2021-09-13 07:53
marcanif the typec controller correctly sets the role to none on disconnect, and dwc3 correctly uses that trigger to reset itself, I bet that'd work
#asahi-re · 2021-09-13 07:53
marcanhowever, it just does some lame default mode thing on disconnect
#asahi-re · 2021-09-13 07:53
marcanthat role switch stuff, dwc3 uses it, see CONFIG_USB_ROLE_SWITCH and dwc3_usb_role_switch_set
#asahi-re · 2021-09-13 07:52
svena thing?
#asahi-re · 2021-09-13 07:52
marcansven: I found a thing though
#asahi-re · 2021-09-13 07:50
marcansven: I already took over the power management stuff, I should probably stay here for a while :>
#asahi-re · 2021-09-13 07:49
marcanj_ey: zsh user \o/
#asahi-re · 2021-09-13 07:49
svenmarcan: i mean, feel free to take over if you want to :D
#asahi-re · 2021-09-13 07:49
j_eysven: reading list: **/*
#asahi-re · 2021-09-13 07:49
marcanok ok :)
#asahi-re · 2021-09-13 07:48
sveni already have a reading list
#asahi-re · 2021-09-13 07:48
svenyeah, i know
#asahi-re · 2021-09-13 07:48
marcansee also include/linux/usb/role.
#asahi-re · 2021-09-13 07:46
svenyup
#asahi-re · 2021-09-13 07:45
marcanI'm getting the feeling very few drivers actually *use* those connector relationships
#asahi-re · 2021-09-13 07:42
svenpossibly
#asahi-re · 2021-09-13 07:42
marcansome typec drivers do extcon, but not this one
#asahi-re · 2021-09-13 07:42
marcanit sure sounds like the typec stuff and extcon overlap
#asahi-re · 2021-09-13 07:42
marcan:p
#asahi-re · 2021-09-13 07:42
marcanwell, I'm just wondering if this is one of "there are two competing ways to do this in linux" cases
#asahi-re · 2021-09-13 07:42
sventhis is not a hard problem, it just requires some reading :D
#asahi-re · 2021-09-13 07:41
svenyes, just need to read that all in detail
#asahi-re · 2021-09-13 07:41
marcanthe one existing dt user of the TI chips uses that to link to dwc3
#asahi-re · 2021-09-13 07:41
marcansven: have you seen Documentation/devicetree/bindings/connector/usb-connector.yaml ?
#asahi-re · 2021-09-13 07:36
svenyeah, that's how i found it
#asahi-re · 2021-09-13 07:36
marcanincluding some dwc3 wrappers
#asahi-re · 2021-09-13 07:35
svenjust requires to spend some time to read more code :)
#asahi-re · 2021-09-13 07:35
marcanvarious PHYs support using this API to get the state
#asahi-re · 2021-09-13 07:35
sventhere's also some typec_ api but at first glance that's mostly about notifying userspace i think (https://www.kernel.org/doc/html/v5.0/driver-api/usb/typec.html)
#asahi-re · 2021-09-13 07:34
marcanmaybe this *is* the thing to use? but if so, shouldn't the TI driver already be using it?
#asahi-re · 2021-09-13 07:34
svenyeah
#asahi-re · 2021-09-13 07:34
marcanoh https://github.com/torvalds/linux/blob/master/drivers/extcon/extcon-usbc-cros-ec.c uses it for typec
#asahi-re · 2021-09-13 07:34
marcanhttps://github.com/torvalds/linux/blob/master/drivers/extcon/extcon-usb-gpio.c a simple GPIO one
#asahi-re · 2021-09-13 07:33
marcanwe should look into how thunderbolt/etc muxing is done
#asahi-re · 2021-09-13 07:33
marcanbut this sounds like something generally useful for Type C, except I assume Linux already has some Type C shenanigans?
#asahi-re · 2021-09-13 07:33
marcanhttps://github.com/torvalds/linux/blob/master/drivers/extcon/extcon-palmas.c uses it for vbus notifications

plus ›