Merge branch 'drm-patches' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
[pandora-kernel.git] / drivers / usb / input / aiptek.c
index 1c3b472..9f52429 100644 (file)
 #include <linux/jiffies.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
-#include <linux/input.h>
 #include <linux/module.h>
 #include <linux/init.h>
-#include <linux/usb.h>
-#include <linux/usb_input.h>
+#include <linux/usb/input.h>
 #include <linux/sched.h>
 #include <asm/uaccess.h>
 #include <asm/unaligned.h>
@@ -338,7 +336,7 @@ struct aiptek {
  * the bitmap which comes from the tablet. This hides the
  * issue that the F_keys are not sequentially numbered.
  */
-static int macroKeyEvents[] = {
+static const int macroKeyEvents[] = {
        KEY_ESC, KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5,
        KEY_F6, KEY_F7, KEY_F8, KEY_F9, KEY_F10, KEY_F11,
        KEY_F12, KEY_F13, KEY_F14, KEY_F15, KEY_F16, KEY_F17,
@@ -398,7 +396,7 @@ static int aiptek_convert_from_2s_complement(unsigned char c)
  * replaced with the input_sync() method (which emits EV_SYN.)
  */
 
-static void aiptek_irq(struct urb *urb, struct pt_regs *regs)
+static void aiptek_irq(struct urb *urb)
 {
        struct aiptek *aiptek = urb->context;
        unsigned char *data = aiptek->data;
@@ -444,8 +442,6 @@ static void aiptek_irq(struct urb *urb, struct pt_regs *regs)
                        aiptek->diagnostic =
                            AIPTEK_DIAGNOSTIC_SENDING_RELATIVE_IN_ABSOLUTE;
                } else {
-                       input_regs(inputdev, regs);
-
                        x = aiptek_convert_from_2s_complement(data[2]);
                        y = aiptek_convert_from_2s_complement(data[3]);
 
@@ -490,8 +486,6 @@ static void aiptek_irq(struct urb *urb, struct pt_regs *regs)
                            (aiptek->curSetting.pointerMode)) {
                                aiptek->diagnostic = AIPTEK_DIAGNOSTIC_TOOL_DISALLOWED;
                } else {
-                       input_regs(inputdev, regs);
-
                        x = le16_to_cpu(get_unaligned((__le16 *) (data + 1)));
                        y = le16_to_cpu(get_unaligned((__le16 *) (data + 3)));
                        z = le16_to_cpu(get_unaligned((__le16 *) (data + 6)));
@@ -570,7 +564,6 @@ static void aiptek_irq(struct urb *urb, struct pt_regs *regs)
                        (aiptek->curSetting.pointerMode)) {
                        aiptek->diagnostic = AIPTEK_DIAGNOSTIC_TOOL_DISALLOWED;
                } else {
-                       input_regs(inputdev, regs);
                        x = le16_to_cpu(get_unaligned((__le16 *) (data + 1)));
                        y = le16_to_cpu(get_unaligned((__le16 *) (data + 3)));
 
@@ -633,8 +626,6 @@ static void aiptek_irq(struct urb *urb, struct pt_regs *regs)
                z = le16_to_cpu(get_unaligned((__le16 *) (data + 4)));
 
                if (dv != 0) {
-                       input_regs(inputdev, regs);
-
                        /* If we've not already sent a tool_button_?? code, do
                         * so now. Then set FIRED_BIT so it won't be resent unless
                         * the user forces FIRED_BIT off.
@@ -683,8 +674,6 @@ static void aiptek_irq(struct urb *urb, struct pt_regs *regs)
                macro = data[3];
 
                if (dv != 0) {
-                       input_regs(inputdev, regs);
-
                        /* If we've not already sent a tool_button_?? code, do
                         * so now. Then set FIRED_BIT so it won't be resent unless
                         * the user forces FIRED_BIT off.
@@ -728,8 +717,6 @@ static void aiptek_irq(struct urb *urb, struct pt_regs *regs)
         */
        else if (data[0] == 6) {
                macro = le16_to_cpu(get_unaligned((__le16 *) (data + 1)));
-               input_regs(inputdev, regs);
-
                if (macro > 0) {
                        input_report_key(inputdev, macroKeyEvents[macro - 1],
                                         0);
@@ -2001,7 +1988,7 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
                goto fail1;
 
        aiptek->data = usb_buffer_alloc(usbdev, AIPTEK_PACKET_LENGTH,
-                                       SLAB_ATOMIC, &aiptek->data_dma);
+                                       GFP_ATOMIC, &aiptek->data_dma);
        if (!aiptek->data)
                goto fail1;
 
@@ -2093,7 +2080,7 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
        /* Programming the tablet macro keys needs to be done with a for loop
         * as the keycodes are discontiguous.
         */
-       for (i = 0; i < sizeof(macroKeyEvents) / sizeof(macroKeyEvents[0]); ++i)
+       for (i = 0; i < ARRAY_SIZE(macroKeyEvents); ++i)
                set_bit(macroKeyEvents[i], inputdev->keybit);
 
        /*
@@ -2103,7 +2090,7 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
         * values.
         */
        input_set_abs_params(inputdev, ABS_X, 0, 2999, 0, 0);
-       input_set_abs_params(inputdev, ABS_X, 0, 2249, 0, 0);
+       input_set_abs_params(inputdev, ABS_Y, 0, 2249, 0, 0);
        input_set_abs_params(inputdev, ABS_PRESSURE, 0, 511, 0, 0);
        input_set_abs_params(inputdev, ABS_TILT_X, AIPTEK_TILT_MIN, AIPTEK_TILT_MAX, 0, 0);
        input_set_abs_params(inputdev, ABS_TILT_Y, AIPTEK_TILT_MIN, AIPTEK_TILT_MAX, 0, 0);
@@ -2135,7 +2122,7 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
         * not an error :-)
         */
 
-       for (i = 0; i < sizeof(speeds) / sizeof(speeds[0]); ++i) {
+       for (i = 0; i < ARRAY_SIZE(speeds); ++i) {
                aiptek->curSetting.programmableDelay = speeds[i];
                (void)aiptek_program_tablet(aiptek);
                if (aiptek->inputdev->absmax[ABS_X] > 0) {
@@ -2190,7 +2177,6 @@ fail1:    input_free_device(inputdev);
 static void aiptek_disconnect(struct usb_interface *intf);
 
 static struct usb_driver aiptek_driver = {
-       .owner = THIS_MODULE,
        .name = "aiptek",
        .probe = aiptek_probe,
        .disconnect = aiptek_disconnect,