[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1274289757-2723-3-git-send-email-daniel@caiaq.de>
Date: Wed, 19 May 2010 19:22:35 +0200
From: Daniel Mack <daniel@...aq.de>
To: linux-kernel@...r.kernel.org
Cc: dmitry.torokhov@...il.com, linux-input@...r.kernel.org,
Daniel Mack <daniel@...aq.de>, Dmitry Torokhov <dtor@...l.ru>
Subject: [PATCH 2/4] input: add static inline helpers for ABS properties
In preparation for dynamically allocated ABS axis, introduce a number of
sttaic inline access helpers. This should make the transition less
painful.
Signed-off-by: Daniel Mack <daniel@...aq.de>
Cc: Dmitry Torokhov <dtor@...l.ru>
---
include/linux/input.h | 60 +++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 60 insertions(+), 0 deletions(-)
diff --git a/include/linux/input.h b/include/linux/input.h
index 0e41f77..ff1ee6d 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -1188,6 +1188,66 @@ struct input_dev {
};
#define to_input_dev(d) container_of(d, struct input_dev, dev)
+static inline int input_abs(struct input_dev *dev, int axis)
+{
+ return dev->abs[axis];
+}
+
+static inline int input_abs_max(struct input_dev *dev, int axis)
+{
+ return dev->absmax[axis];
+}
+
+static inline int input_abs_min(struct input_dev *dev, int axis)
+{
+ return dev->absmin[axis];
+}
+
+static inline int input_abs_fuzz(struct input_dev *dev, int axis)
+{
+ return dev->absfuzz[axis];
+}
+
+static inline int input_abs_flat(struct input_dev *dev, int axis)
+{
+ return dev->absflat[axis];
+}
+
+static inline int input_abs_res(struct input_dev *dev, int axis)
+{
+ return dev->absres[axis];
+}
+
+static inline void input_abs_set(struct input_dev *dev, int axis, int val)
+{
+ dev->abs[axis] = val;
+}
+
+static inline void input_abs_set_max(struct input_dev *dev, int axis, int val)
+{
+ dev->absmax[axis] = val;
+}
+
+static inline void input_abs_set_min(struct input_dev *dev, int axis, int val)
+{
+ dev->absmin[axis] = val;
+}
+
+static inline void input_abs_set_fuzz(struct input_dev *dev, int axis, int val)
+{
+ dev->absfuzz[axis] = val;
+}
+
+static inline void input_abs_set_flat(struct input_dev *dev, int axis, int val)
+{
+ dev->absflat[axis] = val;
+}
+
+static inline void input_abs_set_res(struct input_dev *dev, int axis, int val)
+{
+ dev->absres[axis] = val;
+}
+
/*
* Verify that we are in sync with input_device_id mod_devicetable.h #defines
*/
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists