Lines Matching +full:input +full:- +full:value

1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (c) 1999-2002 Vojtech Pavlik
10 #include <uapi/linux/input.h>
16 * In-kernel definitions.
27 * struct input_value - input value representation
28 * @type: type of value (EV_KEY, EV_ABS, etc)
29 * @code: the value code
30 * @value: the value
35 __s32 value; member
46 * struct input_dev - represents an input device
84 * about absolute axes (current value, min, max, flat, fuzz,
103 * @grab: input handle that currently has the device grabbed (via
105 * recipient for all input events coming from the device
106 * @event_lock: this spinlock is taken when input core receives
110 * has been registered with input core must take this lock.
112 * @users: stores number of users (input handlers) that opened this
114 * to make sure that dev->open() is only called when the first
115 * user opens device and dev->close() is called when the very
118 * causes input_open_device*() fail with -ENODEV.
120 * @h_list: list of input handles associated with the device. When
121 * accessing the list dev->mutex must be held
182 int (*event)(struct input_dev *dev, unsigned int type, unsigned int code, int value);
263 * struct input_handler - implements one of interfaces for input devices
264 * @private: driver-specific data
265 * @event: event handler. This method is being called by input core with
266 * interrupts disabled and dev->event_lock spinlock held and so
269 * input core with interrupts disabled and dev->event_lock
274 * to perform fine-grained matching between device and handler
275 * @connect: called when attaching a handler to an input device
276 * @disconnect: disconnects a handler from input device
278 * input core right after connect() method and also when a process
283 * @name: name of the handler, to be shown in /proc/bus/input/handlers
286 * @h_list: list of input handles associated with the handler
289 * Input handlers attach to input devices and create input handles. There
290 * are likely several handlers attached to any given input device at the
291 * same time. All of them will get their copy of input event generated by
294 * The very same structure is used to implement input filters. Input core
299 * Note that input core serializes calls to connect() and disconnect()
306 void (*event)(struct input_handle *handle, unsigned int type, unsigned int code, int value);
309 bool (*filter)(struct input_handle *handle, unsigned int type, unsigned int code, int value);
326 * struct input_handle - links input device with an input handler
327 * @private: handler-specific data
331 * @dev: input device the handle is attached to
357 return dev ? to_input_dev(get_device(&dev->dev)) : NULL; in input_get_device()
363 put_device(&dev->dev); in input_put_device()
368 return dev_get_drvdata(&dev->dev); in input_get_drvdata()
373 dev_set_drvdata(&dev->dev, data); in input_set_drvdata()
412 void input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value);
413 …d input_inject_event(struct input_handle *handle, unsigned int type, unsigned int code, int value);
415 static inline void input_report_key(struct input_dev *dev, unsigned int code, int value) in input_report_key() argument
417 input_event(dev, EV_KEY, code, !!value); in input_report_key()
420 static inline void input_report_rel(struct input_dev *dev, unsigned int code, int value) in input_report_rel() argument
422 input_event(dev, EV_REL, code, value); in input_report_rel()
425 static inline void input_report_abs(struct input_dev *dev, unsigned int code, int value) in input_report_abs() argument
427 input_event(dev, EV_ABS, code, value); in input_report_abs()
430 static inline void input_report_ff_status(struct input_dev *dev, unsigned int code, int value) in input_report_ff_status() argument
432 input_event(dev, EV_FF_STATUS, code, value); in input_report_ff_status()
435 static inline void input_report_switch(struct input_dev *dev, unsigned int code, int value) in input_report_switch() argument
437 input_event(dev, EV_SW, code, !!value); in input_report_switch()
453 * input_set_events_per_packet - tell handlers about the driver event rate
454 * @dev: the input device used by the driver
464 dev->hint_events_per_packet = n_events; in input_set_events_per_packet()
475 return dev->absinfo ? dev->absinfo[axis]._item : 0; \
482 if (dev->absinfo) \
483 dev->absinfo[axis]._item = val; \
486 INPUT_GENERATE_ABS_ACCESSORS(val, value)
508 * struct ff_device - force-feedback part of an input device
513 * @set_autocenter: Called to auto-center device
514 * @destroy: called by input core when parent input device is being
516 * @private: driver-specific data, will be freed automatically
518 * device (not emulated like ones in input_dev->ffbit)
525 * Every force-feedback device must implement upload() and playback()
531 * dev->event_lock spinlock held and interrupts off and thus may not
539 int (*playback)(struct input_dev *dev, int effect_id, int value);
559 int input_ff_event(struct input_dev *dev, unsigned int type, unsigned int code, int value);