Open avg-I opened 4 years ago
Awesome! That is great to know that a work on support for GPIO interrupts on x86 is started! Thank you!
I'll try to write GPIO controller driver for KabyLake to test your changes as now I gets 'ACPI provides GPIO interrupt, but controller is not attached' message on kldload. But anyway, if you feel that your work is ready for wide testing, I'll accept it and poke port mantainer to update it too. Polling mode became a most evil bug in iichid.c since Greg V caught out-of spec command which kills most of touchpads.
P.S. Although it looks very hackish to steal interrupts from other device driver, it is perfectly OK for out-of-tree iichid. Do you have any work planned to entirely move GPIO interrupt support code to GPIO controller drivers?
P.S.2. opt_platform.h should be added to SRCS in Makefile. otherwise compilation fails with /usr/src/sys/dev/gpio/gpiobusvar.h:35:10: fatal error: 'opt_platform.h' file not found
message
P.S.3. There is DragonflyBSD GPIO driver with support of interrupting that I was going to use as starting point if I would have GPIO work started: https://github.com/DragonFlyBSD/DragonFlyBSD/blob/master/sys/bus/gpio/gpio_acpi/gpio_acpi.c , https://github.com/DragonFlyBSD/DragonFlyBSD/blob/master/sys/bus/gpio/gpio_intel/gpio_intel.c . But now it looks like you re-implemented chunks that could be copy-pasted.
This is a draft pull request just to show what I am working on. Maybe I'll get some advise on the code. Maybe the code will be useful as an example for some other work.
At the moment there is no support for GPIO interrupts on x86, but there is some work in progress. This change shows how to obtain GPIO interrupt configuration from ACPI and to set up scuh an interrupt in a consumer driver. The GPIO side of things will probably have some changes as the work progresses. The ACPI related code is probably fine already.