This patch adds the wsmouse_configure call to iatp. I haven't
seen it running, so it would be nice if someone could confirm that
the change doesn't introduce regressions, and check whether it
works with both synaptics(4) and ws(4).
Index: iatp.c
===================================================================
RCS file: /cvs/src/sys/dev/i2c/iatp.c,v
retrieving revision 1.3
diff -u -p -r1.3 iatp.c
--- iatp.c 24 Sep 2016 18:32:18 -0000 1.3
+++ iatp.c 8 Oct 2017 19:27:13 -0000
@@ -319,6 +319,30 @@ iatp_activate(struct device *self, int a
}
int
+iatp_configure(struct iatp_softc *sc)
+{
+ struct wsmousehw *hw;
+
+ hw = wsmouse_get_hw(sc->sc_wsmousedev);
+ if (sc->sc_touchpad) {
+ hw->type = WSMOUSE_TYPE_SYNAPTICS;
+ hw->hw_type = WSMOUSEHW_CLICKPAD;
+ } else {
+ hw->type = WSMOUSE_TYPE_TPANEL;
+ hw->hw_type = WSMOUSEHW_TPANEL;
+ }
+ hw->x_min = sc->sc_tsscale.minx;
+ hw->x_max = sc->sc_tsscale.maxx;
+ hw->y_min = sc->sc_tsscale.miny;
+ hw->y_max = sc->sc_tsscale.maxy;
+ hw->h_res = sc->sc_tsscale.resx;
+ hw->v_res = sc->sc_tsscale.resy;
+ hw->mt_slots = sc->num_touchids;
+
+ return (wsmouse_configure(sc->sc_wsmousedev, NULL, 0));
+}
+
+int
iatp_enable(void *v)
{
struct iatp_softc *sc = v;
@@ -333,13 +357,10 @@ iatp_enable(void *v)
DPRINTF(("%s: enabling\n", sc->sc_dev.dv_xname));
- if (wsmouse_mt_init(sc->sc_wsmousedev, sc->num_touchids, 0)) {
- printf("%s: failed wsmouse_mt_init\n", sc->sc_dev.dv_xname);
+ if (iatp_configure(sc)) {
+ printf("%s: failed wsmouse_configure\n", sc->sc_dev.dv_xname);
return 1;
}
-
- if (sc->sc_touchpad)
- wsmouse_set_mode(sc->sc_wsmousedev, WSMOUSE_COMPAT);
/* force a read of any pending messages so we start getting new
* interrupts */