]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - include/linux/input.h
Input: add KEY_RFKILL
[linux-2.6.git] / include / linux / input.h
index adc13322d1d2a352b1e7a139f873e2b1e5ca78a1..663208afb64ce37ed16334debe6f40a4a858418f 100644 (file)
@@ -16,7 +16,7 @@
 #include <sys/time.h>
 #include <sys/ioctl.h>
 #include <sys/types.h>
-#include <asm/types.h>
+#include <linux/types.h>
 #endif
 
 /*
@@ -53,6 +53,7 @@ struct input_absinfo {
        __s32 maximum;
        __s32 fuzz;
        __s32 flat;
+       __s32 resolution;
 };
 
 #define EVIOCGVERSION          _IOR('E', 0x01, int)                    /* get driver version */
@@ -106,6 +107,7 @@ struct input_absinfo {
 
 #define SYN_REPORT             0
 #define SYN_CONFIG             1
+#define SYN_MT_REPORT          2
 
 /*
  * Keys and buttons
@@ -374,6 +376,7 @@ struct input_absinfo {
 #define KEY_DISPLAY_OFF                245     /* display device to off state */
 
 #define KEY_WIMAX              246
+#define KEY_RFKILL             247     /* Key that controls all radios */
 
 /* Range 248 - 255 is reserved for special needs of AT keyboard driver */
 
@@ -445,6 +448,7 @@ struct input_absinfo {
 #define BTN_STYLUS2            0x14c
 #define BTN_TOOL_DOUBLETAP     0x14d
 #define BTN_TOOL_TRIPLETAP     0x14e
+#define BTN_TOOL_QUADTAP       0x14f   /* Four fingers on trackpad */
 
 #define BTN_WHEEL              0x150
 #define BTN_GEAR_DOWN          0x150
@@ -592,6 +596,8 @@ struct input_absinfo {
 #define KEY_NUMERIC_STAR       0x20a
 #define KEY_NUMERIC_POUND      0x20b
 
+#define KEY_CAMERA_FOCUS       0x210
+
 /* We avoid low common keys in module aliases so they don't get huge. */
 #define KEY_MIN_INTERESTING    KEY_MUTE
 #define KEY_MAX                        0x2ff
@@ -644,6 +650,19 @@ struct input_absinfo {
 #define ABS_TOOL_WIDTH         0x1c
 #define ABS_VOLUME             0x20
 #define ABS_MISC               0x28
+
+#define ABS_MT_TOUCH_MAJOR     0x30    /* Major axis of touching ellipse */
+#define ABS_MT_TOUCH_MINOR     0x31    /* Minor axis (omit if circular) */
+#define ABS_MT_WIDTH_MAJOR     0x32    /* Major axis of approaching ellipse */
+#define ABS_MT_WIDTH_MINOR     0x33    /* Minor axis (omit if circular) */
+#define ABS_MT_ORIENTATION     0x34    /* Ellipse orientation */
+#define ABS_MT_POSITION_X      0x35    /* Center X ellipse position */
+#define ABS_MT_POSITION_Y      0x36    /* Center Y ellipse position */
+#define ABS_MT_TOOL_TYPE       0x37    /* Type of touching device */
+#define ABS_MT_BLOB_ID         0x38    /* Group a set of packets as a blob */
+#define ABS_MT_TRACKING_ID     0x39    /* Unique ID of initiated contact */
+#define ABS_MT_PRESSURE                0x3a    /* Pressure on contact area */
+
 #define ABS_MAX                        0x3f
 #define ABS_CNT                        (ABS_MAX+1)
 
@@ -662,6 +681,9 @@ struct input_absinfo {
 #define SW_LINEOUT_INSERT      0x06  /* set = inserted */
 #define SW_JACK_PHYSICAL_INSERT 0x07  /* set = mechanical switch set */
 #define SW_VIDEOOUT_INSERT     0x08  /* set = inserted */
+#define SW_CAMERA_LENS_COVER   0x09  /* set = lens covered */
+#define SW_KEYPAD_SLIDE                0x0a  /* set = keypad slide out */
+#define SW_FRONT_PROXIMITY     0x0b  /* set = front proximity sensor active */
 #define SW_MAX                 0x0f
 #define SW_CNT                 (SW_MAX+1)
 
@@ -742,6 +764,12 @@ struct input_absinfo {
 #define BUS_GSC                        0x1A
 #define BUS_ATARI              0x1B
 
+/*
+ * MT_TOOL types
+ */
+#define MT_TOOL_FINGER         0
+#define MT_TOOL_PEN            1
+
 /*
  * Values describing the status of a force-feedback effect
  */
@@ -869,7 +897,7 @@ struct ff_periodic_effect {
        struct ff_envelope envelope;
 
        __u32 custom_len;
-       __s16 *custom_data;
+       __s16 __user *custom_data;
 };
 
 /**
@@ -995,9 +1023,12 @@ struct ff_effect {
  * @keycodesize: size of elements in keycode table
  * @keycode: map of scancodes to keycodes for this device
  * @setkeycode: optional method to alter current keymap, used to implement
- *     sparse keymaps. If not supplied default mechanism will be used
+ *     sparse keymaps. If not supplied default mechanism will be used.
+ *     The method is being called while holding event_lock and thus must
+ *     not sleep
  * @getkeycode: optional method to retrieve current keymap. If not supplied
- *     default mechanism will be used
+ *     default mechanism will be used. The method is being called while
+ *     holding event_lock and thus must not sleep
  * @ff: force feedback structure associated with the device if device
  *     supports force feedback effects
  * @repeat_key: stores key code of the last key pressed; used to implement
@@ -1014,6 +1045,7 @@ struct ff_effect {
  * @absmin: minimum values for events coming from absolute axes
  * @absfuzz: describes noisiness for axes
  * @absflat: size of the center flat position (used by joydev)
+ * @absres: resolution used for events coming form absolute axes
  * @open: this method is called when the very first user calls
  *     input_open_device(). The driver must prepare the device
  *     to start generating events (start polling thread,
@@ -1089,6 +1121,7 @@ struct input_dev {
        int absmin[ABS_MAX + 1];
        int absfuzz[ABS_MAX + 1];
        int absflat[ABS_MAX + 1];
+       int absres[ABS_MAX + 1];
 
        int (*open)(struct input_dev *dev);
        void (*close)(struct input_dev *dev);
@@ -1101,7 +1134,7 @@ struct input_dev {
        struct mutex mutex;
 
        unsigned int users;
-       int going_away;
+       bool going_away;
 
        struct device dev;
 
@@ -1267,6 +1300,9 @@ void input_unregister_device(struct input_dev *);
 int __must_check input_register_handler(struct input_handler *);
 void input_unregister_handler(struct input_handler *);
 
+int input_handler_for_each_handle(struct input_handler *, void *data,
+                                 int (*fn)(struct input_handle *, void *));
+
 int input_register_handle(struct input_handle *);
 void input_unregister_handle(struct input_handle *);
 
@@ -1311,6 +1347,11 @@ static inline void input_sync(struct input_dev *dev)
        input_event(dev, EV_SYN, SYN_REPORT, 0);
 }
 
+static inline void input_mt_sync(struct input_dev *dev)
+{
+       input_event(dev, EV_SYN, SYN_MT_REPORT, 0);
+}
+
 void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int code);
 
 static inline void input_set_abs_params(struct input_dev *dev, int axis, int min, int max, int fuzz, int flat)
@@ -1350,6 +1391,10 @@ extern struct class input_class;
  * methods; erase() is optional. set_gain() and set_autocenter() need
  * only be implemented if driver sets up FF_GAIN and FF_AUTOCENTER
  * bits.
+ *
+ * Note that playback(), set_gain() and set_autocenter() are called with
+ * dev->event_lock spinlock held and interrupts off and thus may not
+ * sleep.
  */
 struct ff_device {
        int (*upload)(struct input_dev *dev, struct ff_effect *effect,