Hi,

the newer Geyser 2 touchpad has only 9 sensors in the Y-direction instead
of 16 like the other Apple touch pads.
The driver sets sc_y_sensors correctly and then immediately overwrites
it with the wrong default.
I think we should first set the defaults and then treat the special
cases.

ok?

Index: utpms.c
===================================================================
RCS file: /mount/openbsd/cvs/src/sys/dev/usb/utpms.c,v
retrieving revision 1.9
diff -u -p -r1.9 utpms.c
--- utpms.c     25 Aug 2020 14:01:58 -0000      1.9
+++ utpms.c     9 Sep 2020 22:45:42 -0000
@@ -311,6 +311,13 @@ utpms_attach(struct device *parent, stru
                for (i = 0; i < nitems(utpms_devices); i++) {
                        pd = &utpms_devices[i];
                        if (product == pd->product && vendor == pd->vendor) {
+                               printf(" Trackpad\n");
+                               sc->sc_noise = pd->noise;
+                               sc->sc_threshold = pd->threshold;
+                               sc->sc_x_factor = pd->x_factor;
+                               sc->sc_x_sensors = pd->x_sensors;
+                               sc->sc_y_factor = pd->y_factor;
+                               sc->sc_y_sensors = pd->y_sensors;
                                switch (pd->type) {
                                case FOUNTAIN:
                                        printf(": Fountain");
@@ -325,13 +332,6 @@ utpms_attach(struct device *parent, stru
                                        printf(": Geyser 2");
                                        break;
                                }
-                               printf(" Trackpad\n");
-                               sc->sc_noise = pd->noise;
-                               sc->sc_threshold = pd->threshold;
-                               sc->sc_x_factor = pd->x_factor;
-                               sc->sc_x_sensors = pd->x_sensors;
-                               sc->sc_y_factor = pd->y_factor;
-                               sc->sc_y_sensors = pd->y_sensors;
                                break;
                        }
                }

Reply via email to