Commit 5fbcee12 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds

[PATCH] M68k update (part 4)

Port Apollo mouse driver to the `new' busmouse API
parent 30009777
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/kd.h> #include <linux/kd.h>
#include <linux/kbd_ll.h>
#include <linux/random.h> #include <linux/random.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -19,8 +20,6 @@ ...@@ -19,8 +20,6 @@
#include "busmouse.h" #include "busmouse.h"
/* extern void handle_scancode(unsigned char,int ); */
#define DNKEY_CAPS 0x7e #define DNKEY_CAPS 0x7e
#define BREAK_FLAG 0x80 #define BREAK_FLAG 0x80
#define DNKEY_REPEAT_DELAY 50 #define DNKEY_REPEAT_DELAY 50
...@@ -336,7 +335,8 @@ static void dn_keyb_process_mouse_event(unsigned char mouse_data) { ...@@ -336,7 +335,8 @@ static void dn_keyb_process_mouse_event(unsigned char mouse_data) {
static short mouse_byte_count=0; static short mouse_byte_count=0;
static u_char mouse_packet[3]; static u_char mouse_packet[3];
short mouse_buttons; short buttons;
int dx, dy;
mouse_packet[mouse_byte_count++]=mouse_data; mouse_packet[mouse_byte_count++]=mouse_data;
...@@ -347,24 +347,12 @@ static void dn_keyb_process_mouse_event(unsigned char mouse_data) { ...@@ -347,24 +347,12 @@ static void dn_keyb_process_mouse_event(unsigned char mouse_data) {
/* printk("modechange: %d\n",mouse_packet[1]); */ /* printk("modechange: %d\n",mouse_packet[1]); */
if(kbd_mode==APOLLO_KBD_MODE_KEYB) if(kbd_mode==APOLLO_KBD_MODE_KEYB)
dn_keyb_process_key_event(mouse_packet[2]); dn_keyb_process_key_event(mouse_packet[2]);
} }
if((mouse_packet[0] & 0x8f) == 0x80) { if((mouse_packet[0] & 0x8f) == 0x80) {
if(mouse_update_allowed) { buttons = (mouse_packet[0] >> 4) & 0x7;
mouse_ready=1; dx = mouse_packet[1] == 0xff ? 0 : (signed char)mouse_packet[1];
mouse_buttons=(mouse_packet[0] >> 4) & 0x7; dy = mouse_packet[2] == 0xff ? 0 : (signed char)mouse_packet[2];
mouse_dx+=mouse_packet[1] == 0xff ? 0 : (signed char)mouse_packet[1]; busmouse_add_movementbuttons(msedev, dx, dy, buttons);
mouse_dy+=mouse_packet[2] == 0xff ? 0 : (signed char)mouse_packet[2];
wake_up_interruptible(&mouse_wait);
if (mouse_dx < -2048)
mouse_dx = -2048;
else if (mouse_dx > 2048)
mouse_dx = 2048;
if (mouse_dy < -2048)
mouse_dy = -2048;
else if (mouse_dy > 2048)
mouse_dy = 2048;
kill_fasync(&mouse_fasyncptr, SIGIO, POLL_IN);
}
mouse_byte_count=0; mouse_byte_count=0;
/* printk("mouse: %d, %d, %x\n",mouse_x,mouse_y,buttons); */ /* printk("mouse: %d, %d, %x\n",mouse_x,mouse_y,buttons); */
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment