~ubuntu-branches/ubuntu/trusty/linux-armadaxp/trusty

« back to all changes in this revision

Viewing changes to drivers/input/mouse/synaptics.c

  • Committer: Package Import Robot
  • Author(s): Michael Casadevall, Bryan Wu, Dann Frazier, Michael Casadeall
  • Date: 2012-03-10 15:00:54 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120310150054-flugb39zon8vvgwe
Tags: 3.2.0-1600.1
[ Bryan Wu ]
* UBUNTU: import debian/debian.env and debian.armadaxp

[ Dann Frazier ]
* ARM: Armada XP: remove trailing '/' in dirnames in mvRules.mk

[ Michael Casadeall ]
* tools: add some tools for Marvell Armada XP processor
* kernel: timer tick hacking from Marvell
* kernel: Sheeva Errata: add delay on Sheeva when powering down
* net: add Marvell NFP netfilter
* net: socket and skb modifications made by Marvell
* miscdevice: add minor IDs for some Marvell Armada drivers
* fs: introduce memory pool for splice()
* video: EDID detection updates from Marvell Armada XP patchset
* video: backlight: add Marvell Dove LCD backlight driver
* video: display: add THS8200 display driver
* video: framebuffer: add Marvell Dove and Armada XP processor onchip LCD controller driver
* usbtest: add Interrupt transfer testing by Marvell Armada XP code
* usb: ehci: add support for Marvell EHCI controler
* tty/serial: 8250: add support for Marvell Armada XP processor and DeviceTree work
* rtc: add support for Marvell Armada XP onchip RTC controller
* net: pppoe: add Marvell ethernet NFP hook in PPPoE networking driver
* mtd: nand: add support for Marvell Armada XP Nand Flash Controller
* mtd: maps: add Marvell Armada XP specific map driver
* mmc: add support for Marvell Armada XP MMC/SD host controller
* i2c: add support for Marvell Armada XP onchip i2c bus controller
* hwmon: add Kconfig option for Armada XP onchip thermal sensor driver
* dmaengine: add Net DMA support for splice and update Marvell XOR DMA engine driver
* ata: add support for Marvell Armada XP SATA controller and update some quirks
* ARM: add Marvell Armada XP machine to mach-types
* ARM: oprofile: add support for Marvell PJ4B core
* ARM: mm: more ARMv6 switches for Marvell Armada XP
* ARM: remove static declaration to allow compilation
* ARM: alignment access fault trick
* ARM: mm: skip some fault fixing when run on NONE SMP ARMv6 mode during early abort event
* ARM: mm: add Marvell Sheeva CPU Architecture for PJ4B
* ARM: introduce optimized copy operation for Marvell Armada XP
* ARM: SAUCE: hardware breakpoint trick for Marvell Armada XP
* ARM: big endian and little endian tricks for Marvell Armada XP
* ARM: SAUCE: Add Marvell Armada XP build rules to arch/arm/kernel/Makefile
* ARM: vfp: add special handling for Marvell Armada XP
* ARM: add support for Marvell U-Boot
* ARM: add mv_controller_num for ARM PCI drivers
* ARM: add support for local PMUs, general SMP tweaks and cache flushing
* ARM: add Marvell device identifies in glue-proc.h
* ARM: add IPC driver support for Marvell platforms
* ARM: add DMA mapping for Marvell platforms
* ARM: add Sheeva errata and PJ4B code for booting
* ARM: update Kconfig and Makefile to include Marvell Armada XP platforms
* ARM: Armada XP: import LSP from Marvell for Armada XP 3.2 kernel enablement

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
#define YMIN_NOMINAL 1408
46
46
#define YMAX_NOMINAL 4448
47
47
 
 
48
/*
 
49
 * Synaptics touchpads report the y coordinate from bottom to top, which is
 
50
 * opposite from what userspace expects.
 
51
 * This function is used to invert y before reporting.
 
52
 */
 
53
static int synaptics_invert_y(int y)
 
54
{
 
55
        return YMAX_NOMINAL + YMIN_NOMINAL - y;
 
56
}
 
57
 
48
58
 
49
59
/*****************************************************************************
50
60
 *      Stuff we need even when we do not want native Synaptics support
158
168
 
159
169
        if (SYN_EXT_CAP_REQUESTS(priv->capabilities) >= 1) {
160
170
                if (synaptics_send_cmd(psmouse, SYN_QUE_EXT_CAPAB, cap)) {
161
 
                        printk(KERN_ERR "Synaptics claims to have extended capabilities,"
162
 
                               " but I'm not able to read them.\n");
 
171
                        psmouse_warn(psmouse,
 
172
                                     "device claims to have extended capabilities, but I'm not able to read them.\n");
163
173
                } else {
164
174
                        priv->ext_cap = (cap[0] << 16) | (cap[1] << 8) | cap[2];
165
175
 
174
184
 
175
185
        if (SYN_EXT_CAP_REQUESTS(priv->capabilities) >= 4) {
176
186
                if (synaptics_send_cmd(psmouse, SYN_QUE_EXT_CAPAB_0C, cap)) {
177
 
                        printk(KERN_ERR "Synaptics claims to have extended capability 0x0c,"
178
 
                               " but I'm not able to read it.\n");
 
187
                        psmouse_warn(psmouse,
 
188
                                     "device claims to have extended capability 0x0c, but I'm not able to read it.\n");
179
189
                } else {
180
190
                        priv->ext_cap_0c = (cap[0] << 16) | (cap[1] << 8) | cap[2];
181
191
                }
208
218
static int synaptics_resolution(struct psmouse *psmouse)
209
219
{
210
220
        struct synaptics_data *priv = psmouse->private;
211
 
        unsigned char res[3];
212
 
        unsigned char max[3];
 
221
        unsigned char resp[3];
213
222
 
214
223
        if (SYN_ID_MAJOR(priv->identity) < 4)
215
224
                return 0;
216
225
 
217
 
        if (synaptics_send_cmd(psmouse, SYN_QUE_RESOLUTION, res) == 0) {
218
 
                if (res[0] != 0 && (res[1] & 0x80) && res[2] != 0) {
219
 
                        priv->x_res = res[0]; /* x resolution in units/mm */
220
 
                        priv->y_res = res[2]; /* y resolution in units/mm */
 
226
        if (synaptics_send_cmd(psmouse, SYN_QUE_RESOLUTION, resp) == 0) {
 
227
                if (resp[0] != 0 && (resp[1] & 0x80) && resp[2] != 0) {
 
228
                        priv->x_res = resp[0]; /* x resolution in units/mm */
 
229
                        priv->y_res = resp[2]; /* y resolution in units/mm */
221
230
                }
222
231
        }
223
232
 
224
233
        if (SYN_EXT_CAP_REQUESTS(priv->capabilities) >= 5 &&
225
234
            SYN_CAP_MAX_DIMENSIONS(priv->ext_cap_0c)) {
226
 
                if (synaptics_send_cmd(psmouse, SYN_QUE_EXT_DIMENSIONS, max)) {
227
 
                        printk(KERN_ERR "Synaptics claims to have dimensions query,"
228
 
                               " but I'm not able to read it.\n");
229
 
                } else {
230
 
                        priv->x_max = (max[0] << 5) | ((max[1] & 0x0f) << 1);
231
 
                        priv->y_max = (max[2] << 5) | ((max[1] & 0xf0) >> 3);
 
235
                if (synaptics_send_cmd(psmouse, SYN_QUE_EXT_MAX_COORDS, resp)) {
 
236
                        psmouse_warn(psmouse,
 
237
                                     "device claims to have max coordinates query, but I'm not able to read it.\n");
 
238
                } else {
 
239
                        priv->x_max = (resp[0] << 5) | ((resp[1] & 0x0f) << 1);
 
240
                        priv->y_max = (resp[2] << 5) | ((resp[1] & 0xf0) >> 3);
 
241
                }
 
242
        }
 
243
 
 
244
        if (SYN_EXT_CAP_REQUESTS(priv->capabilities) >= 7 &&
 
245
            SYN_CAP_MIN_DIMENSIONS(priv->ext_cap_0c)) {
 
246
                if (synaptics_send_cmd(psmouse, SYN_QUE_EXT_MIN_COORDS, resp)) {
 
247
                        psmouse_warn(psmouse,
 
248
                                     "device claims to have min coordinates query, but I'm not able to read it.\n");
 
249
                } else {
 
250
                        priv->x_min = (resp[0] << 5) | ((resp[1] & 0x0f) << 1);
 
251
                        priv->y_min = (resp[2] << 5) | ((resp[1] & 0xf0) >> 3);
232
252
                }
233
253
        }
234
254
 
285
305
        static unsigned char param = 0xc8;
286
306
        struct synaptics_data *priv = psmouse->private;
287
307
 
288
 
        if (!SYN_CAP_ADV_GESTURE(priv->ext_cap_0c))
 
308
        if (!(SYN_CAP_ADV_GESTURE(priv->ext_cap_0c) ||
 
309
                        SYN_CAP_IMAGE_SENSOR(priv->ext_cap_0c)))
289
310
                return 0;
290
311
 
291
312
        if (psmouse_sliced_command(psmouse, SYN_QUE_MODEL))
368
389
                        priv->mode &= ~SYN_BIT_FOUR_BYTE_CLIENT;
369
390
 
370
391
                if (synaptics_mode_cmd(psmouse, priv->mode))
371
 
                        printk(KERN_INFO "synaptics: failed to switch guest protocol\n");
 
392
                        psmouse_warn(psmouse,
 
393
                                     "failed to switch guest protocol\n");
372
394
        }
373
395
}
374
396
 
378
400
 
379
401
        serio = kzalloc(sizeof(struct serio), GFP_KERNEL);
380
402
        if (!serio) {
381
 
                printk(KERN_ERR "synaptics: not enough memory to allocate pass-through port\n");
 
403
                psmouse_err(psmouse,
 
404
                            "not enough memory for pass-through port\n");
382
405
                return;
383
406
        }
384
407
 
392
415
 
393
416
        psmouse->pt_activate = synaptics_pt_activate;
394
417
 
395
 
        printk(KERN_INFO "serio: %s port at %s\n", serio->name, psmouse->phys);
 
418
        psmouse_info(psmouse, "serio: %s port at %s\n",
 
419
                     serio->name, psmouse->phys);
396
420
        serio_register_port(serio);
397
421
}
398
422
 
400
424
 *      Functions to interpret the absolute mode packets
401
425
 ****************************************************************************/
402
426
 
 
427
static void synaptics_mt_state_set(struct synaptics_mt_state *state, int count,
 
428
                                   int sgm, int agm)
 
429
{
 
430
        state->count = count;
 
431
        state->sgm = sgm;
 
432
        state->agm = agm;
 
433
}
 
434
 
 
435
static void synaptics_parse_agm(const unsigned char buf[],
 
436
                                struct synaptics_data *priv,
 
437
                                struct synaptics_hw_state *hw)
 
438
{
 
439
        struct synaptics_hw_state *agm = &priv->agm;
 
440
        int agm_packet_type;
 
441
 
 
442
        agm_packet_type = (buf[5] & 0x30) >> 4;
 
443
        switch (agm_packet_type) {
 
444
        case 1:
 
445
                /* Gesture packet: (x, y, z) half resolution */
 
446
                agm->w = hw->w;
 
447
                agm->x = (((buf[4] & 0x0f) << 8) | buf[1]) << 1;
 
448
                agm->y = (((buf[4] & 0xf0) << 4) | buf[2]) << 1;
 
449
                agm->z = ((buf[3] & 0x30) | (buf[5] & 0x0f)) << 1;
 
450
                break;
 
451
 
 
452
        case 2:
 
453
                /* AGM-CONTACT packet: (count, sgm, agm) */
 
454
                synaptics_mt_state_set(&agm->mt_state, buf[1], buf[2], buf[4]);
 
455
                break;
 
456
 
 
457
        default:
 
458
                break;
 
459
        }
 
460
 
 
461
        /* Record that at least one AGM has been received since last SGM */
 
462
        priv->agm_pending = true;
 
463
}
 
464
 
403
465
static int synaptics_parse_hw_state(const unsigned char buf[],
404
466
                                    struct synaptics_data *priv,
405
467
                                    struct synaptics_hw_state *hw)
407
469
        memset(hw, 0, sizeof(struct synaptics_hw_state));
408
470
 
409
471
        if (SYN_MODEL_NEWABS(priv->model_id)) {
410
 
                hw->x = (((buf[3] & 0x10) << 8) |
411
 
                         ((buf[1] & 0x0f) << 8) |
412
 
                         buf[4]);
413
 
                hw->y = (((buf[3] & 0x20) << 7) |
414
 
                         ((buf[1] & 0xf0) << 4) |
415
 
                         buf[5]);
416
 
 
417
 
                hw->z = buf[2];
418
472
                hw->w = (((buf[0] & 0x30) >> 2) |
419
473
                         ((buf[0] & 0x04) >> 1) |
420
474
                         ((buf[3] & 0x04) >> 2));
421
475
 
422
 
                if (SYN_CAP_ADV_GESTURE(priv->ext_cap_0c) && hw->w == 2) {
423
 
                        /* Gesture packet: (x, y, z) at half resolution */
424
 
                        priv->mt.x = (((buf[4] & 0x0f) << 8) | buf[1]) << 1;
425
 
                        priv->mt.y = (((buf[4] & 0xf0) << 4) | buf[2]) << 1;
426
 
                        priv->mt.z = ((buf[3] & 0x30) | (buf[5] & 0x0f)) << 1;
427
 
                        return 1;
428
 
                }
429
 
 
430
476
                hw->left  = (buf[0] & 0x01) ? 1 : 0;
431
477
                hw->right = (buf[0] & 0x02) ? 1 : 0;
432
478
 
449
495
                        hw->down = ((buf[0] ^ buf[3]) & 0x02) ? 1 : 0;
450
496
                }
451
497
 
 
498
                if ((SYN_CAP_ADV_GESTURE(priv->ext_cap_0c) ||
 
499
                        SYN_CAP_IMAGE_SENSOR(priv->ext_cap_0c)) &&
 
500
                    hw->w == 2) {
 
501
                        synaptics_parse_agm(buf, priv, hw);
 
502
                        return 1;
 
503
                }
 
504
 
 
505
                hw->x = (((buf[3] & 0x10) << 8) |
 
506
                         ((buf[1] & 0x0f) << 8) |
 
507
                         buf[4]);
 
508
                hw->y = (((buf[3] & 0x20) << 7) |
 
509
                         ((buf[1] & 0xf0) << 4) |
 
510
                         buf[5]);
 
511
                hw->z = buf[2];
 
512
 
452
513
                if (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) &&
453
514
                    ((buf[0] ^ buf[3]) & 0x02)) {
454
515
                        switch (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) & ~0x01) {
486
547
        return 0;
487
548
}
488
549
 
489
 
static void set_slot(struct input_dev *dev, int slot, bool active, int x, int y)
 
550
static void synaptics_report_semi_mt_slot(struct input_dev *dev, int slot,
 
551
                                          bool active, int x, int y)
490
552
{
491
553
        input_mt_slot(dev, slot);
492
554
        input_mt_report_slot_state(dev, MT_TOOL_FINGER, active);
493
555
        if (active) {
494
556
                input_report_abs(dev, ABS_MT_POSITION_X, x);
495
 
                input_report_abs(dev, ABS_MT_POSITION_Y,
496
 
                                 YMAX_NOMINAL + YMIN_NOMINAL - y);
 
557
                input_report_abs(dev, ABS_MT_POSITION_Y, synaptics_invert_y(y));
497
558
        }
498
559
}
499
560
 
503
564
                                          int num_fingers)
504
565
{
505
566
        if (num_fingers >= 2) {
506
 
                set_slot(dev, 0, true, min(a->x, b->x), min(a->y, b->y));
507
 
                set_slot(dev, 1, true, max(a->x, b->x), max(a->y, b->y));
 
567
                synaptics_report_semi_mt_slot(dev, 0, true, min(a->x, b->x),
 
568
                                              min(a->y, b->y));
 
569
                synaptics_report_semi_mt_slot(dev, 1, true, max(a->x, b->x),
 
570
                                              max(a->y, b->y));
508
571
        } else if (num_fingers == 1) {
509
 
                set_slot(dev, 0, true, a->x, a->y);
510
 
                set_slot(dev, 1, false, 0, 0);
 
572
                synaptics_report_semi_mt_slot(dev, 0, true, a->x, a->y);
 
573
                synaptics_report_semi_mt_slot(dev, 1, false, 0, 0);
511
574
        } else {
512
 
                set_slot(dev, 0, false, 0, 0);
513
 
                set_slot(dev, 1, false, 0, 0);
514
 
        }
 
575
                synaptics_report_semi_mt_slot(dev, 0, false, 0, 0);
 
576
                synaptics_report_semi_mt_slot(dev, 1, false, 0, 0);
 
577
        }
 
578
}
 
579
 
 
580
static void synaptics_report_buttons(struct psmouse *psmouse,
 
581
                                     const struct synaptics_hw_state *hw)
 
582
{
 
583
        struct input_dev *dev = psmouse->dev;
 
584
        struct synaptics_data *priv = psmouse->private;
 
585
        int i;
 
586
 
 
587
        input_report_key(dev, BTN_LEFT, hw->left);
 
588
        input_report_key(dev, BTN_RIGHT, hw->right);
 
589
 
 
590
        if (SYN_CAP_MIDDLE_BUTTON(priv->capabilities))
 
591
                input_report_key(dev, BTN_MIDDLE, hw->middle);
 
592
 
 
593
        if (SYN_CAP_FOUR_BUTTON(priv->capabilities)) {
 
594
                input_report_key(dev, BTN_FORWARD, hw->up);
 
595
                input_report_key(dev, BTN_BACK, hw->down);
 
596
        }
 
597
 
 
598
        for (i = 0; i < SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap); i++)
 
599
                input_report_key(dev, BTN_0 + i, hw->ext_buttons & (1 << i));
 
600
}
 
601
 
 
602
static void synaptics_report_slot(struct input_dev *dev, int slot,
 
603
                                  const struct synaptics_hw_state *hw)
 
604
{
 
605
        input_mt_slot(dev, slot);
 
606
        input_mt_report_slot_state(dev, MT_TOOL_FINGER, (hw != NULL));
 
607
        if (!hw)
 
608
                return;
 
609
 
 
610
        input_report_abs(dev, ABS_MT_POSITION_X, hw->x);
 
611
        input_report_abs(dev, ABS_MT_POSITION_Y, synaptics_invert_y(hw->y));
 
612
        input_report_abs(dev, ABS_MT_PRESSURE, hw->z);
 
613
}
 
614
 
 
615
static void synaptics_report_mt_data(struct psmouse *psmouse,
 
616
                                     struct synaptics_mt_state *mt_state,
 
617
                                     const struct synaptics_hw_state *sgm)
 
618
{
 
619
        struct input_dev *dev = psmouse->dev;
 
620
        struct synaptics_data *priv = psmouse->private;
 
621
        struct synaptics_hw_state *agm = &priv->agm;
 
622
        struct synaptics_mt_state *old = &priv->mt_state;
 
623
 
 
624
        switch (mt_state->count) {
 
625
        case 0:
 
626
                synaptics_report_slot(dev, 0, NULL);
 
627
                synaptics_report_slot(dev, 1, NULL);
 
628
                break;
 
629
        case 1:
 
630
                if (mt_state->sgm == -1) {
 
631
                        synaptics_report_slot(dev, 0, NULL);
 
632
                        synaptics_report_slot(dev, 1, NULL);
 
633
                } else if (mt_state->sgm == 0) {
 
634
                        synaptics_report_slot(dev, 0, sgm);
 
635
                        synaptics_report_slot(dev, 1, NULL);
 
636
                } else {
 
637
                        synaptics_report_slot(dev, 0, NULL);
 
638
                        synaptics_report_slot(dev, 1, sgm);
 
639
                }
 
640
                break;
 
641
        default:
 
642
                /*
 
643
                 * If the finger slot contained in SGM is valid, and either
 
644
                 * hasn't changed, or is new, then report SGM in MTB slot 0.
 
645
                 * Otherwise, empty MTB slot 0.
 
646
                 */
 
647
                if (mt_state->sgm != -1 &&
 
648
                    (mt_state->sgm == old->sgm || old->sgm == -1))
 
649
                        synaptics_report_slot(dev, 0, sgm);
 
650
                else
 
651
                        synaptics_report_slot(dev, 0, NULL);
 
652
 
 
653
                /*
 
654
                 * If the finger slot contained in AGM is valid, and either
 
655
                 * hasn't changed, or is new, then report AGM in MTB slot 1.
 
656
                 * Otherwise, empty MTB slot 1.
 
657
                 */
 
658
                if (mt_state->agm != -1 &&
 
659
                    (mt_state->agm == old->agm || old->agm == -1))
 
660
                        synaptics_report_slot(dev, 1, agm);
 
661
                else
 
662
                        synaptics_report_slot(dev, 1, NULL);
 
663
                break;
 
664
        }
 
665
 
 
666
        /* Don't use active slot count to generate BTN_TOOL events. */
 
667
        input_mt_report_pointer_emulation(dev, false);
 
668
 
 
669
        /* Send the number of fingers reported by touchpad itself. */
 
670
        input_mt_report_finger_count(dev, mt_state->count);
 
671
 
 
672
        synaptics_report_buttons(psmouse, sgm);
 
673
 
 
674
        input_sync(dev);
 
675
}
 
676
 
 
677
/* Handle case where mt_state->count = 0 */
 
678
static void synaptics_image_sensor_0f(struct synaptics_data *priv,
 
679
                                      struct synaptics_mt_state *mt_state)
 
680
{
 
681
        synaptics_mt_state_set(mt_state, 0, -1, -1);
 
682
        priv->mt_state_lost = false;
 
683
}
 
684
 
 
685
/* Handle case where mt_state->count = 1 */
 
686
static void synaptics_image_sensor_1f(struct synaptics_data *priv,
 
687
                                      struct synaptics_mt_state *mt_state)
 
688
{
 
689
        struct synaptics_hw_state *agm = &priv->agm;
 
690
        struct synaptics_mt_state *old = &priv->mt_state;
 
691
 
 
692
        /*
 
693
         * If the last AGM was (0,0,0), and there is only one finger left,
 
694
         * then we absolutely know that SGM contains slot 0, and all other
 
695
         * fingers have been removed.
 
696
         */
 
697
        if (priv->agm_pending && agm->z == 0) {
 
698
                synaptics_mt_state_set(mt_state, 1, 0, -1);
 
699
                priv->mt_state_lost = false;
 
700
                return;
 
701
        }
 
702
 
 
703
        switch (old->count) {
 
704
        case 0:
 
705
                synaptics_mt_state_set(mt_state, 1, 0, -1);
 
706
                break;
 
707
        case 1:
 
708
                /*
 
709
                 * If mt_state_lost, then the previous transition was 3->1,
 
710
                 * and SGM now contains either slot 0 or 1, but we don't know
 
711
                 * which.  So, we just assume that the SGM now contains slot 1.
 
712
                 *
 
713
                 * If pending AGM and either:
 
714
                 *   (a) the previous SGM slot contains slot 0, or
 
715
                 *   (b) there was no SGM slot
 
716
                 * then, the SGM now contains slot 1
 
717
                 *
 
718
                 * Case (a) happens with very rapid "drum roll" gestures, where
 
719
                 * slot 0 finger is lifted and a new slot 1 finger touches
 
720
                 * within one reporting interval.
 
721
                 *
 
722
                 * Case (b) happens if initially two or more fingers tap
 
723
                 * briefly, and all but one lift before the end of the first
 
724
                 * reporting interval.
 
725
                 *
 
726
                 * (In both these cases, slot 0 will becomes empty, so SGM
 
727
                 * contains slot 1 with the new finger)
 
728
                 *
 
729
                 * Else, if there was no previous SGM, it now contains slot 0.
 
730
                 *
 
731
                 * Otherwise, SGM still contains the same slot.
 
732
                 */
 
733
                if (priv->mt_state_lost ||
 
734
                    (priv->agm_pending && old->sgm <= 0))
 
735
                        synaptics_mt_state_set(mt_state, 1, 1, -1);
 
736
                else if (old->sgm == -1)
 
737
                        synaptics_mt_state_set(mt_state, 1, 0, -1);
 
738
                break;
 
739
        case 2:
 
740
                /*
 
741
                 * If mt_state_lost, we don't know which finger SGM contains.
 
742
                 *
 
743
                 * So, report 1 finger, but with both slots empty.
 
744
                 * We will use slot 1 on subsequent 1->1
 
745
                 */
 
746
                if (priv->mt_state_lost) {
 
747
                        synaptics_mt_state_set(mt_state, 1, -1, -1);
 
748
                        break;
 
749
                }
 
750
                /*
 
751
                 * Since the last AGM was NOT (0,0,0), it was the finger in
 
752
                 * slot 0 that has been removed.
 
753
                 * So, SGM now contains previous AGM's slot, and AGM is now
 
754
                 * empty.
 
755
                 */
 
756
                synaptics_mt_state_set(mt_state, 1, old->agm, -1);
 
757
                break;
 
758
        case 3:
 
759
                /*
 
760
                 * Since last AGM was not (0,0,0), we don't know which finger
 
761
                 * is left.
 
762
                 *
 
763
                 * So, report 1 finger, but with both slots empty.
 
764
                 * We will use slot 1 on subsequent 1->1
 
765
                 */
 
766
                synaptics_mt_state_set(mt_state, 1, -1, -1);
 
767
                priv->mt_state_lost = true;
 
768
                break;
 
769
        case 4:
 
770
        case 5:
 
771
                /* mt_state was updated by AGM-CONTACT packet */
 
772
                break;
 
773
        }
 
774
}
 
775
 
 
776
/* Handle case where mt_state->count = 2 */
 
777
static void synaptics_image_sensor_2f(struct synaptics_data *priv,
 
778
                                      struct synaptics_mt_state *mt_state)
 
779
{
 
780
        struct synaptics_mt_state *old = &priv->mt_state;
 
781
 
 
782
        switch (old->count) {
 
783
        case 0:
 
784
                synaptics_mt_state_set(mt_state, 2, 0, 1);
 
785
                break;
 
786
        case 1:
 
787
                /*
 
788
                 * If previous SGM contained slot 1 or higher, SGM now contains
 
789
                 * slot 0 (the newly touching finger) and AGM contains SGM's
 
790
                 * previous slot.
 
791
                 *
 
792
                 * Otherwise, SGM still contains slot 0 and AGM now contains
 
793
                 * slot 1.
 
794
                 */
 
795
                if (old->sgm >= 1)
 
796
                        synaptics_mt_state_set(mt_state, 2, 0, old->sgm);
 
797
                else
 
798
                        synaptics_mt_state_set(mt_state, 2, 0, 1);
 
799
                break;
 
800
        case 2:
 
801
                /*
 
802
                 * If mt_state_lost, SGM now contains either finger 1 or 2, but
 
803
                 * we don't know which.
 
804
                 * So, we just assume that the SGM contains slot 0 and AGM 1.
 
805
                 */
 
806
                if (priv->mt_state_lost)
 
807
                        synaptics_mt_state_set(mt_state, 2, 0, 1);
 
808
                /*
 
809
                 * Otherwise, use the same mt_state, since it either hasn't
 
810
                 * changed, or was updated by a recently received AGM-CONTACT
 
811
                 * packet.
 
812
                 */
 
813
                break;
 
814
        case 3:
 
815
                /*
 
816
                 * 3->2 transitions have two unsolvable problems:
 
817
                 *  1) no indication is given which finger was removed
 
818
                 *  2) no way to tell if agm packet was for finger 3
 
819
                 *     before 3->2, or finger 2 after 3->2.
 
820
                 *
 
821
                 * So, report 2 fingers, but empty all slots.
 
822
                 * We will guess slots [0,1] on subsequent 2->2.
 
823
                 */
 
824
                synaptics_mt_state_set(mt_state, 2, -1, -1);
 
825
                priv->mt_state_lost = true;
 
826
                break;
 
827
        case 4:
 
828
        case 5:
 
829
                /* mt_state was updated by AGM-CONTACT packet */
 
830
                break;
 
831
        }
 
832
}
 
833
 
 
834
/* Handle case where mt_state->count = 3 */
 
835
static void synaptics_image_sensor_3f(struct synaptics_data *priv,
 
836
                                      struct synaptics_mt_state *mt_state)
 
837
{
 
838
        struct synaptics_mt_state *old = &priv->mt_state;
 
839
 
 
840
        switch (old->count) {
 
841
        case 0:
 
842
                synaptics_mt_state_set(mt_state, 3, 0, 2);
 
843
                break;
 
844
        case 1:
 
845
                /*
 
846
                 * If previous SGM contained slot 2 or higher, SGM now contains
 
847
                 * slot 0 (one of the newly touching fingers) and AGM contains
 
848
                 * SGM's previous slot.
 
849
                 *
 
850
                 * Otherwise, SGM now contains slot 0 and AGM contains slot 2.
 
851
                 */
 
852
                if (old->sgm >= 2)
 
853
                        synaptics_mt_state_set(mt_state, 3, 0, old->sgm);
 
854
                else
 
855
                        synaptics_mt_state_set(mt_state, 3, 0, 2);
 
856
                break;
 
857
        case 2:
 
858
                /*
 
859
                 * If the AGM previously contained slot 3 or higher, then the
 
860
                 * newly touching finger is in the lowest available slot.
 
861
                 *
 
862
                 * If SGM was previously 1 or higher, then the new SGM is
 
863
                 * now slot 0 (with a new finger), otherwise, the new finger
 
864
                 * is now in a hidden slot between 0 and AGM's slot.
 
865
                 *
 
866
                 * In all such cases, the SGM now contains slot 0, and the AGM
 
867
                 * continues to contain the same slot as before.
 
868
                 */
 
869
                if (old->agm >= 3) {
 
870
                        synaptics_mt_state_set(mt_state, 3, 0, old->agm);
 
871
                        break;
 
872
                }
 
873
 
 
874
                /*
 
875
                 * After some 3->1 and all 3->2 transitions, we lose track
 
876
                 * of which slot is reported by SGM and AGM.
 
877
                 *
 
878
                 * For 2->3 in this state, report 3 fingers, but empty all
 
879
                 * slots, and we will guess (0,2) on a subsequent 0->3.
 
880
                 *
 
881
                 * To userspace, the resulting transition will look like:
 
882
                 *    2:[0,1] -> 3:[-1,-1] -> 3:[0,2]
 
883
                 */
 
884
                if (priv->mt_state_lost) {
 
885
                        synaptics_mt_state_set(mt_state, 3, -1, -1);
 
886
                        break;
 
887
                }
 
888
 
 
889
                /*
 
890
                 * If the (SGM,AGM) really previously contained slots (0, 1),
 
891
                 * then we cannot know what slot was just reported by the AGM,
 
892
                 * because the 2->3 transition can occur either before or after
 
893
                 * the AGM packet. Thus, this most recent AGM could contain
 
894
                 * either the same old slot 1 or the new slot 2.
 
895
                 * Subsequent AGMs will be reporting slot 2.
 
896
                 *
 
897
                 * To userspace, the resulting transition will look like:
 
898
                 *    2:[0,1] -> 3:[0,-1] -> 3:[0,2]
 
899
                 */
 
900
                synaptics_mt_state_set(mt_state, 3, 0, -1);
 
901
                break;
 
902
        case 3:
 
903
                /*
 
904
                 * If, for whatever reason, the previous agm was invalid,
 
905
                 * Assume SGM now contains slot 0, AGM now contains slot 2.
 
906
                 */
 
907
                if (old->agm <= 2)
 
908
                        synaptics_mt_state_set(mt_state, 3, 0, 2);
 
909
                /*
 
910
                 * mt_state either hasn't changed, or was updated by a recently
 
911
                 * received AGM-CONTACT packet.
 
912
                 */
 
913
                break;
 
914
 
 
915
        case 4:
 
916
        case 5:
 
917
                /* mt_state was updated by AGM-CONTACT packet */
 
918
                break;
 
919
        }
 
920
}
 
921
 
 
922
/* Handle case where mt_state->count = 4, or = 5 */
 
923
static void synaptics_image_sensor_45f(struct synaptics_data *priv,
 
924
                                       struct synaptics_mt_state *mt_state)
 
925
{
 
926
        /* mt_state was updated correctly by AGM-CONTACT packet */
 
927
        priv->mt_state_lost = false;
 
928
}
 
929
 
 
930
static void synaptics_image_sensor_process(struct psmouse *psmouse,
 
931
                                           struct synaptics_hw_state *sgm)
 
932
{
 
933
        struct synaptics_data *priv = psmouse->private;
 
934
        struct synaptics_hw_state *agm = &priv->agm;
 
935
        struct synaptics_mt_state mt_state;
 
936
 
 
937
        /* Initialize using current mt_state (as updated by last agm) */
 
938
        mt_state = agm->mt_state;
 
939
 
 
940
        /*
 
941
         * Update mt_state using the new finger count and current mt_state.
 
942
         */
 
943
        if (sgm->z == 0)
 
944
                synaptics_image_sensor_0f(priv, &mt_state);
 
945
        else if (sgm->w >= 4)
 
946
                synaptics_image_sensor_1f(priv, &mt_state);
 
947
        else if (sgm->w == 0)
 
948
                synaptics_image_sensor_2f(priv, &mt_state);
 
949
        else if (sgm->w == 1 && mt_state.count <= 3)
 
950
                synaptics_image_sensor_3f(priv, &mt_state);
 
951
        else
 
952
                synaptics_image_sensor_45f(priv, &mt_state);
 
953
 
 
954
        /* Send resulting input events to user space */
 
955
        synaptics_report_mt_data(psmouse, &mt_state, sgm);
 
956
 
 
957
        /* Store updated mt_state */
 
958
        priv->mt_state = agm->mt_state = mt_state;
 
959
        priv->agm_pending = false;
515
960
}
516
961
 
517
962
/*
524
969
        struct synaptics_hw_state hw;
525
970
        int num_fingers;
526
971
        int finger_width;
527
 
        int i;
528
972
 
529
973
        if (synaptics_parse_hw_state(psmouse->packet, priv, &hw))
530
974
                return;
531
975
 
 
976
        if (SYN_CAP_IMAGE_SENSOR(priv->ext_cap_0c)) {
 
977
                synaptics_image_sensor_process(psmouse, &hw);
 
978
                return;
 
979
        }
 
980
 
532
981
        if (hw.scroll) {
533
982
                priv->scroll += hw.scroll;
534
983
 
574
1023
        }
575
1024
 
576
1025
        if (SYN_CAP_ADV_GESTURE(priv->ext_cap_0c))
577
 
                synaptics_report_semi_mt_data(dev, &hw, &priv->mt, num_fingers);
 
1026
                synaptics_report_semi_mt_data(dev, &hw, &priv->agm,
 
1027
                                              num_fingers);
578
1028
 
579
1029
        /* Post events
580
1030
         * BTN_TOUCH has to be first as mousedev relies on it when doing
585
1035
 
586
1036
        if (num_fingers > 0) {
587
1037
                input_report_abs(dev, ABS_X, hw.x);
588
 
                input_report_abs(dev, ABS_Y, YMAX_NOMINAL + YMIN_NOMINAL - hw.y);
 
1038
                input_report_abs(dev, ABS_Y, synaptics_invert_y(hw.y));
589
1039
        }
590
1040
        input_report_abs(dev, ABS_PRESSURE, hw.z);
591
1041
 
593
1043
                input_report_abs(dev, ABS_TOOL_WIDTH, finger_width);
594
1044
 
595
1045
        input_report_key(dev, BTN_TOOL_FINGER, num_fingers == 1);
596
 
        input_report_key(dev, BTN_LEFT, hw.left);
597
 
        input_report_key(dev, BTN_RIGHT, hw.right);
598
 
 
599
1046
        if (SYN_CAP_MULTIFINGER(priv->capabilities)) {
600
1047
                input_report_key(dev, BTN_TOOL_DOUBLETAP, num_fingers == 2);
601
1048
                input_report_key(dev, BTN_TOOL_TRIPLETAP, num_fingers == 3);
602
1049
        }
603
1050
 
604
 
        if (SYN_CAP_MIDDLE_BUTTON(priv->capabilities))
605
 
                input_report_key(dev, BTN_MIDDLE, hw.middle);
606
 
 
607
 
        if (SYN_CAP_FOUR_BUTTON(priv->capabilities)) {
608
 
                input_report_key(dev, BTN_FORWARD, hw.up);
609
 
                input_report_key(dev, BTN_BACK, hw.down);
610
 
        }
611
 
 
612
 
        for (i = 0; i < SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap); i++)
613
 
                input_report_key(dev, BTN_0 + i, hw.ext_buttons & (1 << i));
 
1051
        synaptics_report_buttons(psmouse, &hw);
614
1052
 
615
1053
        input_sync(dev);
616
1054
}
617
1055
 
618
 
static int synaptics_validate_byte(unsigned char packet[], int idx, unsigned char pkt_type)
 
1056
static int synaptics_validate_byte(struct psmouse *psmouse,
 
1057
                                   int idx, unsigned char pkt_type)
619
1058
{
620
1059
        static const unsigned char newabs_mask[]        = { 0xC8, 0x00, 0x00, 0xC8, 0x00 };
621
1060
        static const unsigned char newabs_rel_mask[]    = { 0xC0, 0x00, 0x00, 0xC0, 0x00 };
622
1061
        static const unsigned char newabs_rslt[]        = { 0x80, 0x00, 0x00, 0xC0, 0x00 };
623
1062
        static const unsigned char oldabs_mask[]        = { 0xC0, 0x60, 0x00, 0xC0, 0x60 };
624
1063
        static const unsigned char oldabs_rslt[]        = { 0xC0, 0x00, 0x00, 0x80, 0x00 };
 
1064
        const char *packet = psmouse->packet;
625
1065
 
626
1066
        if (idx < 0 || idx > 4)
627
1067
                return 0;
639
1079
                return (packet[idx] & oldabs_mask[idx]) == oldabs_rslt[idx];
640
1080
 
641
1081
        default:
642
 
                printk(KERN_ERR "synaptics: unknown packet type %d\n", pkt_type);
 
1082
                psmouse_err(psmouse, "unknown packet type %d\n", pkt_type);
643
1083
                return 0;
644
1084
        }
645
1085
}
649
1089
        int i;
650
1090
 
651
1091
        for (i = 0; i < 5; i++)
652
 
                if (!synaptics_validate_byte(psmouse->packet, i, SYN_NEWABS_STRICT)) {
653
 
                        printk(KERN_INFO "synaptics: using relaxed packet validation\n");
 
1092
                if (!synaptics_validate_byte(psmouse, i, SYN_NEWABS_STRICT)) {
 
1093
                        psmouse_info(psmouse, "using relaxed packet validation\n");
654
1094
                        return SYN_NEWABS_RELAXED;
655
1095
                }
656
1096
 
675
1115
                return PSMOUSE_FULL_PACKET;
676
1116
        }
677
1117
 
678
 
        return synaptics_validate_byte(psmouse->packet, psmouse->pktcnt - 1, priv->pkt_type) ?
 
1118
        return synaptics_validate_byte(psmouse, psmouse->pktcnt - 1, priv->pkt_type) ?
679
1119
                PSMOUSE_GOOD_DATA : PSMOUSE_BAD_DATA;
680
1120
}
681
1121
 
682
1122
/*****************************************************************************
683
1123
 *      Driver initialization/cleanup functions
684
1124
 ****************************************************************************/
 
1125
static void set_abs_position_params(struct input_dev *dev,
 
1126
                                    struct synaptics_data *priv, int x_code,
 
1127
                                    int y_code)
 
1128
{
 
1129
        int x_min = priv->x_min ?: XMIN_NOMINAL;
 
1130
        int x_max = priv->x_max ?: XMAX_NOMINAL;
 
1131
        int y_min = priv->y_min ?: YMIN_NOMINAL;
 
1132
        int y_max = priv->y_max ?: YMAX_NOMINAL;
 
1133
        int fuzz = SYN_CAP_REDUCED_FILTERING(priv->ext_cap_0c) ?
 
1134
                        SYN_REDUCED_FILTER_FUZZ : 0;
 
1135
 
 
1136
        input_set_abs_params(dev, x_code, x_min, x_max, fuzz, 0);
 
1137
        input_set_abs_params(dev, y_code, y_min, y_max, fuzz, 0);
 
1138
        input_abs_set_res(dev, x_code, priv->x_res);
 
1139
        input_abs_set_res(dev, y_code, priv->y_res);
 
1140
}
 
1141
 
685
1142
static void set_input_params(struct input_dev *dev, struct synaptics_data *priv)
686
1143
{
687
1144
        int i;
689
1146
        __set_bit(INPUT_PROP_POINTER, dev->propbit);
690
1147
 
691
1148
        __set_bit(EV_ABS, dev->evbit);
692
 
        input_set_abs_params(dev, ABS_X,
693
 
                             XMIN_NOMINAL, priv->x_max ?: XMAX_NOMINAL, 0, 0);
694
 
        input_set_abs_params(dev, ABS_Y,
695
 
                             YMIN_NOMINAL, priv->y_max ?: YMAX_NOMINAL, 0, 0);
 
1149
        set_abs_position_params(dev, priv, ABS_X, ABS_Y);
696
1150
        input_set_abs_params(dev, ABS_PRESSURE, 0, 255, 0, 0);
697
1151
 
698
 
        if (SYN_CAP_ADV_GESTURE(priv->ext_cap_0c)) {
 
1152
        if (SYN_CAP_IMAGE_SENSOR(priv->ext_cap_0c)) {
 
1153
                input_mt_init_slots(dev, 2);
 
1154
                set_abs_position_params(dev, priv, ABS_MT_POSITION_X,
 
1155
                                        ABS_MT_POSITION_Y);
 
1156
                /* Image sensors can report per-contact pressure */
 
1157
                input_set_abs_params(dev, ABS_MT_PRESSURE, 0, 255, 0, 0);
 
1158
 
 
1159
                /* Image sensors can signal 4 and 5 finger clicks */
 
1160
                __set_bit(BTN_TOOL_QUADTAP, dev->keybit);
 
1161
                __set_bit(BTN_TOOL_QUINTTAP, dev->keybit);
 
1162
        } else if (SYN_CAP_ADV_GESTURE(priv->ext_cap_0c)) {
 
1163
                /* Non-image sensors with AGM use semi-mt */
699
1164
                __set_bit(INPUT_PROP_SEMI_MT, dev->propbit);
700
1165
                input_mt_init_slots(dev, 2);
701
 
                input_set_abs_params(dev, ABS_MT_POSITION_X, XMIN_NOMINAL,
702
 
                                     priv->x_max ?: XMAX_NOMINAL, 0, 0);
703
 
                input_set_abs_params(dev, ABS_MT_POSITION_Y, YMIN_NOMINAL,
704
 
                                     priv->y_max ?: YMAX_NOMINAL, 0, 0);
 
1166
                set_abs_position_params(dev, priv, ABS_MT_POSITION_X,
 
1167
                                        ABS_MT_POSITION_Y);
705
1168
        }
706
1169
 
707
1170
        if (SYN_CAP_PALMDETECT(priv->capabilities))
734
1197
        __clear_bit(REL_X, dev->relbit);
735
1198
        __clear_bit(REL_Y, dev->relbit);
736
1199
 
737
 
        input_abs_set_res(dev, ABS_X, priv->x_res);
738
 
        input_abs_set_res(dev, ABS_Y, priv->y_res);
739
 
 
740
1200
        if (SYN_CAP_CLICKPAD(priv->ext_cap_0c)) {
741
1201
                __set_bit(INPUT_PROP_BUTTONPAD, dev->propbit);
742
1202
                /* Clickpads report only left button */
743
1203
                __clear_bit(BTN_RIGHT, dev->keybit);
744
1204
                __clear_bit(BTN_MIDDLE, dev->keybit);
745
 
        }
 
1205
        } else if (SYN_CAP_CLICKPAD2BTN(priv->ext_cap_0c) ||
 
1206
                   SYN_CAP_CLICKPAD2BTN2(priv->ext_cap_0c))
 
1207
                __set_bit(INPUT_PROP_BUTTONPAD, dev->propbit);
746
1208
}
747
1209
 
748
1210
static void synaptics_disconnect(struct psmouse *psmouse)
778
1240
                return -1;
779
1241
 
780
1242
        if (retry > 1)
781
 
                printk(KERN_DEBUG "Synaptics reconnected after %d tries\n",
782
 
                        retry);
 
1243
                psmouse_dbg(psmouse, "reconnected after %d tries\n", retry);
783
1244
 
784
1245
        if (synaptics_query_hardware(psmouse)) {
785
 
                printk(KERN_ERR "Unable to query Synaptics hardware.\n");
 
1246
                psmouse_err(psmouse, "Unable to query device.\n");
786
1247
                return -1;
787
1248
        }
788
1249
 
789
1250
        if (synaptics_set_absolute_mode(psmouse)) {
790
 
                printk(KERN_ERR "Unable to initialize Synaptics hardware.\n");
 
1251
                psmouse_err(psmouse, "Unable to initialize device.\n");
791
1252
                return -1;
792
1253
        }
793
1254
 
794
1255
        if (synaptics_set_advanced_gesture_mode(psmouse)) {
795
 
                printk(KERN_ERR "Advanced gesture mode reconnect failed.\n");
 
1256
                psmouse_err(psmouse,
 
1257
                            "Advanced gesture mode reconnect failed.\n");
796
1258
                return -1;
797
1259
        }
798
1260
 
800
1262
            old_priv.model_id != priv->model_id ||
801
1263
            old_priv.capabilities != priv->capabilities ||
802
1264
            old_priv.ext_cap != priv->ext_cap) {
803
 
                printk(KERN_ERR "Synaptics hardware appears to be different: "
804
 
                        "id(%ld-%ld), model(%ld-%ld), caps(%lx-%lx), ext(%lx-%lx).\n",
805
 
                        old_priv.identity, priv->identity,
806
 
                        old_priv.model_id, priv->model_id,
807
 
                        old_priv.capabilities, priv->capabilities,
808
 
                        old_priv.ext_cap, priv->ext_cap);
 
1265
                psmouse_err(psmouse,
 
1266
                            "hardware appears to be different: id(%ld-%ld), model(%ld-%ld), caps(%lx-%lx), ext(%lx-%lx).\n",
 
1267
                            old_priv.identity, priv->identity,
 
1268
                            old_priv.model_id, priv->model_id,
 
1269
                            old_priv.capabilities, priv->capabilities,
 
1270
                            old_priv.ext_cap, priv->ext_cap);
809
1271
                return -1;
810
1272
        }
811
1273
 
886
1348
         * just fine.
887
1349
         */
888
1350
        if (broken_olpc_ec) {
889
 
                printk(KERN_INFO "synaptics: OLPC XO detected, not enabling Synaptics protocol.\n");
 
1351
                psmouse_info(psmouse,
 
1352
                             "OLPC XO detected, not enabling Synaptics protocol.\n");
890
1353
                return -ENODEV;
891
1354
        }
892
1355
 
897
1360
        psmouse_reset(psmouse);
898
1361
 
899
1362
        if (synaptics_query_hardware(psmouse)) {
900
 
                printk(KERN_ERR "Unable to query Synaptics hardware.\n");
 
1363
                psmouse_err(psmouse, "Unable to query device.\n");
901
1364
                goto init_fail;
902
1365
        }
903
1366
 
904
1367
        if (synaptics_set_absolute_mode(psmouse)) {
905
 
                printk(KERN_ERR "Unable to initialize Synaptics hardware.\n");
 
1368
                psmouse_err(psmouse, "Unable to initialize device.\n");
906
1369
                goto init_fail;
907
1370
        }
908
1371
 
909
1372
        if (synaptics_set_advanced_gesture_mode(psmouse)) {
910
 
                printk(KERN_ERR "Advanced gesture mode init failed.\n");
 
1373
                psmouse_err(psmouse, "Advanced gesture mode init failed.\n");
911
1374
                goto init_fail;
912
1375
        }
913
1376
 
914
1377
        priv->pkt_type = SYN_MODEL_NEWABS(priv->model_id) ? SYN_NEWABS : SYN_OLDABS;
915
1378
 
916
 
        printk(KERN_INFO "Synaptics Touchpad, model: %ld, fw: %ld.%ld, id: %#lx, caps: %#lx/%#lx/%#lx\n",
917
 
                SYN_ID_MODEL(priv->identity),
918
 
                SYN_ID_MAJOR(priv->identity), SYN_ID_MINOR(priv->identity),
919
 
                priv->model_id, priv->capabilities, priv->ext_cap, priv->ext_cap_0c);
 
1379
        psmouse_info(psmouse,
 
1380
                     "Touchpad model: %ld, fw: %ld.%ld, id: %#lx, caps: %#lx/%#lx/%#lx\n",
 
1381
                     SYN_ID_MODEL(priv->identity),
 
1382
                     SYN_ID_MAJOR(priv->identity), SYN_ID_MINOR(priv->identity),
 
1383
                     priv->model_id,
 
1384
                     priv->capabilities, priv->ext_cap, priv->ext_cap_0c);
920
1385
 
921
1386
        set_input_params(psmouse->dev, priv);
922
1387
 
948
1413
         * the same rate as a standard PS/2 mouse).
949
1414
         */
950
1415
        if (psmouse->rate >= 80 && impaired_toshiba_kbc) {
951
 
                printk(KERN_INFO "synaptics: Toshiba %s detected, limiting rate to 40pps.\n",
952
 
                        dmi_get_system_info(DMI_PRODUCT_NAME));
 
1416
                psmouse_info(psmouse,
 
1417
                             "Toshiba %s detected, limiting rate to 40pps.\n",
 
1418
                             dmi_get_system_info(DMI_PRODUCT_NAME));
953
1419
                psmouse->rate = 40;
954
1420
        }
955
1421
 
982
1448
}
983
1449
 
984
1450
#endif /* CONFIG_MOUSE_PS2_SYNAPTICS */
985