diff mbox

[2/4] input: add static inline helpers for ABS properties

Message ID 1274289757-2723-3-git-send-email-daniel@caiaq.de (mailing list archive)
State New, archived
Headers show

Commit Message

Daniel Mack May 19, 2010, 5:22 p.m. UTC
None
diff mbox

Patch

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
  */