diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/input.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/include/linux/input.h b/include/linux/input.h index 339d043ccb53..4a5531161de1 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -1469,6 +1469,36 @@ static inline void input_set_abs_params(struct input_dev *dev, int axis, int min | |||
1469 | dev->absbit[BIT_WORD(axis)] |= BIT_MASK(axis); | 1469 | dev->absbit[BIT_WORD(axis)] |= BIT_MASK(axis); |
1470 | } | 1470 | } |
1471 | 1471 | ||
1472 | #define INPUT_GENERATE_ABS_ACCESSORS(_suffix, _item) \ | ||
1473 | static inline int input_abs_get_##_suffix(struct input_dev *dev, \ | ||
1474 | unsigned int axis) \ | ||
1475 | { \ | ||
1476 | return dev->abs##_item[axis]; \ | ||
1477 | } \ | ||
1478 | \ | ||
1479 | static inline void input_abs_set_##_suffix(struct input_dev *dev, \ | ||
1480 | unsigned int axis, int val) \ | ||
1481 | { \ | ||
1482 | dev->abs##_item[axis] = val; \ | ||
1483 | } | ||
1484 | |||
1485 | INPUT_GENERATE_ABS_ACCESSORS(min, min) | ||
1486 | INPUT_GENERATE_ABS_ACCESSORS(max, max) | ||
1487 | INPUT_GENERATE_ABS_ACCESSORS(fuzz, fuzz) | ||
1488 | INPUT_GENERATE_ABS_ACCESSORS(flat, flat) | ||
1489 | INPUT_GENERATE_ABS_ACCESSORS(res, res) | ||
1490 | |||
1491 | static inline int input_abs_get_val(struct input_dev *dev, unsigned int axis) | ||
1492 | { | ||
1493 | return dev->abs[axis]; | ||
1494 | } | ||
1495 | |||
1496 | static inline void input_abs_set_val(struct input_dev *dev, | ||
1497 | unsigned int axis, int val) | ||
1498 | { | ||
1499 | dev->abs[axis] = val; | ||
1500 | } | ||
1501 | |||
1472 | int input_get_keycode(struct input_dev *dev, | 1502 | int input_get_keycode(struct input_dev *dev, |
1473 | unsigned int scancode, unsigned int *keycode); | 1503 | unsigned int scancode, unsigned int *keycode); |
1474 | int input_set_keycode(struct input_dev *dev, | 1504 | int input_set_keycode(struct input_dev *dev, |