Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31815 )
Change subject: mb/google/hatch: Add GPIO_A8 for Pen detect function ......................................................................
Patch Set 5:
(1 comment)
https://review.coreboot.org/#/c/31815/3/src/mainboard/google/hatch/variants/... File src/mainboard/google/hatch/variants/baseboard/devicetree.cb:
https://review.coreboot.org/#/c/31815/3/src/mainboard/google/hatch/variants/... PS3, Line 236: ACPI_GPIO_INPUT_ACTIVE_LOW
It only has a switch on proto to test now. When you press the switch, the value of evtest is 0. […]
Correct. So, as you indicated, pen inserted i.e. switch press thus GPP_A8 goes high. When pen is ejected i.e. switch released thus GPP_A8 goes low.
From Linux kernel perspective, this GPIO key is interpreted as "Pen inserted" indicated by the switch event SW_PEN_INSERTED (https://chromium.googlesource.com/chromiumos/third_party/kernel/+/refs/heads...). As the defintion says, insert is indicated by set. Thus, the gpio is active high i.e. when pen is inserted, the gpio reads high, so evtest should read high. When pen is ejected, gpio reads low and so evtest should read low.
So, it should be configured as ACPI_GPIO_INPUT_ACTIVE_HIGH.