Rajmohan Mani has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40024 )
Change subject: google/chromeec: Add USB MUX Interrupt ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/c/coreboot/+/40024/3/src/ec/google/chromeec/acpi... File src/ec/google/chromeec/acpi/ec.asl:
https://review.coreboot.org/c/coreboot/+/40024/3/src/ec/google/chromeec/acpi... PS3, Line 369: // USB MUX Interrupt : Method (_Q1C, 0, NotSerialized) : { : Store ("EC: USB MUX", Debug) : Notify (CREC, 0x80) : }
Got it. Thanks for the context! […]
_Qxx methods are exposed by the EC driver through ACPI listings for the EC device, to handle GPE events that is raised from a GPE bit tied to an EC. Once a GPE event occurs (Type-C event in this case), the OS ACPI layer will invoke _Q1C() associated with EC.
EC_HOST_EVENT_USB_MUX is 0x1C, so we have this _Q1C handler being called.I added EC_HOST_EVENT_MASK(EC_HOST_EVENT_USB_MUX) bit to MAINBOARD_EC_SCI_EVENTS in src/mainboard/google/<boardname>/variants/baseboard/include/baseboard/ec.h, so that we register for EC_HOST_EVENT_USB_MUX events.
I don't have much depth on EC, but EC_HOST_EVENT_USB_MUX seems intuitive for Type-C / USB events. If there is a way, we can get _Q16() / EC_HOST_EVENT_PD_MCU handler, invoked for Type-C events, we can simply drop this CL and remove support for EC_HOST_EVENT_USB_MUX. But if using EC_HOST_EVENT_USB_MUX is recommended / correct way of handling Type-C events, calling required handler from here may not be a hack IMO.