aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/hid-sensor-ids.h1
-rw-r--r--include/linux/hid.h6
-rw-r--r--include/linux/i2c/i2c-hid.h35
-rw-r--r--include/linux/input/mt.h6
4 files changed, 47 insertions, 1 deletions
diff --git a/include/linux/hid-sensor-ids.h b/include/linux/hid-sensor-ids.h
index ca8d7e94eb3c..55f277372fed 100644
--- a/include/linux/hid-sensor-ids.h
+++ b/include/linux/hid-sensor-ids.h
@@ -19,7 +19,6 @@
19#ifndef _HID_SENSORS_IDS_H 19#ifndef _HID_SENSORS_IDS_H
20#define _HID_SENSORS_IDS_H 20#define _HID_SENSORS_IDS_H
21 21
22#define HID_UP_SENSOR 0x00200000
23#define HID_MAX_PHY_DEVICES 0xFF 22#define HID_MAX_PHY_DEVICES 0xFF
24 23
25/* Accel 3D (200073) */ 24/* Accel 3D (200073) */
diff --git a/include/linux/hid.h b/include/linux/hid.h
index c076041a069e..7330a0fef0c0 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -167,6 +167,7 @@ struct hid_item {
167#define HID_UP_MSVENDOR 0xff000000 167#define HID_UP_MSVENDOR 0xff000000
168#define HID_UP_CUSTOM 0x00ff0000 168#define HID_UP_CUSTOM 0x00ff0000
169#define HID_UP_LOGIVENDOR 0xffbc0000 169#define HID_UP_LOGIVENDOR 0xffbc0000
170#define HID_UP_SENSOR 0x00200000
170 171
171#define HID_USAGE 0x0000ffff 172#define HID_USAGE 0x0000ffff
172 173
@@ -292,6 +293,7 @@ struct hid_item {
292 */ 293 */
293#define HID_GROUP_GENERIC 0x0001 294#define HID_GROUP_GENERIC 0x0001
294#define HID_GROUP_MULTITOUCH 0x0002 295#define HID_GROUP_MULTITOUCH 0x0002
296#define HID_GROUP_SENSOR_HUB 0x0003
295 297
296/* 298/*
297 * This is the global environment of the parser. This information is 299 * This is the global environment of the parser. This information is
@@ -342,6 +344,7 @@ struct hid_collection {
342struct hid_usage { 344struct hid_usage {
343 unsigned hid; /* hid usage code */ 345 unsigned hid; /* hid usage code */
344 unsigned collection_index; /* index into collection array */ 346 unsigned collection_index; /* index into collection array */
347 unsigned usage_index; /* index into usage array */
345 /* hidinput data */ 348 /* hidinput data */
346 __u16 code; /* input driver code */ 349 __u16 code; /* input driver code */
347 __u8 type; /* input driver type */ 350 __u8 type; /* input driver type */
@@ -684,6 +687,7 @@ struct hid_ll_driver {
684 687
685extern int hid_debug; 688extern int hid_debug;
686 689
690extern bool hid_ignore(struct hid_device *);
687extern int hid_add_device(struct hid_device *); 691extern int hid_add_device(struct hid_device *);
688extern void hid_destroy_device(struct hid_device *); 692extern void hid_destroy_device(struct hid_device *);
689 693
@@ -706,6 +710,7 @@ int hid_input_report(struct hid_device *, int type, u8 *, int, int);
706int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field); 710int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field);
707struct hid_field *hidinput_get_led_field(struct hid_device *hid); 711struct hid_field *hidinput_get_led_field(struct hid_device *hid);
708unsigned int hidinput_count_leds(struct hid_device *hid); 712unsigned int hidinput_count_leds(struct hid_device *hid);
713__s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code);
709void hid_output_report(struct hid_report *report, __u8 *data); 714void hid_output_report(struct hid_report *report, __u8 *data);
710struct hid_device *hid_allocate_device(void); 715struct hid_device *hid_allocate_device(void);
711struct hid_report *hid_register_report(struct hid_device *device, unsigned type, unsigned id); 716struct hid_report *hid_register_report(struct hid_device *device, unsigned type, unsigned id);
@@ -716,6 +721,7 @@ int hid_connect(struct hid_device *hid, unsigned int connect_mask);
716void hid_disconnect(struct hid_device *hid); 721void hid_disconnect(struct hid_device *hid);
717const struct hid_device_id *hid_match_id(struct hid_device *hdev, 722const struct hid_device_id *hid_match_id(struct hid_device *hdev,
718 const struct hid_device_id *id); 723 const struct hid_device_id *id);
724s32 hid_snto32(__u32 value, unsigned n);
719 725
720/** 726/**
721 * hid_map_usage - map usage input bits 727 * hid_map_usage - map usage input bits
diff --git a/include/linux/i2c/i2c-hid.h b/include/linux/i2c/i2c-hid.h
new file mode 100644
index 000000000000..60e411d764d4
--- /dev/null
+++ b/include/linux/i2c/i2c-hid.h
@@ -0,0 +1,35 @@
1/*
2 * HID over I2C protocol implementation
3 *
4 * Copyright (c) 2012 Benjamin Tissoires <benjamin.tissoires@gmail.com>
5 * Copyright (c) 2012 Ecole Nationale de l'Aviation Civile, France
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file COPYING in the main directory of this archive for
9 * more details.
10 */
11
12#ifndef __LINUX_I2C_HID_H
13#define __LINUX_I2C_HID_H
14
15#include <linux/types.h>
16
17/**
18 * struct i2chid_platform_data - used by hid over i2c implementation.
19 * @hid_descriptor_address: i2c register where the HID descriptor is stored.
20 *
21 * Note that it is the responsibility of the platform driver (or the acpi 5.0
22 * driver) to setup the irq related to the gpio in the struct i2c_board_info.
23 * The platform driver should also setup the gpio according to the device:
24 *
25 * A typical example is the following:
26 * irq = gpio_to_irq(intr_gpio);
27 * hkdk4412_i2c_devs5[0].irq = irq; // store the irq in i2c_board_info
28 * gpio_request(intr_gpio, "elan-irq");
29 * s3c_gpio_setpull(intr_gpio, S3C_GPIO_PULL_UP);
30 */
31struct i2c_hid_platform_data {
32 u16 hid_descriptor_address;
33};
34
35#endif /* __LINUX_I2C_HID_H */
diff --git a/include/linux/input/mt.h b/include/linux/input/mt.h
index cc5cca774bab..2e86bd0bfba1 100644
--- a/include/linux/input/mt.h
+++ b/include/linux/input/mt.h
@@ -69,6 +69,12 @@ static inline bool input_mt_is_active(const struct input_mt_slot *slot)
69 return input_mt_get_value(slot, ABS_MT_TRACKING_ID) >= 0; 69 return input_mt_get_value(slot, ABS_MT_TRACKING_ID) >= 0;
70} 70}
71 71
72static inline bool input_mt_is_used(const struct input_mt *mt,
73 const struct input_mt_slot *slot)
74{
75 return slot->frame == mt->frame;
76}
77
72int input_mt_init_slots(struct input_dev *dev, unsigned int num_slots, 78int input_mt_init_slots(struct input_dev *dev, unsigned int num_slots,
73 unsigned int flags); 79 unsigned int flags);
74void input_mt_destroy_slots(struct input_dev *dev); 80void input_mt_destroy_slots(struct input_dev *dev);