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,
94 * to start providing events to the input core.
97 * providing events to the input core.
105 * @grab: input handle that currently has the device grabbed (via
107 * recipient for all input events coming from the device
108 * @event_lock: this spinlock is taken when input core receives
112 * has been registered with input core must take this lock.
114 * @users: stores number of users (input handlers) that opened this
116 * to make sure that dev->open() is only called when the first
117 * user opens device and dev->close() is called when the very
120 * causes input_open_device*() fail with -ENODEV.
122 * @h_list: list of input handles associated with the device. When
123 * accessing the list dev->mutex must be held
132 * @inhibited: indicates that the input device is inhibited. If that is
133 * the case then input core ignores any events generated by the device.
188 int (*event)(struct input_dev *dev, unsigned int type, unsigned int code, int value);
271 * struct input_handler - implements one of interfaces for input devices
272 * @private: driver-specific data
273 * @event: event handler. This method is being called by input core with
274 * interrupts disabled and dev->event_lock spinlock held and so
277 * input core with interrupts disabled and dev->event_lock
283 * to perform fine-grained matching between device and handler
284 * @connect: called when attaching a handler to an input device
285 * @disconnect: disconnects a handler from input device
287 * input core right after connect() method and also when a process
296 * @name: name of the handler, to be shown in /proc/bus/input/handlers
299 * @h_list: list of input handles associated with the handler
302 * Input handlers attach to input devices and create input handles. There
303 * are likely several handlers attached to any given input device at the
304 * same time. All of them will get their copy of input event generated by
307 * The very same structure is used to implement input filters. Input core
312 * Note that input core serializes calls to connect() and disconnect()
319 void (*event)(struct input_handle *handle, unsigned int type, unsigned int code, int value);
322 bool (*filter)(struct input_handle *handle, unsigned int type, unsigned int code, int value);
340 * struct input_handle - links input device with an input handler
341 * @private: handler-specific data
345 * @dev: input device the handle is attached to
347 * @handle_events: event sequence handler. It is set up by the input core
350 * This method is being called by the input core with interrupts disabled
351 * and dev->event_lock spinlock held and so it may not sleep.
379 return dev ? to_input_dev(get_device(&dev->dev)) : NULL; in input_get_device()
385 put_device(&dev->dev); in input_put_device()
390 return dev_get_drvdata(&dev->dev); in input_get_drvdata()
395 dev_set_drvdata(&dev->dev, data); in input_set_drvdata()
434 void input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value);
435 …d input_inject_event(struct input_handle *handle, unsigned int type, unsigned int code, int value);
437 static inline void input_report_key(struct input_dev *dev, unsigned int code, int value) in input_report_key() argument
439 input_event(dev, EV_KEY, code, !!value); in input_report_key()
442 static inline void input_report_rel(struct input_dev *dev, unsigned int code, int value) in input_report_rel() argument
444 input_event(dev, EV_REL, code, value); in input_report_rel()
447 static inline void input_report_abs(struct input_dev *dev, unsigned int code, int value) in input_report_abs() argument
449 input_event(dev, EV_ABS, code, value); in input_report_abs()
452 static inline void input_report_ff_status(struct input_dev *dev, unsigned int code, int value) in input_report_ff_status() argument
454 input_event(dev, EV_FF_STATUS, code, value); in input_report_ff_status()
457 static inline void input_report_switch(struct input_dev *dev, unsigned int code, int value) in input_report_switch() argument
459 input_event(dev, EV_SW, code, !!value); in input_report_switch()
475 * input_set_events_per_packet - tell handlers about the driver event rate
476 * @dev: the input device used by the driver
486 dev->hint_events_per_packet = n_events; in input_set_events_per_packet()
499 return dev->absinfo ? dev->absinfo[axis]._item : 0; \
506 if (dev->absinfo) \
507 dev->absinfo[axis]._item = val; \
510 INPUT_GENERATE_ABS_ACCESSORS(val, value)
534 * struct ff_device - force-feedback part of an input device
539 * @set_autocenter: Called to auto-center device
540 * @destroy: called by input core when parent input device is being
542 * @private: driver-specific data, will be freed automatically
544 * device (not emulated like ones in input_dev->ffbit)
551 * Every force-feedback device must implement upload() and playback()
557 * dev->event_lock spinlock held and interrupts off and thus may not
565 int (*playback)(struct input_dev *dev, int effect_id, int value);
585 int input_ff_event(struct input_dev *dev, unsigned int type, unsigned int code, int value);