Lines Matching +full:non +full:- +full:inverted

1 // SPDX-License-Identifier: GPL-2.0-only
29 * Power-on Reset: Resets all trackpoint parameters, including RAM values,
31 * Returns zero on success, non-zero on failure.
42 /* Check for success response -- 0xAA00 */ in trackpoint_power_on_reset()
44 return -ENODEV; in trackpoint_power_on_reset()
72 return -EINVAL; in trackpoint_toggle_bit()
94 * Trackpoint-specific attributes
100 bool inverted; member
107 struct trackpoint_data *tp = psmouse->private; in trackpoint_show_int_attr()
109 u8 value = *(u8 *)((void *)tp + attr->field_offset); in trackpoint_show_int_attr()
111 if (attr->inverted) in trackpoint_show_int_attr()
120 struct trackpoint_data *tp = psmouse->private; in trackpoint_set_int_attr()
122 u8 *field = (void *)tp + attr->field_offset; in trackpoint_set_int_attr()
131 err = trackpoint_write(&psmouse->ps2dev, attr->command, value); in trackpoint_set_int_attr()
149 struct trackpoint_data *tp = psmouse->private; in trackpoint_set_bit_attr()
151 bool *field = (void *)tp + attr->field_offset; in trackpoint_set_bit_attr()
159 if (attr->inverted) in trackpoint_set_bit_attr()
164 err = trackpoint_toggle_bit(&psmouse->ps2dev, in trackpoint_set_bit_attr()
165 attr->command, attr->mask); in trackpoint_set_bit_attr()
178 .inverted = _inv, \
207 struct trackpoint_data *tp = psmouse->private; in trackpoint_is_attr_available()
209 return tp->variant_id == TP_VARIANT_IBM || in trackpoint_is_attr_available()
221 return trackpoint_is_attr_available(psmouse, attr) ? attr->mode : 0; in trackpoint_is_attr_visible()
251 if ((!_power_on || _tp->_name != _attr->power_on_default) && \
254 if (!_attr->mask) \
255 trackpoint_write(&_psmouse->ps2dev, \
256 _attr->command, _tp->_name); \
258 trackpoint_update_bit(&_psmouse->ps2dev, \
259 _attr->command, _attr->mask, \
260 _tp->_name); \
266 _tp->_name = trackpoint_attr_##_name.power_on_default; \
275 error = ps2_command(&psmouse->ps2dev, in trackpoint_start_protocol()
294 return -ENODEV; in trackpoint_start_protocol()
299 * in_power_on_state: Set to true if TP is in default / power-on state (ex. if
300 * power-on reset was run). If so, values will only be
301 * written to TP if they differ from power-on default.
305 struct trackpoint_data *tp = psmouse->private; in trackpoint_sync()
307 if (!in_power_on_state && tp->variant_id == TP_VARIANT_IBM) { in trackpoint_sync()
312 trackpoint_update_bit(&psmouse->ps2dev, TP_TOGGLE_TWOHAND, in trackpoint_sync()
315 trackpoint_update_bit(&psmouse->ps2dev, TP_TOGGLE_SOURCE_TAG, in trackpoint_sync()
318 trackpoint_update_bit(&psmouse->ps2dev, TP_TOGGLE_MB, in trackpoint_sync()
324 * configure them if the values are non-default or if the TP is in in trackpoint_sync()
369 device_remove_group(&psmouse->ps2dev.serio->dev, in trackpoint_disconnect()
372 kfree(psmouse->private); in trackpoint_disconnect()
373 psmouse->private = NULL; in trackpoint_disconnect()
378 struct trackpoint_data *tp = psmouse->private; in trackpoint_reconnect()
386 was_reset = tp->variant_id == TP_VARIANT_IBM && in trackpoint_reconnect()
387 trackpoint_power_on_reset(&psmouse->ps2dev) == 0; in trackpoint_reconnect()
398 struct ps2dev *ps2dev = &psmouse->ps2dev; in trackpoint_detect()
414 return -ENOMEM; in trackpoint_detect()
417 tp->variant_id = variant_id; in trackpoint_detect()
418 tp->firmware_id = firmware_id; in trackpoint_detect()
420 psmouse->private = tp; in trackpoint_detect()
422 psmouse->vendor = trackpoint_variants[variant_id]; in trackpoint_detect()
423 psmouse->name = "TrackPoint"; in trackpoint_detect()
425 psmouse->reconnect = trackpoint_reconnect; in trackpoint_detect()
426 psmouse->disconnect = trackpoint_disconnect; in trackpoint_detect()
445 input_set_capability(psmouse->dev, EV_KEY, BTN_MIDDLE); in trackpoint_detect()
447 __set_bit(INPUT_PROP_POINTER, psmouse->dev->propbit); in trackpoint_detect()
448 __set_bit(INPUT_PROP_POINTING_STICK, psmouse->dev->propbit); in trackpoint_detect()
458 error = device_add_group(&ps2dev->serio->dev, &trackpoint_attr_group); in trackpoint_detect()
463 kfree(psmouse->private); in trackpoint_detect()
464 psmouse->private = NULL; in trackpoint_detect()
465 return -1; in trackpoint_detect()
470 psmouse->vendor, firmware_id, in trackpoint_detect()