diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-10 18:08:02 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-10 18:08:02 -0400 |
| commit | 04f2b9765f1e80337314e03c4adde695fe2f0403 (patch) | |
| tree | bde948d37c22eaf5e200dd9675543ea2b2e059c2 /include | |
| parent | 9895850b23886e030cd1e7241d5529a57e969c3d (diff) | |
| parent | 5fc0d36c00e6a2d0a9f2a0a815cff5b9a13b080d (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
Input: xpad - add USB-ID for PL-3601 Xbox 360 pad
Input: cy8ctmg100_ts - signedness bug
Input: elantech - report position also with 3 fingers
Input: elantech - discard the first 2 positions on some firmwares
Input: adxl34x - do not mark device as disabled on startup
Input: gpio_keys - add hooks to enable/disable device
Input: evdev - rearrange ioctl handling
Input: dynamically allocate ABS information
Input: switch to input_abs_*() access functions
Input: add static inline accessors for ABS properties
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/gpio_keys.h | 2 | ||||
| -rw-r--r-- | include/linux/input.h | 53 |
2 files changed, 33 insertions, 22 deletions
diff --git a/include/linux/gpio_keys.h b/include/linux/gpio_keys.h index cd0b3f30f48e..ce73a30113b4 100644 --- a/include/linux/gpio_keys.h +++ b/include/linux/gpio_keys.h | |||
| @@ -17,6 +17,8 @@ struct gpio_keys_platform_data { | |||
| 17 | struct gpio_keys_button *buttons; | 17 | struct gpio_keys_button *buttons; |
| 18 | int nbuttons; | 18 | int nbuttons; |
| 19 | unsigned int rep:1; /* enable input subsystem auto repeat */ | 19 | unsigned int rep:1; /* enable input subsystem auto repeat */ |
| 20 | int (*enable)(struct device *dev); | ||
| 21 | void (*disable)(struct device *dev); | ||
| 20 | }; | 22 | }; |
| 21 | 23 | ||
| 22 | #endif | 24 | #endif |
diff --git a/include/linux/input.h b/include/linux/input.h index 339d043ccb53..896a92227bc4 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
| @@ -776,6 +776,7 @@ struct input_absinfo { | |||
| 776 | #define REP_DELAY 0x00 | 776 | #define REP_DELAY 0x00 |
| 777 | #define REP_PERIOD 0x01 | 777 | #define REP_PERIOD 0x01 |
| 778 | #define REP_MAX 0x01 | 778 | #define REP_MAX 0x01 |
| 779 | #define REP_CNT (REP_MAX+1) | ||
| 779 | 780 | ||
| 780 | /* | 781 | /* |
| 781 | * Sounds | 782 | * Sounds |
| @@ -1099,21 +1100,18 @@ struct input_mt_slot { | |||
| 1099 | * @repeat_key: stores key code of the last key pressed; used to implement | 1100 | * @repeat_key: stores key code of the last key pressed; used to implement |
| 1100 | * software autorepeat | 1101 | * software autorepeat |
| 1101 | * @timer: timer for software autorepeat | 1102 | * @timer: timer for software autorepeat |
| 1102 | * @abs: current values for reports from absolute axes | ||
| 1103 | * @rep: current values for autorepeat parameters (delay, rate) | 1103 | * @rep: current values for autorepeat parameters (delay, rate) |
| 1104 | * @mt: pointer to array of struct input_mt_slot holding current values | 1104 | * @mt: pointer to array of struct input_mt_slot holding current values |
| 1105 | * of tracked contacts | 1105 | * of tracked contacts |
| 1106 | * @mtsize: number of MT slots the device uses | 1106 | * @mtsize: number of MT slots the device uses |
| 1107 | * @slot: MT slot currently being transmitted | 1107 | * @slot: MT slot currently being transmitted |
| 1108 | * @absinfo: array of &struct absinfo elements holding information | ||
| 1109 | * about absolute axes (current value, min, max, flat, fuzz, | ||
| 1110 | * resolution) | ||
| 1108 | * @key: reflects current state of device's keys/buttons | 1111 | * @key: reflects current state of device's keys/buttons |
| 1109 | * @led: reflects current state of device's LEDs | 1112 | * @led: reflects current state of device's LEDs |
| 1110 | * @snd: reflects current state of sound effects | 1113 | * @snd: reflects current state of sound effects |
| 1111 | * @sw: reflects current state of device's switches | 1114 | * @sw: reflects current state of device's switches |
| 1112 | * @absmax: maximum values for events coming from absolute axes | ||
| 1113 | * @absmin: minimum values for events coming from absolute axes | ||
| 1114 | * @absfuzz: describes noisiness for axes | ||
| 1115 | * @absflat: size of the center flat position (used by joydev) | ||
| 1116 | * @absres: resolution used for events coming form absolute axes | ||
| 1117 | * @open: this method is called when the very first user calls | 1115 | * @open: this method is called when the very first user calls |
| 1118 | * input_open_device(). The driver must prepare the device | 1116 | * input_open_device(). The driver must prepare the device |
| 1119 | * to start generating events (start polling thread, | 1117 | * to start generating events (start polling thread, |
| @@ -1180,24 +1178,19 @@ struct input_dev { | |||
| 1180 | unsigned int repeat_key; | 1178 | unsigned int repeat_key; |
| 1181 | struct timer_list timer; | 1179 | struct timer_list timer; |
| 1182 | 1180 | ||
| 1183 | int abs[ABS_CNT]; | 1181 | int rep[REP_CNT]; |
| 1184 | int rep[REP_MAX + 1]; | ||
| 1185 | 1182 | ||
| 1186 | struct input_mt_slot *mt; | 1183 | struct input_mt_slot *mt; |
| 1187 | int mtsize; | 1184 | int mtsize; |
| 1188 | int slot; | 1185 | int slot; |
| 1189 | 1186 | ||
| 1187 | struct input_absinfo *absinfo; | ||
| 1188 | |||
| 1190 | unsigned long key[BITS_TO_LONGS(KEY_CNT)]; | 1189 | unsigned long key[BITS_TO_LONGS(KEY_CNT)]; |
| 1191 | unsigned long led[BITS_TO_LONGS(LED_CNT)]; | 1190 | unsigned long led[BITS_TO_LONGS(LED_CNT)]; |
| 1192 | unsigned long snd[BITS_TO_LONGS(SND_CNT)]; | 1191 | unsigned long snd[BITS_TO_LONGS(SND_CNT)]; |
| 1193 | unsigned long sw[BITS_TO_LONGS(SW_CNT)]; | 1192 | unsigned long sw[BITS_TO_LONGS(SW_CNT)]; |
| 1194 | 1193 | ||
| 1195 | int absmax[ABS_CNT]; | ||
| 1196 | int absmin[ABS_CNT]; | ||
| 1197 | int absfuzz[ABS_CNT]; | ||
| 1198 | int absflat[ABS_CNT]; | ||
| 1199 | int absres[ABS_CNT]; | ||
| 1200 | |||
| 1201 | int (*open)(struct input_dev *dev); | 1194 | int (*open)(struct input_dev *dev); |
| 1202 | void (*close)(struct input_dev *dev); | 1195 | void (*close)(struct input_dev *dev); |
| 1203 | int (*flush)(struct input_dev *dev, struct file *file); | 1196 | int (*flush)(struct input_dev *dev, struct file *file); |
| @@ -1459,16 +1452,32 @@ static inline void input_set_events_per_packet(struct input_dev *dev, int n_even | |||
| 1459 | dev->hint_events_per_packet = n_events; | 1452 | dev->hint_events_per_packet = n_events; |
| 1460 | } | 1453 | } |
| 1461 | 1454 | ||
| 1462 | static inline void input_set_abs_params(struct input_dev *dev, int axis, int min, int max, int fuzz, int flat) | 1455 | void input_alloc_absinfo(struct input_dev *dev); |
| 1463 | { | 1456 | void input_set_abs_params(struct input_dev *dev, unsigned int axis, |
| 1464 | dev->absmin[axis] = min; | 1457 | int min, int max, int fuzz, int flat); |
| 1465 | dev->absmax[axis] = max; | 1458 | |
| 1466 | dev->absfuzz[axis] = fuzz; | 1459 | #define INPUT_GENERATE_ABS_ACCESSORS(_suffix, _item) \ |
| 1467 | dev->absflat[axis] = flat; | 1460 | static inline int input_abs_get_##_suffix(struct input_dev *dev, \ |
| 1468 | 1461 | unsigned int axis) \ | |
| 1469 | dev->absbit[BIT_WORD(axis)] |= BIT_MASK(axis); | 1462 | { \ |
| 1463 | return dev->absinfo ? dev->absinfo[axis]._item : 0; \ | ||
| 1464 | } \ | ||
| 1465 | \ | ||
| 1466 | static inline void input_abs_set_##_suffix(struct input_dev *dev, \ | ||
| 1467 | unsigned int axis, int val) \ | ||
| 1468 | { \ | ||
| 1469 | input_alloc_absinfo(dev); \ | ||
| 1470 | if (dev->absinfo) \ | ||
| 1471 | dev->absinfo[axis]._item = val; \ | ||
| 1470 | } | 1472 | } |
| 1471 | 1473 | ||
| 1474 | INPUT_GENERATE_ABS_ACCESSORS(val, value) | ||
| 1475 | INPUT_GENERATE_ABS_ACCESSORS(min, minimum) | ||
| 1476 | INPUT_GENERATE_ABS_ACCESSORS(max, maximum) | ||
| 1477 | INPUT_GENERATE_ABS_ACCESSORS(fuzz, fuzz) | ||
| 1478 | INPUT_GENERATE_ABS_ACCESSORS(flat, flat) | ||
| 1479 | INPUT_GENERATE_ABS_ACCESSORS(res, resolution) | ||
| 1480 | |||
| 1472 | int input_get_keycode(struct input_dev *dev, | 1481 | int input_get_keycode(struct input_dev *dev, |
| 1473 | unsigned int scancode, unsigned int *keycode); | 1482 | unsigned int scancode, unsigned int *keycode); |
| 1474 | int input_set_keycode(struct input_dev *dev, | 1483 | int input_set_keycode(struct input_dev *dev, |
