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.
This commit is contained in:
Vladimir Kondratyev 2020-11-30 18:10:41 +03:00
parent 95e1f0d684
commit 5af73ad51b
10 changed files with 25 additions and 28 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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,

View File

@ -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);

View File

@ -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,

View File

@ -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:

View File

@ -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) {

View File

@ -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);
}