Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
authorDmitry Torokhov <dtor@insightbb.com>
Tue, 8 May 2007 05:31:11 +0000 (01:31 -0400)
committerDmitry Torokhov <dtor@insightbb.com>
Tue, 8 May 2007 05:31:11 +0000 (01:31 -0400)
19 files changed:
drivers/input/evdev.c
drivers/input/ff-core.c
drivers/input/joystick/analog.c
drivers/input/joystick/db9.c
drivers/input/joystick/gamecon.c
drivers/input/joystick/iforce/iforce.h
drivers/input/joystick/turbografx.c
drivers/input/keyboard/Kconfig
drivers/input/keyboard/aaed2000_kbd.c
drivers/input/misc/uinput.c
drivers/input/mouse/synaptics.c
drivers/usb/input/acecad.c
drivers/usb/input/ati_remote2.c
drivers/usb/input/kbtab.c
drivers/usb/input/powermate.c
drivers/usb/input/usbtouchscreen.c
drivers/usb/input/wacom_wac.h
drivers/usb/input/yealink.c
include/linux/uinput.h

index 1f6fcec0c6fc31491e60f543c18d5f2899d8d4a5..a4c3729d39608d6f67f9a48547ab855407eef783 100644 (file)
@@ -512,7 +512,7 @@ static long evdev_ioctl_handler(struct file *file, unsigned int cmd,
 
                                if ((_IOC_NR(cmd) & ~EV_MAX) == _IOC_NR(EVIOCGBIT(0,0))) {
 
-                                       long *bits;
+                                       unsigned long *bits;
                                        int len;
 
                                        switch (_IOC_NR(cmd) & EV_MAX) {
@@ -557,7 +557,7 @@ static long evdev_ioctl_handler(struct file *file, unsigned int cmd,
 
                                if ((_IOC_NR(cmd) & ~ABS_MAX) == _IOC_NR(EVIOCGABS(0))) {
 
-                                       int t = _IOC_NR(cmd) & ABS_MAX;
+                                       t = _IOC_NR(cmd) & ABS_MAX;
 
                                        abs.value = dev->abs[t];
                                        abs.minimum = dev->absmin[t];
@@ -577,7 +577,7 @@ static long evdev_ioctl_handler(struct file *file, unsigned int cmd,
 
                                if ((_IOC_NR(cmd) & ~ABS_MAX) == _IOC_NR(EVIOCSABS(0))) {
 
-                                       int t = _IOC_NR(cmd) & ABS_MAX;
+                                       t = _IOC_NR(cmd) & ABS_MAX;
 
                                        if (copy_from_user(&abs, p, sizeof(struct input_absinfo)))
                                                return -EFAULT;
index 783b3412ceadad32b77430c483ce3375faafc481..eebc72465fc9beb44d2ecfa77a78d24cbd31f891 100644 (file)
@@ -281,7 +281,8 @@ int input_ff_event(struct input_dev *dev, unsigned int type,
                break;
 
        default:
-               ff->playback(dev, code, value);
+               if (check_effect_access(ff, code, NULL) == 0)
+                       ff->playback(dev, code, value);
                break;
        }
 
index 1c1afb5d46842c5c3954275ca0cffcbb9e1a32de..bdd157c1ebf8929b763a9d56815ce209c5d906f2 100644 (file)
@@ -53,7 +53,7 @@ MODULE_LICENSE("GPL");
 #define ANALOG_PORTS           16
 
 static char *js[ANALOG_PORTS];
-static int js_nargs;
+static unsigned int js_nargs;
 static int analog_options[ANALOG_PORTS];
 module_param_array_named(map, js, charp, &js_nargs, 0);
 MODULE_PARM_DESC(map, "Describes analog joysticks type/capabilities");
index c27593bf99789fe148a907a29cf7befecf0cb7c5..86ad1027e12a1ceabeedc5df8911fdfd30fdbc12 100644 (file)
@@ -46,17 +46,17 @@ MODULE_LICENSE("GPL");
 
 struct db9_config {
        int args[2];
-       int nargs;
+       unsigned int nargs;
 };
 
 #define DB9_MAX_PORTS          3
-static struct db9_config db9[DB9_MAX_PORTS] __initdata;
+static struct db9_config db9_cfg[DB9_MAX_PORTS] __initdata;
 
-module_param_array_named(dev, db9[0].args, int, &db9[0].nargs, 0);
+module_param_array_named(dev, db9_cfg[0].args, int, &db9_cfg[0].nargs, 0);
 MODULE_PARM_DESC(dev, "Describes first attached device (<parport#>,<type>)");
-module_param_array_named(dev2, db9[1].args, int, &db9[0].nargs, 0);
+module_param_array_named(dev2, db9_cfg[1].args, int, &db9_cfg[0].nargs, 0);
 MODULE_PARM_DESC(dev2, "Describes second attached device (<parport#>,<type>)");
-module_param_array_named(dev3, db9[2].args, int, &db9[2].nargs, 0);
+module_param_array_named(dev3, db9_cfg[2].args, int, &db9_cfg[2].nargs, 0);
 MODULE_PARM_DESC(dev3, "Describes third attached device (<parport#>,<type>)");
 
 #define DB9_ARG_PARPORT                0
@@ -680,17 +680,17 @@ static int __init db9_init(void)
        int err = 0;
 
        for (i = 0; i < DB9_MAX_PORTS; i++) {
-               if (db9[i].nargs == 0 || db9[i].args[DB9_ARG_PARPORT] < 0)
+               if (db9_cfg[i].nargs == 0 || db9_cfg[i].args[DB9_ARG_PARPORT] < 0)
                        continue;
 
-               if (db9[i].nargs < 2) {
+               if (db9_cfg[i].nargs < 2) {
                        printk(KERN_ERR "db9.c: Device type must be specified.\n");
                        err = -EINVAL;
                        break;
                }
 
-               db9_base[i] = db9_probe(db9[i].args[DB9_ARG_PARPORT],
-                                       db9[i].args[DB9_ARG_MODE]);
+               db9_base[i] = db9_probe(db9_cfg[i].args[DB9_ARG_PARPORT],
+                                       db9_cfg[i].args[DB9_ARG_MODE]);
                if (IS_ERR(db9_base[i])) {
                        err = PTR_ERR(db9_base[i]);
                        break;
index c71b58fe225db3a05ded9186b82ee600db734534..1a452e0e5f25788e37c972998912245747ec1657 100644 (file)
@@ -48,16 +48,16 @@ MODULE_LICENSE("GPL");
 
 struct gc_config {
        int args[GC_MAX_DEVICES + 1];
-       int nargs;
+       unsigned int nargs;
 };
 
-static struct gc_config gc[GC_MAX_PORTS] __initdata;
+static struct gc_config gc_cfg[GC_MAX_PORTS] __initdata;
 
-module_param_array_named(map, gc[0].args, int, &gc[0].nargs, 0);
+module_param_array_named(map, gc_cfg[0].args, int, &gc_cfg[0].nargs, 0);
 MODULE_PARM_DESC(map, "Describes first set of devices (<parport#>,<pad1>,<pad2>,..<pad5>)");
-module_param_array_named(map2, gc[1].args, int, &gc[1].nargs, 0);
+module_param_array_named(map2, gc_cfg[1].args, int, &gc_cfg[1].nargs, 0);
 MODULE_PARM_DESC(map2, "Describes second set of devices");
-module_param_array_named(map3, gc[2].args, int, &gc[2].nargs, 0);
+module_param_array_named(map3, gc_cfg[2].args, int, &gc_cfg[2].nargs, 0);
 MODULE_PARM_DESC(map3, "Describes third set of devices");
 
 /* see also gs_psx_delay parameter in PSX support section */
@@ -810,16 +810,17 @@ static int __init gc_init(void)
        int err = 0;
 
        for (i = 0; i < GC_MAX_PORTS; i++) {
-               if (gc[i].nargs == 0 || gc[i].args[0] < 0)
+               if (gc_cfg[i].nargs == 0 || gc_cfg[i].args[0] < 0)
                        continue;
 
-               if (gc[i].nargs < 2) {
+               if (gc_cfg[i].nargs < 2) {
                        printk(KERN_ERR "gamecon.c: at least one device must be specified\n");
                        err = -EINVAL;
                        break;
                }
 
-               gc_base[i] = gc_probe(gc[i].args[0], gc[i].args + 1, gc[i].nargs - 1);
+               gc_base[i] = gc_probe(gc_cfg[i].args[0],
+                                     gc_cfg[i].args + 1, gc_cfg[i].nargs - 1);
                if (IS_ERR(gc_base[i])) {
                        err = PTR_ERR(gc_base[i]);
                        break;
index dadcf4fb92aefd9d5ab1357328937ced02e825cb..40a853ac21c795c2e3db467be967f203a91f1d0b 100644 (file)
@@ -124,7 +124,7 @@ struct iforce {
        /* Buffer used for asynchronous sending of bytes to the device */
        struct circ_buf xmit;
        unsigned char xmit_data[XMIT_SIZE];
-       long xmit_flags[1];
+       unsigned long xmit_flags[1];
 
                                        /* Force Feedback */
        wait_queue_head_t wait;
index 0f2c60823b0b81890c163d8a0f6998908819a1bf..8381c6f143735f69af27b714cfcd7d79d2a37ed7 100644 (file)
@@ -48,16 +48,16 @@ MODULE_LICENSE("GPL");
 
 struct tgfx_config {
        int args[TGFX_MAX_DEVICES + 1];
-       int nargs;
+       unsigned int nargs;
 };
 
-static struct tgfx_config tgfx[TGFX_MAX_PORTS] __initdata;
+static struct tgfx_config tgfx_cfg[TGFX_MAX_PORTS] __initdata;
 
-module_param_array_named(map, tgfx[0].args, int, &tgfx[0].nargs, 0);
+module_param_array_named(map, tgfx_cfg[0].args, int, &tgfx_cfg[0].nargs, 0);
 MODULE_PARM_DESC(map, "Describes first set of devices (<parport#>,<js1>,<js2>,..<js7>");
-module_param_array_named(map2, tgfx[1].args, int, &tgfx[1].nargs, 0);
+module_param_array_named(map2, tgfx_cfg[1].args, int, &tgfx_cfg[1].nargs, 0);
 MODULE_PARM_DESC(map2, "Describes second set of devices");
-module_param_array_named(map3, tgfx[2].args, int, &tgfx[2].nargs, 0);
+module_param_array_named(map3, tgfx_cfg[2].args, int, &tgfx_cfg[2].nargs, 0);
 MODULE_PARM_DESC(map3, "Describes third set of devices");
 
 #define TGFX_REFRESH_TIME      HZ/100  /* 10 ms */
@@ -283,16 +283,18 @@ static int __init tgfx_init(void)
        int err = 0;
 
        for (i = 0; i < TGFX_MAX_PORTS; i++) {
-               if (tgfx[i].nargs == 0 || tgfx[i].args[0] < 0)
+               if (tgfx_cfg[i].nargs == 0 || tgfx_cfg[i].args[0] < 0)
                        continue;
 
-               if (tgfx[i].nargs < 2) {
+               if (tgfx_cfg[i].nargs < 2) {
                        printk(KERN_ERR "turbografx.c: at least one joystick must be specified\n");
                        err = -EINVAL;
                        break;
                }
 
-               tgfx_base[i] = tgfx_probe(tgfx[i].args[0], tgfx[i].args + 1, tgfx[i].nargs - 1);
+               tgfx_base[i] = tgfx_probe(tgfx_cfg[i].args[0],
+                                         tgfx_cfg[i].args + 1,
+                                         tgfx_cfg[i].nargs - 1);
                if (IS_ERR(tgfx_base[i])) {
                        err = PTR_ERR(tgfx_base[i]);
                        break;
index 9f42e4d3649efe83178e2e89a2b9fd6c9debef72..bd707b86c114a9b7fa323a46b51ccb15fd410b9f 100644 (file)
@@ -226,6 +226,7 @@ config KEYBOARD_PXA27x
 config KEYBOARD_AAED2000
        tristate "AAED-2000 keyboard"
        depends on MACH_AAED2000
+       select INPUT_POLLDEV
        default y
        help
          Say Y here to enable the keyboard on the Agilent AAED-2000
index 3a37505f067cc8cae3f551b1b26f0d7752133860..63d6ead6b877051baf18392140cd9e23a2df9f68 100644 (file)
 #include <linux/delay.h>
 #include <linux/platform_device.h>
 #include <linux/init.h>
-#include <linux/input.h>
+#include <linux/input-polldev.h>
 #include <linux/interrupt.h>
 #include <linux/jiffies.h>
 #include <linux/module.h>
 #include <linux/slab.h>
-#include <linux/workqueue.h>
 
 #include <asm/arch/hardware.h>
 #include <asm/arch/aaed2000.h>
@@ -46,8 +45,7 @@ static unsigned char aaedkbd_keycode[NR_SCANCODES] = {
 
 struct aaedkbd {
        unsigned char keycode[ARRAY_SIZE(aaedkbd_keycode)];
-       struct input_dev *input;
-       struct work_struct workq;
+       struct input_polled_dev *poll_dev;
        int kbdscan_state[KB_COLS];
        int kbdscan_count[KB_COLS];
 };
@@ -64,14 +62,15 @@ static void aaedkbd_report_col(struct aaedkbd *aaedkbd,
                scancode = SCANCODE(row, col);
                pressed = rowd & KB_ROWMASK(row);
 
-               input_report_key(aaedkbd->input, aaedkbd->keycode[scancode], pressed);
+               input_report_key(aaedkbd->poll_dev->input,
+                                aaedkbd->keycode[scancode], pressed);
        }
 }
 
 /* Scan the hardware keyboard and push any changes up through the input layer */
-static void aaedkbd_work(void *data)
+static void aaedkbd_poll(struct input_polled_dev *dev)
 {
-       struct aaedkbd *aaedkbd = data;
+       struct aaedkbd *aaedkbd = dev->private;
        unsigned int col, rowd;
 
        col = 0;
@@ -90,51 +89,34 @@ static void aaedkbd_work(void *data)
        } while (col < KB_COLS);
 
        AAEC_GPIO_KSCAN = 0x07;
-       input_sync(aaedkbd->input);
-
-       schedule_delayed_work(&aaedkbd->workq, msecs_to_jiffies(SCAN_INTERVAL));
-}
-
-static int aaedkbd_open(struct input_dev *indev)
-{
-       struct aaedkbd *aaedkbd = input_get_drvdata(indev);
-
-       schedule_delayed_work(&aaedkbd->workq, msecs_to_jiffies(SCAN_INTERVAL));
-
-       return 0;
-}
-
-static void aaedkbd_close(struct input_dev *indev)
-{
-       struct aaedkbd *aaedkbd = input_get_drvdata(indev);
-
-       cancel_delayed_work(&aaedkbd->workq);
-       flush_scheduled_work();
+       input_sync(dev->input);
 }
 
 static int __devinit aaedkbd_probe(struct platform_device *pdev)
 {
        struct aaedkbd *aaedkbd;
+       struct input_polled_dev *poll_dev;
        struct input_dev *input_dev;
        int i;
        int error;
 
        aaedkbd = kzalloc(sizeof(struct aaedkbd), GFP_KERNEL);
-       input_dev = input_allocate_device();
-       if (!aaedkbd || !input_dev) {
+       poll_dev = input_allocate_polled_device();
+       if (!aaedkbd || !poll_dev) {
                error = -ENOMEM;
                goto fail;
        }
 
        platform_set_drvdata(pdev, aaedkbd);
 
-       aaedkbd->input = input_dev;
-
-       /* Init keyboard rescan workqueue */
-       INIT_WORK(&aaedkbd->workq, aaedkbd_work, aaedkbd);
-
+       aaedkbd->poll_dev = poll_dev;
        memcpy(aaedkbd->keycode, aaedkbd_keycode, sizeof(aaedkbd->keycode));
 
+       poll_dev->private = aaedkbd;
+       poll_dev->poll = aaedkbd_poll;
+       poll_dev->poll_interval = SCAN_INTERVAL;
+
+       input_dev = poll_dev->input;
        input_dev->name = "AAED-2000 Keyboard";
        input_dev->phys = "aaedkbd/input0";
        input_dev->id.bustype = BUS_HOST;
@@ -143,8 +125,6 @@ static int __devinit aaedkbd_probe(struct platform_device *pdev)
        input_dev->id.version = 0x0100;
        input_dev->dev.parent = &pdev->dev;
 
-       input_set_drvdata(input_dev, aaedkbd);
-
        input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
        input_dev->keycode = aaedkbd->keycode;
        input_dev->keycodesize = sizeof(unsigned char);
@@ -154,17 +134,14 @@ static int __devinit aaedkbd_probe(struct platform_device *pdev)
                set_bit(aaedkbd->keycode[i], input_dev->keybit);
        clear_bit(0, input_dev->keybit);
 
-       input_dev->open = aaedkbd_open;
-       input_dev->close = aaedkbd_close;
-
-       error = input_register_device(aaedkbd->input);
+       error = input_register_polled_device(aaedkbd->poll_dev);
        if (error)
                goto fail;
 
        return 0;
 
  fail: kfree(aaedkbd);
-       input_free_device(input_dev);
+       input_free_polled_device(poll_dev);
        return error;
 }
 
@@ -172,7 +149,8 @@ static int __devexit aaedkbd_remove(struct platform_device *pdev)
 {
        struct aaedkbd *aaedkbd = platform_get_drvdata(pdev);
 
-       input_unregister_device(aaedkbd->input);
+       input_unregister_polled_device(aaedkbd->poll_dev);
+       input_free_polled_device(aaedkbd->poll_dev);
        kfree(aaedkbd);
 
        return 0;
index 031467eadd31c28a4e0a614588681c3cb7307990..a56ad4ba8fe2eb482ee4a26f1f36baa56753e1c5 100644 (file)
@@ -33,7 +33,6 @@
 #include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/init.h>
-#include <linux/input.h>
 #include <linux/smp_lock.h>
 #include <linux/fs.h>
 #include <linux/miscdevice.h>
index c77788bf932dfc586506c6784a8643eb78ffc86c..666ad3a53fdbfe74b9d978cd5cbdd22763075c78 100644 (file)
@@ -185,7 +185,7 @@ static int synaptics_query_hardware(struct psmouse *psmouse)
        int retries = 0;
 
        while ((retries++ < 3) && psmouse_reset(psmouse))
-               printk(KERN_ERR "synaptics reset failed\n");
+               /* empty */;
 
        if (synaptics_identify(psmouse))
                return -1;
index be8e9243c06203579e81b2e5a2ccff27c7a8fe8b..dd2310458c46a87aafaf0d2873a54f535dde0781 100644 (file)
@@ -54,7 +54,7 @@ struct usb_acecad {
        struct input_dev *input;
        struct urb *irq;
 
-       signed char *data;
+       unsigned char *data;
        dma_addr_t data_dma;
 };
 
index a9032aa3465f7bb5d70806af6bb4d55b0cee041a..1031543e5c3f3e1f71e4e15bcae5ae600aa0f087 100644 (file)
@@ -405,9 +405,7 @@ static void ati_remote2_urb_cleanup(struct ati_remote2 *ar2)
 
        for (i = 0; i < 2; i++) {
                usb_free_urb(ar2->urb[i]);
-
-               if (ar2->buf[i])
-                       usb_buffer_free(ar2->udev, 4, ar2->buf[i], ar2->buf_dma[i]);
+               usb_buffer_free(ar2->udev, 4, ar2->buf[i], ar2->buf_dma[i]);
        }
 }
 
index c4781b9d1297c025778f2cc5324816ffb2b62b6d..91e6d00d4a43ffdc4a8a26e21ea1ca9bd6e9df90 100644 (file)
@@ -29,7 +29,7 @@ module_param(kb_pressure_click, int, 0);
 MODULE_PARM_DESC(kb_pressure_click, "pressure threshold for clicks");
 
 struct kbtab {
-       signed char *data;
+       unsigned char *data;
        dma_addr_t data_dma;
        struct input_dev *dev;
        struct usb_device *usbdev;
index 4f93a760faeed74c699c23704178341359d2cdad..448a470d28f264d4ee6f666438d162a17225f694 100644 (file)
@@ -291,12 +291,10 @@ static int powermate_alloc_buffers(struct usb_device *udev, struct powermate_dev
 
 static void powermate_free_buffers(struct usb_device *udev, struct powermate_device *pm)
 {
-       if (pm->data)
-               usb_buffer_free(udev, POWERMATE_PAYLOAD_SIZE_MAX,
-                               pm->data, pm->data_dma);
-       if (pm->configcr)
-               usb_buffer_free(udev, sizeof(*(pm->configcr)),
-                               pm->configcr, pm->configcr_dma);
+       usb_buffer_free(udev, POWERMATE_PAYLOAD_SIZE_MAX,
+                       pm->data, pm->data_dma);
+       usb_buffer_free(udev, sizeof(*(pm->configcr)),
+                       pm->configcr, pm->configcr_dma);
 }
 
 /* Called whenever a USB device matching one in our supported devices table is connected */
index e0829413336b669a3d152681982930ec2480e013..8e18e6c6477771566a33b52e12ffbc9f28b8d098 100644 (file)
@@ -668,9 +668,8 @@ static void usbtouch_close(struct input_dev *input)
 static void usbtouch_free_buffers(struct usb_device *udev,
                                  struct usbtouch_usb *usbtouch)
 {
-       if (usbtouch->data)
-               usb_buffer_free(udev, usbtouch->type->rept_size,
-                               usbtouch->data, usbtouch->data_dma);
+       usb_buffer_free(udev, usbtouch->type->rept_size,
+                       usbtouch->data, usbtouch->data_dma);
        kfree(usbtouch->buffer);
 }
 
index a23022287248e12805f1250de2f0a41c3a079ae8..89793666ee8a15c2a2360e28cddf5ba63bcdbcee 100644 (file)
@@ -39,7 +39,7 @@ struct wacom_features {
 };
 
 struct wacom_wac {
-       signed char *data;
+       unsigned char *data;
         int tool[2];
         int id[2];
         __u32 serial[2];
index c54f1a5dcb4a480ba19fe04d907fa0a9184f4503..fc645b29918966fd8cd6beb9a344971f082b9ce4 100644 (file)
@@ -818,18 +818,17 @@ static int usb_cleanup(struct yealink_dev *yld, int err)
                else
                        input_unregister_device(yld->idev);
        }
-       if (yld->ctl_req)
-               usb_buffer_free(yld->udev, sizeof(*(yld->ctl_req)),
-                               yld->ctl_req, yld->ctl_req_dma);
-       if (yld->ctl_data)
-               usb_buffer_free(yld->udev, USB_PKT_LEN,
-                               yld->ctl_data, yld->ctl_dma);
-       if (yld->irq_data)
-               usb_buffer_free(yld->udev, USB_PKT_LEN,
-                               yld->irq_data, yld->irq_dma);
-
-       usb_free_urb(yld->urb_irq);     /* parameter validation in core/urb */
-       usb_free_urb(yld->urb_ctl);     /* parameter validation in core/urb */
+
+       usb_free_urb(yld->urb_irq);
+       usb_free_urb(yld->urb_ctl);
+
+       usb_buffer_free(yld->udev, sizeof(*(yld->ctl_req)),
+                       yld->ctl_req, yld->ctl_req_dma);
+       usb_buffer_free(yld->udev, USB_PKT_LEN,
+                       yld->ctl_data, yld->ctl_dma);
+       usb_buffer_free(yld->udev, USB_PKT_LEN,
+                       yld->irq_data, yld->irq_dma);
+
        kfree(yld);
        return err;
 }
index 1fd61eeed664c6958e4595aa455f4c3228807712..a6c1e8eed2265e914f90b6611902974eed726fa0 100644 (file)
@@ -32,6 +32,8 @@
  *             - first public version
  */
 
+#include <linux/input.h>
+
 #define UINPUT_VERSION         3
 
 #ifdef __KERNEL__