aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/alps.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/mouse/alps.c')
-rw-r--r--drivers/input/mouse/alps.c51
1 files changed, 21 insertions, 30 deletions
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
index f93c2c0daf1f..0d22cb9ce42e 100644
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -15,6 +15,7 @@
15 * the Free Software Foundation. 15 * the Free Software Foundation.
16 */ 16 */
17 17
18#include <linux/slab.h>
18#include <linux/input.h> 19#include <linux/input.h>
19#include <linux/serio.h> 20#include <linux/serio.h>
20#include <linux/libps2.h> 21#include <linux/libps2.h>
@@ -63,6 +64,9 @@ static const struct alps_model_info alps_model_data[] = {
63 { { 0x62, 0x02, 0x14 }, 0xcf, 0xcf, 64 { { 0x62, 0x02, 0x14 }, 0xcf, 0xcf,
64 ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED }, 65 ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED },
65 { { 0x73, 0x02, 0x50 }, 0xcf, 0xcf, ALPS_FOUR_BUTTONS }, /* Dell Vostro 1400 */ 66 { { 0x73, 0x02, 0x50 }, 0xcf, 0xcf, ALPS_FOUR_BUTTONS }, /* Dell Vostro 1400 */
67 { { 0x73, 0x02, 0x64 }, 0xf8, 0xf8, 0 }, /* HP Pavilion dm3 */
68 { { 0x52, 0x01, 0x14 }, 0xff, 0xff,
69 ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED }, /* Toshiba Tecra A11-11L */
66}; 70};
67 71
68/* 72/*
@@ -118,40 +122,27 @@ static void alps_report_buttons(struct psmouse *psmouse,
118 struct input_dev *dev1, struct input_dev *dev2, 122 struct input_dev *dev1, struct input_dev *dev2,
119 int left, int right, int middle) 123 int left, int right, int middle)
120{ 124{
121 struct alps_data *priv = psmouse->private; 125 struct input_dev *dev;
122 const struct alps_model_info *model = priv->i;
123
124 if (model->flags & ALPS_PS2_INTERLEAVED) {
125 struct input_dev *dev;
126 126
127 /* 127 /*
128 * If shared button has already been reported on the 128 * If shared button has already been reported on the
129 * other device (dev2) then this event should be also 129 * other device (dev2) then this event should be also
130 * sent through that device. 130 * sent through that device.
131 */ 131 */
132 dev = test_bit(BTN_LEFT, dev2->key) ? dev2 : dev1; 132 dev = test_bit(BTN_LEFT, dev2->key) ? dev2 : dev1;
133 input_report_key(dev, BTN_LEFT, left); 133 input_report_key(dev, BTN_LEFT, left);
134 134
135 dev = test_bit(BTN_RIGHT, dev2->key) ? dev2 : dev1; 135 dev = test_bit(BTN_RIGHT, dev2->key) ? dev2 : dev1;
136 input_report_key(dev, BTN_RIGHT, right); 136 input_report_key(dev, BTN_RIGHT, right);
137 137
138 dev = test_bit(BTN_MIDDLE, dev2->key) ? dev2 : dev1; 138 dev = test_bit(BTN_MIDDLE, dev2->key) ? dev2 : dev1;
139 input_report_key(dev, BTN_MIDDLE, middle); 139 input_report_key(dev, BTN_MIDDLE, middle);
140 140
141 /* 141 /*
142 * Sync the _other_ device now, we'll do the first 142 * Sync the _other_ device now, we'll do the first
143 * device later once we report the rest of the events. 143 * device later once we report the rest of the events.
144 */ 144 */
145 input_sync(dev2); 145 input_sync(dev2);
146 } else {
147 /*
148 * For devices with non-interleaved packets we know what
149 * device buttons belong to so we can simply report them.
150 */
151 input_report_key(dev1, BTN_LEFT, left);
152 input_report_key(dev1, BTN_RIGHT, right);
153 input_report_key(dev1, BTN_MIDDLE, middle);
154 }
155} 146}
156 147
157static void alps_process_packet(struct psmouse *psmouse) 148static void alps_process_packet(struct psmouse *psmouse)