Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Jan 2021 23:20:51 GMT
From:      Vladimir Kondratyev <wulf@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 5af73ad51b8c - main - evdev: Remove useless "initial value" parameter from evdev_support_abs()
Message-ID:  <202101072320.107NKp3b063425@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by wulf:

URL: https://cgit.FreeBSD.org/src/commit/?id=5af73ad51b8c2e640608af0b7a1982be5c204b96

commit 5af73ad51b8c2e640608af0b7a1982be5c204b96
Author:     Vladimir Kondratyev <wulf@FreeBSD.org>
AuthorDate: 2020-11-30 15:10:41 +0000
Commit:     Vladimir Kondratyev <wulf@FreeBSD.org>
CommitDate: 2021-01-07 23:18:41 +0000

    evdev: Remove useless "initial value" parameter from evdev_support_abs()
    
    It can not be used for setting of state of multitouch events.
    If necessary, use evdev_push_event() instead of it.
---
 sys/arm/broadcom/bcm2835/bcm2835_ft5406.c |  8 ++++----
 sys/arm/ti/ti_adc.c                       |  4 ++--
 sys/dev/atkbdc/psm.c                      |  4 ++--
 sys/dev/cyapa/cyapa.c                     | 14 +++++++-------
 sys/dev/evdev/evdev.c                     |  7 +++----
 sys/dev/evdev/evdev.h                     |  2 +-
 sys/dev/evdev/evdev_mt.c                  |  1 -
 sys/dev/evdev/uinput.c                    |  7 +++----
 sys/dev/usb/input/uep.c                   |  4 ++--
 sys/dev/usb/input/wmt.c                   |  2 +-
 10 files changed, 25 insertions(+), 28 deletions(-)

diff --git a/sys/arm/broadcom/bcm2835/bcm2835_ft5406.c b/sys/arm/broadcom/bcm2835/bcm2835_ft5406.c
index 48fa702f5c46..d9a01b4a929a 100644
--- a/sys/arm/broadcom/bcm2835/bcm2835_ft5406.c
+++ b/sys/arm/broadcom/bcm2835/bcm2835_ft5406.c
@@ -246,13 +246,13 @@ ft5406ts_init(void *arg)
 	evdev_support_event(sc->sc_evdev, EV_SYN);
 	evdev_support_event(sc->sc_evdev, EV_ABS);
 
-	evdev_support_abs(sc->sc_evdev, ABS_MT_SLOT, 0, 0,
+	evdev_support_abs(sc->sc_evdev, ABS_MT_SLOT, 0,
 	    MAX_TOUCH_ID, 0, 0, 0);
-	evdev_support_abs(sc->sc_evdev, ABS_MT_TRACKING_ID, 0, -1,
+	evdev_support_abs(sc->sc_evdev, ABS_MT_TRACKING_ID, -1,
 	    MAX_TOUCH_ID, 0, 0, 0);
-	evdev_support_abs(sc->sc_evdev, ABS_MT_POSITION_X, 0, 0,
+	evdev_support_abs(sc->sc_evdev, ABS_MT_POSITION_X, 0,
 	    SCREEN_WIDTH, 0, 0, SCREEN_RES_X);
-	evdev_support_abs(sc->sc_evdev, ABS_MT_POSITION_Y, 0, 0,
+	evdev_support_abs(sc->sc_evdev, ABS_MT_POSITION_Y, 0,
 	    SCREEN_HEIGHT, 0, 0, SCREEN_RES_Y);
 
 	err = evdev_register_mtx(sc->sc_evdev, &sc->sc_mtx);
diff --git a/sys/arm/ti/ti_adc.c b/sys/arm/ti/ti_adc.c
index 6254fddde5fa..a0091aebf417 100644
--- a/sys/arm/ti/ti_adc.c
+++ b/sys/arm/ti/ti_adc.c
@@ -890,9 +890,9 @@ ti_adc_attach(device_t dev)
 		evdev_support_event(sc->sc_evdev, EV_ABS);
 		evdev_support_event(sc->sc_evdev, EV_KEY);
 
-		evdev_support_abs(sc->sc_evdev, ABS_X, 0, 0,
+		evdev_support_abs(sc->sc_evdev, ABS_X, 0,
 		    ADC_MAX_VALUE, 0, 0, 0);
-		evdev_support_abs(sc->sc_evdev, ABS_Y, 0, 0,
+		evdev_support_abs(sc->sc_evdev, ABS_Y, 0,
 		    ADC_MAX_VALUE, 0, 0, 0);
 
 		evdev_support_key(sc->sc_evdev, BTN_TOUCH);
diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c
index 3774b0a3b734..43d19b5174d3 100644
--- a/sys/dev/atkbdc/psm.c
+++ b/sys/dev/atkbdc/psm.c
@@ -1698,7 +1698,7 @@ psm_support_abs_bulk(struct evdev_dev *evdev, const uint16_t info[][4])
 	size_t i;
 
 	for (i = 0; info[i][0] != ABS_CNT; i++)
-		evdev_support_abs(evdev, info[i][0], 0, info[i][1], info[i][2],
+		evdev_support_abs(evdev, info[i][0], info[i][1], info[i][2],
 		    0, 0, info[i][3]);
 }
 
@@ -1858,7 +1858,7 @@ psm_register_synaptics(device_t dev)
 	if (sc->synhw.capAdvancedGestures || sc->synhw.capReportsV)
 		psm_support_abs_bulk(evdev_a, synaptics_absinfo_mt);
 	if (sc->synhw.capPalmDetect)
-		evdev_support_abs(evdev_a, ABS_TOOL_WIDTH, 0, 0, 15, 0, 0, 0);
+		evdev_support_abs(evdev_a, ABS_TOOL_WIDTH, 0, 15, 0, 0, 0);
 	evdev_support_key(evdev_a, BTN_LEFT);
 	if (!sc->synhw.capClickPad) {
 		evdev_support_key(evdev_a, BTN_RIGHT);
diff --git a/sys/dev/cyapa/cyapa.c b/sys/dev/cyapa/cyapa.c
index caad161cb56a..517ce8d1bab7 100644
--- a/sys/dev/cyapa/cyapa.c
+++ b/sys/dev/cyapa/cyapa.c
@@ -594,13 +594,13 @@ cyapa_attach(device_t dev)
 		evdev_support_prop(sc->evdev, INPUT_PROP_BUTTONPAD);
 
 	evdev_support_abs(sc->evdev, ABS_MT_SLOT,
-	    0, 0, CYAPA_MAX_MT - 1, 0, 0, 0);
-	evdev_support_abs(sc->evdev, ABS_MT_TRACKING_ID, 0, -1, 15, 0, 0, 0);
-	evdev_support_abs(sc->evdev, ABS_MT_POSITION_X, 0, 0, sc->cap_resx,
-	    0, 0, sc->cap_phyx != 0 ? sc->cap_resx / sc->cap_phyx : 0);
-	evdev_support_abs(sc->evdev, ABS_MT_POSITION_Y, 0, 0, sc->cap_resy,
-	    0, 0, sc->cap_phyy != 0 ? sc->cap_resy / sc->cap_phyy : 0);
-	evdev_support_abs(sc->evdev, ABS_MT_PRESSURE, 0, 0, 255, 0, 0, 0);
+	    0, CYAPA_MAX_MT - 1, 0, 0, 0);
+	evdev_support_abs(sc->evdev, ABS_MT_TRACKING_ID, -1, 15, 0, 0, 0);
+	evdev_support_abs(sc->evdev, ABS_MT_POSITION_X, 0, sc->cap_resx, 0, 0,
+	    sc->cap_phyx != 0 ? sc->cap_resx / sc->cap_phyx : 0);
+	evdev_support_abs(sc->evdev, ABS_MT_POSITION_Y, 0, sc->cap_resy, 0, 0,
+	    sc->cap_phyy != 0 ? sc->cap_resy / sc->cap_phyy : 0);
+	evdev_support_abs(sc->evdev, ABS_MT_PRESSURE, 0, 255, 0, 0, 0);
 
 	if (evdev_register(sc->evdev) != 0) {
 		mtx_destroy(&sc->mutex);
diff --git a/sys/dev/evdev/evdev.c b/sys/dev/evdev/evdev.c
index 33db241da27d..8d520e3ac09e 100644
--- a/sys/dev/evdev/evdev.c
+++ b/sys/dev/evdev/evdev.c
@@ -477,16 +477,15 @@ evdev_support_rel(struct evdev_dev *evdev, uint16_t code)
 }
 
 inline void
-evdev_support_abs(struct evdev_dev *evdev, uint16_t code, int32_t value,
-    int32_t minimum, int32_t maximum, int32_t fuzz, int32_t flat,
-    int32_t resolution)
+evdev_support_abs(struct evdev_dev *evdev, uint16_t code, int32_t minimum,
+    int32_t maximum, int32_t fuzz, int32_t flat, int32_t resolution)
 {
 	struct input_absinfo absinfo;
 
 	KASSERT(code < ABS_CNT, ("invalid evdev abs property"));
 
 	absinfo = (struct input_absinfo) {
-		.value = value,
+		.value = 0,
 		.minimum = minimum,
 		.maximum = maximum,
 		.fuzz = fuzz,
diff --git a/sys/dev/evdev/evdev.h b/sys/dev/evdev/evdev.h
index b897a465b338..f584e52fc8e4 100644
--- a/sys/dev/evdev/evdev.h
+++ b/sys/dev/evdev/evdev.h
@@ -117,7 +117,7 @@ void evdev_support_event(struct evdev_dev *, uint16_t);
 void evdev_support_key(struct evdev_dev *, uint16_t);
 void evdev_support_rel(struct evdev_dev *, uint16_t);
 void evdev_support_abs(struct evdev_dev *, uint16_t, int32_t, int32_t, int32_t,
-   int32_t, int32_t, int32_t);
+   int32_t, int32_t);
 void evdev_support_msc(struct evdev_dev *, uint16_t);
 void evdev_support_led(struct evdev_dev *, uint16_t);
 void evdev_support_snd(struct evdev_dev *, uint16_t);
diff --git a/sys/dev/evdev/evdev_mt.c b/sys/dev/evdev/evdev_mt.c
index fc19e497c691..1f9c9756db02 100644
--- a/sys/dev/evdev/evdev_mt.c
+++ b/sys/dev/evdev/evdev_mt.c
@@ -185,7 +185,6 @@ evdev_support_mt_compat(struct evdev_dev *evdev)
 	for (i = 0; i < nitems(evdev_mtstmap); i++)
 		if (bit_test(evdev->ev_abs_flags, evdev_mtstmap[i][0]))
 			evdev_support_abs(evdev, evdev_mtstmap[i][1],
-			    evdev->ev_absinfo[evdev_mtstmap[i][0]].value,
 			    evdev->ev_absinfo[evdev_mtstmap[i][0]].minimum,
 			    evdev->ev_absinfo[evdev_mtstmap[i][0]].maximum,
 			    evdev->ev_absinfo[evdev_mtstmap[i][0]].fuzz,
diff --git a/sys/dev/evdev/uinput.c b/sys/dev/evdev/uinput.c
index 3edf14284a1f..ceecee652ac3 100644
--- a/sys/dev/evdev/uinput.c
+++ b/sys/dev/evdev/uinput.c
@@ -525,10 +525,9 @@ uinput_ioctl_sub(struct uinput_cdev_state *state, u_long cmd, caddr_t data)
 		if (uabs->code > ABS_MAX)
 			return (EINVAL);
 
-		evdev_support_abs(state->ucs_evdev, uabs->code,
-		    uabs->absinfo.value, uabs->absinfo.minimum,
-		    uabs->absinfo.maximum, uabs->absinfo.fuzz,
-		    uabs->absinfo.flat, uabs->absinfo.resolution);
+		evdev_set_abs_bit(state->ucs_evdev, uabs->code);
+		evdev_set_absinfo(state->ucs_evdev, uabs->code,
+		    &uabs->absinfo);
 		return (0);
 
 	case UI_SET_EVBIT:
diff --git a/sys/dev/usb/input/uep.c b/sys/dev/usb/input/uep.c
index 7a65f2875448..5b96a31b1dee 100644
--- a/sys/dev/usb/input/uep.c
+++ b/sys/dev/usb/input/uep.c
@@ -381,8 +381,8 @@ uep_attach(device_t dev)
 	evdev_support_event(sc->evdev, EV_ABS);
 	evdev_support_event(sc->evdev, EV_KEY);
 	evdev_support_key(sc->evdev, BTN_TOUCH);
-	evdev_support_abs(sc->evdev, ABS_X, 0, 0, UEP_MAX_X, 0, 0, 0);
-	evdev_support_abs(sc->evdev, ABS_Y, 0, 0, UEP_MAX_Y, 0, 0, 0);
+	evdev_support_abs(sc->evdev, ABS_X, 0, UEP_MAX_X, 0, 0, 0);
+	evdev_support_abs(sc->evdev, ABS_Y, 0, UEP_MAX_Y, 0, 0, 0);
 
 	error = evdev_register_mtx(sc->evdev, &sc->mtx);
 	if (error) {
diff --git a/sys/dev/usb/input/wmt.c b/sys/dev/usb/input/wmt.c
index 62e56fe026ca..d65318fee326 100644
--- a/sys/dev/usb/input/wmt.c
+++ b/sys/dev/usb/input/wmt.c
@@ -456,7 +456,7 @@ wmt_attach(device_t dev)
 	}
 	WMT_FOREACH_USAGE(sc->caps, i) {
 		if (wmt_hid_map[i].code != WMT_NO_CODE)
-			evdev_support_abs(sc->evdev, wmt_hid_map[i].code, 0,
+			evdev_support_abs(sc->evdev, wmt_hid_map[i].code,
 			    sc->ai[i].min, sc->ai[i].max, 0, 0, sc->ai[i].res);
 	}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202101072320.107NKp3b063425>