2021-09-13
00:34quarkyalice has joined #asahi-re
01:26riker77_ has joined #asahi-re
01:31riker77 has quit [Ping timeout: 480 seconds]
01:31riker77_ is now known as riker77
02:55phiologe has joined #asahi-re
02:59PhilippvK has quit [Ping timeout: 480 seconds]
04:39quarkyalice has quit [Ping timeout: 480 seconds]
05:16quarkyalice has joined #asahi-re
05:33marcansven: even if it were a separate i2c bus to expose to other drivers, that could just be provided by the dcp node
05:33marcanthe rtkit node is about us having multiple *drivers* (potentially different modules) bind to rtkit directly
05:33marcanI don't think we have a good reason to do that; all the endpoints can be bundled together in dcp.ko
05:34marcanit can still expose whatever zillion interfaces we feel like to userspace or other drivers
05:34marcannothing terribly wrong with a monolithic driver like that, and considering how many hacks Apple has in their model, if we tried to modularize it we'd probably have a bunch of abstraction breaks anyway...
05:35marcanre 2 i2c buses, I saw two exposed externally via those debug PD modes and now I wonder if they're those two
05:37quarkyalice has quit [Ping timeout: 480 seconds]
05:55sveni'm fairly sure at this point the secondary bus of those usb pd chips is connected to the smc directly
06:04akemin_dayo has joined #asahi-re
07:16svenyeah. i'll have to fix the linux driver a bit anyway because right now it also treats IntMask1 and IntMask2 the same.
07:16svenand change the irq numbers to what apple uses. they don't seem to line up with the TI ones :/
07:20svenand then ofc see if there's a sane way to forward usb connected interrupts to the phy driver (possibly just a virtual irq chip) so that usb hotplug finally works
07:30sventhere's also this whole extcon thing that seems to be somehow related to usb which also seems to have some kind of notification system
07:33marcanhttps://github.com/torvalds/linux/blob/master/drivers/extcon/extcon-palmas.c uses it for vbus notifications
07:33marcanbut this sounds like something generally useful for Type C, except I assume Linux already has some Type C shenanigans?
07:34marcanhttps://github.com/torvalds/linux/blob/master/drivers/extcon/extcon-usb-gpio.c a simple GPIO one
07:34marcanoh https://github.com/torvalds/linux/blob/master/drivers/extcon/extcon-usbc-cros-ec.c uses it for typec
07:34marcanmaybe this *is* the thing to use? but if so, shouldn't the TI driver already be using it?
07:35sventhere'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)
07:42marcanwell, I'm just wondering if this is one of "there are two competing ways to do this in linux" cases
07:50marcansven: I already took over the power management stuff, I should probably stay here for a while :>
07:53marcanthat role switch stuff, dwc3 uses it, see CONFIG_USB_ROLE_SWITCH and dwc3_usb_role_switch_set
07:53marcanif 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
07:55marcanand it should just be a matter of making sure it actually works as intended, and that dwc3 can use the HOST -> NONE -> HOST transition to reset itself
07:56marcanI don't know if anyone else actually relies on the roleswitch for hotplugs within a mode, but well
07:56sveneventually we may or may not need to do more thanks to thunderbolt (ugh) but this might work for now
07:57marcanI'm guessing there are no devicetrees with thunderbolt, seeing as, well, intel monopolized that and it's ACPI-mediated...
07:59sventhe interrupt handling is also broken. it requests a shared interrupt but always returns IRQ_HANDLED
07:59svennot a big deal and a quick fix, but i guess apple is the first one to use two of these chips on the same irq line
08:03marcansven: current conclusion: this is all made of fail for altmodes and we need to fix core code :p
08:11sven(and then reset the whole machine 2 minutes later because i probably skipped all the phy init and some internal state dies but those are details :-P)
11:23alyssa(I have a type-C to type-A + HDMI cable that's tunnelling displayport internally .. I don't think that's tbolt though right?)
11:25svenmy dock does usb-c to uhh... displayport,ethernet,like 10 or so usb3 ports, sound and a sd card slot for some reason
12:29X-Scale has joined #asahi-re
13:09marcanalyssa: I have an offer from a dock company to send me over some free ones to bring this up :>
13:26jbowen has quit [Quit: leaving]
13:26jbowen has joined #asahi-re
13:51yuyichao has quit [Ping timeout: 480 seconds]
16:39riker77 has quit [Quit: Quitting IRC - gone for good...]
16:50riker77 has joined #asahi-re
17:54austriancoder has quit []
17:54austriancoder has joined #asahi-re
18:30yuyichao has joined #asahi-re
18:30mindfreeze has quit []
18:30mindfreeze has joined #asahi-re
19:00quarkyalice has joined #asahi-re
19:01quarkyalice has quit [Remote host closed the connection]
20:47nsklaus_ has joined #asahi-re
20:53nsklaus has quit [Ping timeout: 480 seconds]
23:18yuyichao_ has joined #asahi-re
23:22yuyichao has quit [Ping timeout: 480 seconds]
23:55DarkShadow4444 has joined #asahi-re
23:56DarkShadow4444 has quit []