Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 23 May 2007 15:11:43 +0000 (08:11 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 23 May 2007 15:11:43 +0000 (08:11 -0700)
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: ads7846 - SPI_CPHA mode bugfix
  Input: ads7846 - document that it handles tsc2046 too
  Input: input-polldev - add module info
  Input: ucb1x00-ts - remove commented out code
  Input: ucb1400_ts - use sched_setscheduler()
  Input: ALPS - force stream mode
  Input: iforce - minor clean-ups
  Input: iforce - fix force feedback not working
  Input: adbhid - do not access input_dev->private directly
  Input: logips2pp - add type 72 (PS/2 TrackMan Marble)

drivers/input/joystick/iforce/iforce-main.c
drivers/input/joystick/iforce/iforce-packets.c
drivers/input/joystick/iforce/iforce-usb.c
drivers/input/misc/input-polldev.c
drivers/input/mouse/alps.c
drivers/input/mouse/logips2pp.c
drivers/input/touchscreen/Kconfig
drivers/input/touchscreen/ads7846.c
drivers/input/touchscreen/ucb1400_ts.c
drivers/macintosh/adbhid.c
drivers/mfd/ucb1x00-ts.c

index fb129c479a666124670bfba0652f01ba66fb5ba2..682244b1c0422610e9475020d83f67cb7fff51e4 100644 (file)
@@ -370,10 +370,8 @@ int iforce_init_device(struct iforce *iforce)
 
 /*
  * Disable spring, enable force feedback.
- * FIXME: We should use iforce_set_autocenter() et al here.
  */
-
-       iforce_send_packet(iforce, FF_CMD_AUTOCENTER, "\004\000");
+       iforce_set_autocenter(input_dev, 0);
 
 /*
  * Find appropriate device entry
index 21c4e13d3a508c15e17c50d2b6b453aed7fcf5f4..3154ccd7400098d1110fca740ed8156bb2a7eb32 100644 (file)
@@ -246,6 +246,8 @@ void iforce_process_packet(struct iforce *iforce, u16 cmd, unsigned char *data)
 
 int iforce_get_id_packet(struct iforce *iforce, char *packet)
 {
+       int status;
+
        switch (iforce->bus) {
 
        case IFORCE_USB:
@@ -254,18 +256,22 @@ int iforce_get_id_packet(struct iforce *iforce, char *packet)
                iforce->cr.bRequest = packet[0];
                iforce->ctrl->dev = iforce->usbdev;
 
-               if (usb_submit_urb(iforce->ctrl, GFP_ATOMIC))
+               status = usb_submit_urb(iforce->ctrl, GFP_ATOMIC);
+               if (status) {
+                       err("usb_submit_urb failed %d", status);
                        return -1;
+               }
 
                wait_event_interruptible_timeout(iforce->wait,
                        iforce->ctrl->status != -EINPROGRESS, HZ);
 
                if (iforce->ctrl->status) {
+                       dbg("iforce->ctrl->status = %d", iforce->ctrl->status);
                        usb_unlink_urb(iforce->ctrl);
                        return -1;
                }
 #else
-               err("iforce_get_id_packet: iforce->bus = USB!");
+               dbg("iforce_get_id_packet: iforce->bus = USB!");
 #endif
                break;
 
index 750099d8e3c62dd36499793de5473a4c18dfce7e..1457b73850e7dd03e41fdb8df932342a3857b281 100644 (file)
@@ -65,6 +65,7 @@ void iforce_usb_xmit(struct iforce *iforce)
        XMIT_INC(iforce->xmit.tail, n);
 
        if ( (n=usb_submit_urb(iforce->out, GFP_ATOMIC)) ) {
+               clear_bit(IFORCE_XMIT_RUNNING, iforce->xmit_flags);
                warn("usb_submit_urb failed %d\n", n);
        }
 
@@ -163,8 +164,8 @@ static int iforce_usb_probe(struct usb_interface *intf,
        usb_fill_int_urb(iforce->irq, dev, usb_rcvintpipe(dev, epirq->bEndpointAddress),
                        iforce->data, 16, iforce_usb_irq, iforce, epirq->bInterval);
 
-       usb_fill_bulk_urb(iforce->out, dev, usb_sndbulkpipe(dev, epout->bEndpointAddress),
-                       iforce + 1, 32, iforce_usb_out, iforce);
+       usb_fill_int_urb(iforce->out, dev, usb_sndintpipe(dev, epout->bEndpointAddress),
+                       iforce + 1, 32, iforce_usb_out, iforce, epout->bInterval);
 
        usb_fill_control_urb(iforce->ctrl, dev, usb_rcvctrlpipe(dev, 0),
                        (void*) &iforce->cr, iforce->edata, 16, iforce_usb_ctrl, iforce);
index 1b2b9c9c5d88f405f3b1e2dca2303df9e723e22c..b773d4c756a61333d1e5d65ae5cc282cbe01815b 100644 (file)
 #include <linux/mutex.h>
 #include <linux/input-polldev.h>
 
+MODULE_AUTHOR("Dmitry Torokhov <dtor@mail.ru>");
+MODULE_DESCRIPTION("Generic implementation of a polled input device");
+MODULE_LICENSE("GPL v2");
+MODULE_VERSION("0.1");
+
 static DEFINE_MUTEX(polldev_mutex);
 static int polldev_users;
 static struct workqueue_struct *polldev_wq;
index cf3e4664e72bc59cf36ffb4a7987ae7fed3140f0..2c5f11a4f6b410f1c2fbff3f50b42ca0bcfc7b1e 100644 (file)
@@ -251,11 +251,15 @@ static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int
 
        dbg("E7 report: %2.2x %2.2x %2.2x", param[0], param[1], param[2]);
 
-       for (i = 0; i < ARRAY_SIZE(rates) && param[2] != rates[i]; i++);
-       *version = (param[0] << 8) | (param[1] << 4) | i;
+       if (version) {
+               for (i = 0; i < ARRAY_SIZE(rates) && param[2] != rates[i]; i++)
+                       /* empty */;
+               *version = (param[0] << 8) | (param[1] << 4) | i;
+       }
 
        for (i = 0; i < ARRAY_SIZE(alps_model_data); i++)
-               if (!memcmp(param, alps_model_data[i].signature, sizeof(alps_model_data[i].signature)))
+               if (!memcmp(param, alps_model_data[i].signature,
+                           sizeof(alps_model_data[i].signature)))
                        return alps_model_data + i;
 
        return NULL;
@@ -380,32 +384,46 @@ static int alps_poll(struct psmouse *psmouse)
        return 0;
 }
 
-static int alps_reconnect(struct psmouse *psmouse)
+static int alps_hw_init(struct psmouse *psmouse, int *version)
 {
        struct alps_data *priv = psmouse->private;
-       int version;
-
-       psmouse_reset(psmouse);
 
-       if (!(priv->i = alps_get_model(psmouse, &version)))
+       priv->i = alps_get_model(psmouse, version);
+       if (!priv->i)
                return -1;
 
        if ((priv->i->flags & ALPS_PASS) && alps_passthrough_mode(psmouse, 1))
                return -1;
 
        if (alps_tap_mode(psmouse, 1)) {
-               printk(KERN_WARNING "alps.c: Failed to reenable hardware tapping\n");
+               printk(KERN_WARNING "alps.c: Failed to enable hardware tapping\n");
                return -1;
        }
 
        if (alps_absolute_mode(psmouse)) {
-               printk(KERN_ERR "alps.c: Failed to reenable absolute mode\n");
+               printk(KERN_ERR "alps.c: Failed to enable absolute mode\n");
                return -1;
        }
 
        if ((priv->i->flags & ALPS_PASS) && alps_passthrough_mode(psmouse, 0))
                return -1;
 
+       /* ALPS needs stream mode, otherwise it won't report any data */
+       if (ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_SETSTREAM)) {
+               printk(KERN_ERR "alps.c: Failed to enable stream mode\n");
+               return -1;
+       }
+
+       return 0;
+}
+
+static int alps_reconnect(struct psmouse *psmouse)
+{
+       psmouse_reset(psmouse);
+
+       if (alps_hw_init(psmouse, NULL))
+               return -1;
+
        return 0;
 }
 
@@ -430,23 +448,9 @@ int alps_init(struct psmouse *psmouse)
                goto init_fail;
 
        priv->dev2 = dev2;
+       psmouse->private = priv;
 
-       priv->i = alps_get_model(psmouse, &version);
-       if (!priv->i)
-               goto init_fail;
-
-       if ((priv->i->flags & ALPS_PASS) && alps_passthrough_mode(psmouse, 1))
-               goto init_fail;
-
-       if (alps_tap_mode(psmouse, 1))
-               printk(KERN_WARNING "alps.c: Failed to enable hardware tapping\n");
-
-       if (alps_absolute_mode(psmouse)) {
-               printk(KERN_ERR "alps.c: Failed to enable absolute mode\n");
-               goto init_fail;
-       }
-
-       if ((priv->i->flags & ALPS_PASS) && alps_passthrough_mode(psmouse, 0))
+       if (alps_hw_init(psmouse, &version))
                goto init_fail;
 
        dev1->evbit[LONG(EV_KEY)] |= BIT(EV_KEY);
@@ -493,13 +497,13 @@ int alps_init(struct psmouse *psmouse)
        /* We are having trouble resyncing ALPS touchpads so disable it for now */
        psmouse->resync_time = 0;
 
-       psmouse->private = priv;
        return 0;
 
 init_fail:
        psmouse_reset(psmouse);
        input_free_device(dev2);
        kfree(priv);
+       psmouse->private = NULL;
        return -1;
 }
 
index 9df74b72e6c4669c5d5ecd2863ae4f02aeff8437..0c5660d28caa18bafb5d3ab62a9219f3fc1c96ec 100644 (file)
@@ -221,6 +221,7 @@ static const struct ps2pp_info *get_model_info(unsigned char model)
                { 66,   PS2PP_KIND_MX,                                  /* MX3100 reciver */
                                PS2PP_WHEEL | PS2PP_SIDE_BTN | PS2PP_TASK_BTN |
                                PS2PP_EXTRA_BTN | PS2PP_NAV_BTN | PS2PP_HWHEEL },
+               { 72,   PS2PP_KIND_TRACKMAN,    0 },                    /* T-CH11: TrackMan Marble */
                { 73,   0,                      PS2PP_SIDE_BTN },
                { 75,   PS2PP_KIND_WHEEL,       PS2PP_WHEEL },
                { 76,   PS2PP_KIND_WHEEL,       PS2PP_WHEEL },
index 4f091800bfebd30daa41b00fb96a93c2b9911eb2..e5cca9bd040632bcbe7d7064a63ca4394c077e3d 100644 (file)
@@ -12,17 +12,17 @@ menuconfig INPUT_TOUCHSCREEN
 if INPUT_TOUCHSCREEN
 
 config TOUCHSCREEN_ADS7846
-       tristate "ADS 7846/7843 based touchscreens"
+       tristate "ADS7846/TSC2046 and ADS7843 based touchscreens"
        depends on SPI_MASTER
        depends on HWMON = n || HWMON
        help
          Say Y here if you have a touchscreen interface using the
-         ADS7846 or ADS7843 controller, and your board-specific setup
-         code includes that in its table of SPI devices.
+         ADS7846/TSC2046 or ADS7843 controller, and your board-specific
+         setup code includes that in its table of SPI devices.
 
          If HWMON is selected, and the driver is told the reference voltage
          on your board, you will also get hwmon interfaces for the voltage
-         (and on ads7846, temperature) sensors of this chip.
+         (and on ads7846/tsc2046, temperature) sensors of this chip.
 
          If unsure, say N (but it's safe to say "Y").
 
index 693e3b2a65a35e0a8c4c6f20ee93fa0018b6fa47..1c9069cd3bae4228fe1ed142c8c6543b4467ad11 100644 (file)
@@ -39,6 +39,7 @@
 /*
  * This code has been heavily tested on a Nokia 770, and lightly
  * tested on other ads7846 devices (OSK/Mistral, Lubbock).
+ * TSC2046 is just newer ads7846 silicon.
  * Support for ads7843 tested on Atmel at91sam926x-EK.
  * Support for ads7845 has only been stubbed in.
  *
@@ -847,7 +848,7 @@ static int __devinit ads7846_probe(struct spi_device *spi)
         * may not.  So we stick to very-portable 8 bit words, both RX and TX.
         */
        spi->bits_per_word = 8;
-       spi->mode = SPI_MODE_1;
+       spi->mode = SPI_MODE_0;
        err = spi_setup(spi);
        if (err < 0)
                return err;
index 6582816a04778806f773d53b16d64908cbd6d451..f0cbcdb008edd424b06a845c292e500c803058d2 100644 (file)
@@ -288,9 +288,9 @@ static int ucb1400_ts_thread(void *_ucb)
        struct ucb1400 *ucb = _ucb;
        struct task_struct *tsk = current;
        int valid = 0;
+       struct sched_param param = { .sched_priority = 1 };
 
-       tsk->policy = SCHED_FIFO;
-       tsk->rt_priority = 1;
+       sched_setscheduler(tsk, SCHED_FIFO, &param);
 
        while (!kthread_should_stop()) {
                unsigned int x, y, p;
index b77ef5187d6d0e6488217e9a38c9000ada5d8716..b46817f699f157899257907d0c77cbf113d61573 100644 (file)
@@ -628,16 +628,16 @@ static void real_leds(unsigned char leds, int device)
  */
 static int adbhid_kbd_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
 {
-       struct adbhid *adbhid = dev->private;
+       struct adbhid *adbhid = input_get_drvdata(dev);
        unsigned char leds;
 
        switch (type) {
        case EV_LED:
-         leds = (test_bit(LED_SCROLLL, dev->led) ? 4 : 0)
-              | (test_bit(LED_NUML,    dev->led) ? 1 : 0)
-              | (test_bit(LED_CAPSL,   dev->led) ? 2 : 0);
-         real_leds(leds, adbhid->id);
-         return 0;
+               leds =  (test_bit(LED_SCROLLL, dev->led) ? 4 : 0) |
+                       (test_bit(LED_NUML,    dev->led) ? 1 : 0) |
+                       (test_bit(LED_CAPSL,   dev->led) ? 2 : 0);
+               real_leds(leds, adbhid->id);
+               return 0;
        }
 
        return -1;
@@ -649,7 +649,7 @@ adb_message_handler(struct notifier_block *this, unsigned long code, void *x)
        switch (code) {
        case ADB_MSG_PRE_RESET:
        case ADB_MSG_POWERDOWN:
-               /* Stop the repeat timer. Autopoll is already off at this point */
+               /* Stop the repeat timer. Autopoll is already off at this point */
                {
                        int i;
                        for (i = 1; i < 16; i++) {
@@ -699,7 +699,7 @@ adbhid_input_register(int id, int default_id, int original_handler_id,
        hid->current_handler_id = current_handler_id;
        hid->mouse_kind = mouse_kind;
        hid->flags = 0;
-       input_dev->private = hid;
+       input_set_drvdata(input_dev, hid);
        input_dev->name = hid->name;
        input_dev->phys = hid->phys;
        input_dev->id.bustype = BUS_ADB;
index cb8c264eaff07e7ce93883e164910d60b909f191..7772bd1d92b4be3af84623819e69947deb6e160c 100644 (file)
@@ -207,16 +207,7 @@ static int ucb1x00_thread(void *_ts)
        struct ucb1x00_ts *ts = _ts;
        struct task_struct *tsk = current;
        DECLARE_WAITQUEUE(wait, tsk);
-       int valid;
-
-       /*
-        * We could run as a real-time thread.  However, thus far
-        * this doesn't seem to be necessary.
-        */
-//     tsk->policy = SCHED_FIFO;
-//     tsk->rt_priority = 1;
-
-       valid = 0;
+       int valid = 0;
 
        add_wait_queue(&ts->irq_wait, &wait);
        while (!kthread_should_stop()) {