The following diff *might* solve the issue, but might also break other
systems.

Index: pckbc_acpi.c
===================================================================
RCS file: /OpenBSD/src/sys/dev/acpi/pckbc_acpi.c,v
diff -u -p -r1.2 pckbc_acpi.c
--- pckbc_acpi.c        13 Feb 2025 19:54:44 -0000      1.2
+++ pckbc_acpi.c        28 May 2025 19:57:33 -0000
@@ -80,6 +80,7 @@ struct pckbc_acpi_softc {
        /* gpio interrupts */
        struct pckbc_acpi_gpio_intr sc_gpioint[2];
        unsigned int sc_nints, sc_ngpioints;
+       uint32_t sc_intflags;   /* copy of interrupt flags for sc_ih[0] */
 };
 
 const struct cfattach pckbc_acpi_ca = {
@@ -293,6 +294,8 @@ pckbc_acpi_attach_kbd(struct device *par
                                    self->dv_xname, aaa->aaa_irq[irq]);
                                goto fail_intr;
                        }
+                       if (pasc->sc_nints == 0)
+                               pasc->sc_intflags = aaa->aaa_irq_flags[irq];
                        pasc->sc_nints++;
                }
        }
@@ -384,6 +387,20 @@ pckbc_acpi_attach_mouse(struct device *p
                }
        } else {
                base = pasc->sc_nints;
+               /*
+                * There seem to be systems, such as Panasonic Let's Note CF-NX4
+                * where the keyboard node has correct interrupt flags
+                * (edge-triggered, active high) while the mouse node has
+                * IrqNoFlags and thus would be considered as level-triggered.
+                *
+                * We unconditionally override IrqNoFlags here with the same
+                * flags as the keyboard node, and hope for the best.
+                */
+               if (pasc->sc_nints == 1 &&
+                   (aaa->aaa_irq_flags[0] &
+                    (LR_EXTIRQ_MODE | LR_EXTIRQ_POLARITY)) == 0) {
+                       aaa->aaa_irq_flags[0] = pasc->sc_intflags;
+               }
                for (irq = 0; irq < aaa->aaa_nirq; irq++) {
                        if (pasc->sc_nints == nitems(pasc->sc_ih))
                                break;

Reply via email to