aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/input.h
diff options
context:
space:
mode:
authorDaniel Mack <daniel@caiaq.de>2010-08-02 22:33:51 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-08-02 23:29:50 -0400
commit7957e9c4d175cc065f4277211fcb7d784fcee860 (patch)
treec8f96d944e54063f61ae99bf3233f80bc2599ab3 /include/linux/input.h
parent0d87c7228a49e8342d60dd552892e470e0b291fa (diff)
Input: add static inline accessors for ABS properties
In preparation for dynamically allocated ABS axis, introduce a number of static inline access helpers. This should make the transition less painful. Signed-off-by: Daniel Mack <daniel@caiaq.de> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'include/linux/input.h')
-rw-r--r--include/linux/input.h30
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) \
1473static inline int input_abs_get_##_suffix(struct input_dev *dev, \
1474 unsigned int axis) \
1475{ \
1476 return dev->abs##_item[axis]; \
1477} \
1478 \
1479static 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
1485INPUT_GENERATE_ABS_ACCESSORS(min, min)
1486INPUT_GENERATE_ABS_ACCESSORS(max, max)
1487INPUT_GENERATE_ABS_ACCESSORS(fuzz, fuzz)
1488INPUT_GENERATE_ABS_ACCESSORS(flat, flat)
1489INPUT_GENERATE_ABS_ACCESSORS(res, res)
1490
1491static inline int input_abs_get_val(struct input_dev *dev, unsigned int axis)
1492{
1493 return dev->abs[axis];
1494}
1495
1496static inline void input_abs_set_val(struct input_dev *dev,
1497 unsigned int axis, int val)
1498{
1499 dev->abs[axis] = val;
1500}
1501
1472int input_get_keycode(struct input_dev *dev, 1502int input_get_keycode(struct input_dev *dev,
1473 unsigned int scancode, unsigned int *keycode); 1503 unsigned int scancode, unsigned int *keycode);
1474int input_set_keycode(struct input_dev *dev, 1504int input_set_keycode(struct input_dev *dev,