string: factorize skip_spaces and export it to be generally available
[safe/jmp/linux-2.6] / include / linux / hid.h
index 215035b..8709365 100644 (file)
@@ -238,6 +238,42 @@ struct hid_item {
 #define HID_GD_RIGHT           0x00010092
 #define HID_GD_LEFT            0x00010093
 
+#define HID_DG_DIGITIZER       0x000d0001
+#define HID_DG_PEN             0x000d0002
+#define HID_DG_LIGHTPEN                0x000d0003
+#define HID_DG_TOUCHSCREEN     0x000d0004
+#define HID_DG_TOUCHPAD                0x000d0005
+#define HID_DG_STYLUS          0x000d0020
+#define HID_DG_PUCK            0x000d0021
+#define HID_DG_FINGER          0x000d0022
+#define HID_DG_TIPPRESSURE     0x000d0030
+#define HID_DG_BARRELPRESSURE  0x000d0031
+#define HID_DG_INRANGE         0x000d0032
+#define HID_DG_TOUCH           0x000d0033
+#define HID_DG_UNTOUCH         0x000d0034
+#define HID_DG_TAP             0x000d0035
+#define HID_DG_TABLETFUNCTIONKEY       0x000d0039
+#define HID_DG_PROGRAMCHANGEKEY        0x000d003a
+#define HID_DG_INVERT          0x000d003c
+#define HID_DG_TIPSWITCH       0x000d0042
+#define HID_DG_TIPSWITCH2      0x000d0043
+#define HID_DG_BARRELSWITCH    0x000d0044
+#define HID_DG_ERASER          0x000d0045
+#define HID_DG_TABLETPICK      0x000d0046
+/*
+ * as of May 20, 2009 the usages below are not yet in the official USB spec
+ * but are being pushed by Microsft as described in their paper "Digitizer
+ * Drivers for Windows Touch and Pen-Based Computers"
+ */
+#define HID_DG_CONFIDENCE      0x000d0047
+#define HID_DG_WIDTH           0x000d0048
+#define HID_DG_HEIGHT          0x000d0049
+#define HID_DG_CONTACTID       0x000d0051
+#define HID_DG_INPUTMODE       0x000d0052
+#define HID_DG_DEVICEINDEX     0x000d0053
+#define HID_DG_CONTACTCOUNT    0x000d0054
+#define HID_DG_CONTACTMAX      0x000d0055
+
 /*
  * HID report types --- Ouch! HID spec says 1 2 3!
  */
@@ -270,11 +306,13 @@ struct hid_item {
 
 #define HID_QUIRK_INVERT                       0x00000001
 #define HID_QUIRK_NOTOUCH                      0x00000002
+#define HID_QUIRK_IGNORE                       0x00000004
 #define HID_QUIRK_NOGET                                0x00000008
 #define HID_QUIRK_BADPAD                       0x00000020
 #define HID_QUIRK_MULTI_INPUT                  0x00000040
 #define HID_QUIRK_SKIP_OUTPUT_REPORTS          0x00010000
 #define HID_QUIRK_FULLSPEED_INTERVAL           0x10000000
+#define HID_QUIRK_NO_INIT_REPORTS              0x20000000
 
 /*
  * This is the global environment of the parser. This information is
@@ -457,12 +495,21 @@ struct hid_device {                                                       /* device report descriptor */
 
        /* hiddev event handler */
        int (*hiddev_connect)(struct hid_device *, unsigned int);
+       void (*hiddev_disconnect)(struct hid_device *);
        void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field,
                                  struct hid_usage *, __s32);
        void (*hiddev_report_event) (struct hid_device *, struct hid_report *);
 
        /* handler for raw output data, used by hidraw */
        int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t);
+
+       /* debugging support via debugfs */
+       unsigned short debug;
+       struct dentry *debug_dir;
+       struct dentry *debug_rdesc;
+       struct dentry *debug_events;
+       struct list_head debug_list;
+       wait_queue_head_t debug_wait;
 };
 
 static inline void *hid_get_drvdata(struct hid_device *hdev)
@@ -603,21 +650,24 @@ struct hid_ll_driver {
        int (*open)(struct hid_device *hdev);
        void (*close)(struct hid_device *hdev);
 
+       int (*power)(struct hid_device *hdev, int level);
+
        int (*hidinput_input_event) (struct input_dev *idev, unsigned int type,
                        unsigned int code, int value);
 
        int (*parse)(struct hid_device *hdev);
 };
 
+#define        PM_HINT_FULLON  1<<5
+#define PM_HINT_NORMAL 1<<1
+
 /* Applications from HID Usage Tables 4/8/99 Version 1.1 */
 /* We ignore a few input applications that are not widely used */
 #define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001) || (a == 0x000d0002))
 
 /* HID core API */
 
-#ifdef CONFIG_HID_DEBUG
 extern int hid_debug;
-#endif
 
 extern int hid_add_device(struct hid_device *);
 extern void hid_destroy_device(struct hid_device *);
@@ -641,7 +691,9 @@ int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int
 void hid_output_report(struct hid_report *report, __u8 *data);
 struct hid_device *hid_allocate_device(void);
 int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size);
+int hid_check_keys_pressed(struct hid_device *hid);
 int hid_connect(struct hid_device *hid, unsigned int connect_mask);
+void hid_disconnect(struct hid_device *hid);
 
 /**
  * hid_map_usage - map usage input bits
@@ -751,6 +803,7 @@ static inline int __must_check hid_hw_start(struct hid_device *hdev,
  */
 static inline void hid_hw_stop(struct hid_device *hdev)
 {
+       hid_disconnect(hdev);
        hdev->ll_driver->stop(hdev);
 }
 
@@ -772,36 +825,12 @@ int hid_pidff_init(struct hid_device *hid);
 #define hid_pidff_init NULL
 #endif
 
-#ifdef CONFIG_HID_DEBUG
 #define dbg_hid(format, arg...) if (hid_debug) \
                                printk(KERN_DEBUG "%s: " format ,\
                                __FILE__ , ## arg)
-#define dbg_hid_line(format, arg...) if (hid_debug) \
-                               printk(format, ## arg)
-#else
-static inline int __attribute__((format(printf, 1, 2)))
-dbg_hid(const char *fmt, ...)
-{
-       return 0;
-}
-#define dbg_hid_line dbg_hid
-#endif /* HID_DEBUG */
-
 #define err_hid(format, arg...) printk(KERN_ERR "%s: " format "\n" , \
                __FILE__ , ## arg)
 #endif /* HID_FF */
 
-#ifdef CONFIG_HID_COMPAT
-#define HID_COMPAT_LOAD_DRIVER(name)   \
-void hid_compat_##name(void) { }       \
-EXPORT_SYMBOL(hid_compat_##name)
-#else
-#define HID_COMPAT_LOAD_DRIVER(name)
-#endif /* HID_COMPAT */
-#define HID_COMPAT_CALL_DRIVER(name)   do {    \
-       extern void hid_compat_##name(void);    \
-       hid_compat_##name();                    \
-} while (0)
-
 #endif