Michael Niewöhner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/47417 )
Change subject: mb/google/hatch: Configure IRQs as level triggered for HID over I2C ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/47417/2/src/mainboard/google/hatch/... File src/mainboard/google/hatch/variants/baseboard/gpio.c:
https://review.coreboot.org/c/coreboot/+/47417/2/src/mainboard/google/hatch/... PS2, Line 182: PAD_CFG_GPI_APIC(GPP_D16, NONE, PLTRST, LEVEL, NONE),
Ah interesting. I believe it is because the pad is configured for two routes:
- IOAPIC
- SCI (wake)
SCI (wake) needs to be triggered on invert. I just checked the code in gpio_configure_itss() > and it applies another inversion if the pad is configured for INVERT i.e. signal coming into > the pad is inverted because of the INVERT here and ITSS inverts it again before the signal > > hits IOAPIC. Thus, the signal at IOAPIC is inverted twice effectively resulting in the signal > at pad input being transmitted to the IOAPIC as is.
Given that, your initial question about applying inversion would work for GPP_D16 too here. But, it is not required because the signal is not dual routed.
Aha! That makes sense, thank you!
Reading the comment in src/soc/intel/common/block/gpio/gpio.c:gpio_configure_itss() the GPI needs to be set to _LOW as well, since the "ITSS takes only active high interrupt signals" (while the touchpad issues an active-low interrupt).
I am pretty sure that limitation was only on APL/GLK. I will have to dig through my notes, but I don't think any other platforms have the restriction of ITSS taking only active high interrupt signals.
Ah, if that's the case, we should probably skip that code on other platforms.
I found another one: src/mainboard/google/deltaur/variants/baseboard 194 /* E1 : GPP_E1 ==> TOUCH_SCREEN_INT# */ 195 PAD_CFG_GPI_APIC(GPP_E1, NONE, PLTRST, LEVEL, INVERT),
src/mainboard/google/deltaur/variants/deltan/overridetree.cb 11 chip drivers/i2c/generic 12 register "hid" = ""MLFS0000"" 13 register "desc" = ""Melfas Touchscreen"" 14 register "irq" = "ACPI_IRQ_EDGE_LOW(GPP_E1_IRQ)"
I guess in that case it wouldn't matter, since it's inverted twice by the code then, right?