diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2010-05-19 13:39:17 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2010-05-19 14:31:51 -0400 |
commit | a62f0d27b4196bad5e900d766b285feb7069cd16 (patch) | |
tree | 88719f9718968d32aa3df3a9289c04c32a549578 /drivers/input/mouse/psmouse-base.c | |
parent | 83ba9ea8a04b72dfee2515428c15e7414ba4fc61 (diff) |
Input: psmouse - small formatting changes to better follow coding style
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/mouse/psmouse-base.c')
-rw-r--r-- | drivers/input/mouse/psmouse-base.c | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index a3c97315a473..979c50215282 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c | |||
@@ -147,18 +147,18 @@ static psmouse_ret_t psmouse_process_byte(struct psmouse *psmouse) | |||
147 | 147 | ||
148 | if (psmouse->type == PSMOUSE_IMEX) { | 148 | if (psmouse->type == PSMOUSE_IMEX) { |
149 | switch (packet[3] & 0xC0) { | 149 | switch (packet[3] & 0xC0) { |
150 | case 0x80: /* vertical scroll on IntelliMouse Explorer 4.0 */ | 150 | case 0x80: /* vertical scroll on IntelliMouse Explorer 4.0 */ |
151 | input_report_rel(dev, REL_WHEEL, (int) (packet[3] & 32) - (int) (packet[3] & 31)); | 151 | input_report_rel(dev, REL_WHEEL, (int) (packet[3] & 32) - (int) (packet[3] & 31)); |
152 | break; | 152 | break; |
153 | case 0x40: /* horizontal scroll on IntelliMouse Explorer 4.0 */ | 153 | case 0x40: /* horizontal scroll on IntelliMouse Explorer 4.0 */ |
154 | input_report_rel(dev, REL_HWHEEL, (int) (packet[3] & 32) - (int) (packet[3] & 31)); | 154 | input_report_rel(dev, REL_HWHEEL, (int) (packet[3] & 32) - (int) (packet[3] & 31)); |
155 | break; | 155 | break; |
156 | case 0x00: | 156 | case 0x00: |
157 | case 0xC0: | 157 | case 0xC0: |
158 | input_report_rel(dev, REL_WHEEL, (int) (packet[3] & 8) - (int) (packet[3] & 7)); | 158 | input_report_rel(dev, REL_WHEEL, (int) (packet[3] & 8) - (int) (packet[3] & 7)); |
159 | input_report_key(dev, BTN_SIDE, (packet[3] >> 4) & 1); | 159 | input_report_key(dev, BTN_SIDE, (packet[3] >> 4) & 1); |
160 | input_report_key(dev, BTN_EXTRA, (packet[3] >> 5) & 1); | 160 | input_report_key(dev, BTN_EXTRA, (packet[3] >> 5) & 1); |
161 | break; | 161 | break; |
162 | } | 162 | } |
163 | } | 163 | } |
164 | 164 | ||
@@ -247,31 +247,31 @@ static int psmouse_handle_byte(struct psmouse *psmouse) | |||
247 | psmouse_ret_t rc = psmouse->protocol_handler(psmouse); | 247 | psmouse_ret_t rc = psmouse->protocol_handler(psmouse); |
248 | 248 | ||
249 | switch (rc) { | 249 | switch (rc) { |
250 | case PSMOUSE_BAD_DATA: | 250 | case PSMOUSE_BAD_DATA: |
251 | if (psmouse->state == PSMOUSE_ACTIVATED) { | 251 | if (psmouse->state == PSMOUSE_ACTIVATED) { |
252 | printk(KERN_WARNING "psmouse.c: %s at %s lost sync at byte %d\n", | 252 | printk(KERN_WARNING "psmouse.c: %s at %s lost sync at byte %d\n", |
253 | psmouse->name, psmouse->phys, psmouse->pktcnt); | 253 | psmouse->name, psmouse->phys, psmouse->pktcnt); |
254 | if (++psmouse->out_of_sync_cnt == psmouse->resetafter) { | 254 | if (++psmouse->out_of_sync_cnt == psmouse->resetafter) { |
255 | __psmouse_set_state(psmouse, PSMOUSE_IGNORE); | 255 | __psmouse_set_state(psmouse, PSMOUSE_IGNORE); |
256 | printk(KERN_NOTICE "psmouse.c: issuing reconnect request\n"); | 256 | printk(KERN_NOTICE "psmouse.c: issuing reconnect request\n"); |
257 | serio_reconnect(psmouse->ps2dev.serio); | 257 | serio_reconnect(psmouse->ps2dev.serio); |
258 | return -1; | 258 | return -1; |
259 | } | ||
260 | } | ||
261 | psmouse->pktcnt = 0; | ||
262 | break; | ||
263 | |||
264 | case PSMOUSE_FULL_PACKET: | ||
265 | psmouse->pktcnt = 0; | ||
266 | if (psmouse->out_of_sync_cnt) { | ||
267 | psmouse->out_of_sync_cnt = 0; | ||
268 | printk(KERN_NOTICE "psmouse.c: %s at %s - driver resynched.\n", | ||
269 | psmouse->name, psmouse->phys); | ||
270 | } | 259 | } |
271 | break; | 260 | } |
261 | psmouse->pktcnt = 0; | ||
262 | break; | ||
263 | |||
264 | case PSMOUSE_FULL_PACKET: | ||
265 | psmouse->pktcnt = 0; | ||
266 | if (psmouse->out_of_sync_cnt) { | ||
267 | psmouse->out_of_sync_cnt = 0; | ||
268 | printk(KERN_NOTICE "psmouse.c: %s at %s - driver resynched.\n", | ||
269 | psmouse->name, psmouse->phys); | ||
270 | } | ||
271 | break; | ||
272 | 272 | ||
273 | case PSMOUSE_GOOD_DATA: | 273 | case PSMOUSE_GOOD_DATA: |
274 | break; | 274 | break; |
275 | } | 275 | } |
276 | return 0; | 276 | return 0; |
277 | } | 277 | } |
@@ -1245,7 +1245,7 @@ static int psmouse_switch_protocol(struct psmouse *psmouse, | |||
1245 | psmouse->pktsize = 3; | 1245 | psmouse->pktsize = 3; |
1246 | 1246 | ||
1247 | if (proto && (proto->detect || proto->init)) { | 1247 | if (proto && (proto->detect || proto->init)) { |
1248 | if (proto->detect && proto->detect(psmouse, 1) < 0) | 1248 | if (proto->detect && proto->detect(psmouse, true) < 0) |
1249 | return -1; | 1249 | return -1; |
1250 | 1250 | ||
1251 | if (proto->init && proto->init(psmouse) < 0) | 1251 | if (proto->init && proto->init(psmouse) < 0) |