 25-akpm/drivers/input/mouse/Makefile    |    2 +
 25-akpm/drivers/input/mouse/psmouse.c   |   50 ++------------------------------
 25-akpm/drivers/input/mouse/psmouse.h   |   47 ++++++++++++++++++++++++++++++
 25-akpm/drivers/input/mouse/synaptics.c |   26 +++++++---------
 25-akpm/drivers/input/mouse/synaptics.h |   14 ++++++++
 drivers/input/mouse/Kconfig             |    0 
 6 files changed, 78 insertions(+), 61 deletions(-)

diff -puN drivers/input/mouse/psmouse.c~synaptics-cleanup drivers/input/mouse/psmouse.c
--- 25/drivers/input/mouse/psmouse.c~synaptics-cleanup	Wed Jun 11 13:20:01 2003
+++ 25-akpm/drivers/input/mouse/psmouse.c	Wed Jun 11 13:28:26 2003
@@ -18,6 +18,9 @@
 #include <linux/serio.h>
 #include <linux/init.h>
 
+#include "psmouse.h"
+#include "synaptics.h"
+
 MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>");
 MODULE_DESCRIPTION("PS/2 mouse driver");
 MODULE_PARM(psmouse_noext, "1i");
@@ -25,51 +28,6 @@ MODULE_LICENSE("GPL");
 
 static int psmouse_noext;
 
-#define PSMOUSE_CMD_SETSCALE11	0x00e6
-#define PSMOUSE_CMD_SETRES	0x10e8
-#define PSMOUSE_CMD_GETINFO	0x03e9
-#define PSMOUSE_CMD_SETSTREAM	0x00ea
-#define PSMOUSE_CMD_POLL	0x03eb	
-#define PSMOUSE_CMD_GETID	0x02f2
-#define PSMOUSE_CMD_SETRATE	0x10f3
-#define PSMOUSE_CMD_ENABLE	0x00f4
-#define PSMOUSE_CMD_RESET_DIS	0x00f6
-#define PSMOUSE_CMD_RESET_BAT	0x02ff
-
-#define PSMOUSE_RET_BAT		0xaa
-#define PSMOUSE_RET_ACK		0xfa
-#define PSMOUSE_RET_NAK		0xfe
-
-struct psmouse {
-	void *private;
-	struct input_dev dev;
-	struct serio *serio;
-	char *vendor;
-	char *name;
-	unsigned char cmdbuf[8];
-	unsigned char packet[8];
-	unsigned char cmdcnt;
-	unsigned char pktcnt;
-	unsigned char type;
-	unsigned char model;
-	unsigned long last;
-	char acking;
-	volatile char ack;
-	char error;
-	char devname[64];
-	char phys[32];
-};
-
-#define PSMOUSE_PS2	1
-#define PSMOUSE_PS2PP	2
-#define PSMOUSE_PS2TPP	3
-#define PSMOUSE_GENPS	4
-#define PSMOUSE_IMPS	5
-#define PSMOUSE_IMEX	6
-#define PSMOUSE_SYNAPTICS 7
-
-#include "synaptics.c"
-
 static char *psmouse_protocols[] = { "None", "PS/2", "PS2++", "PS2T++", "GenPS/2", "ImPS/2", "ImExPS/2", "Synaptics"};
 
 /*
@@ -258,7 +216,7 @@ static int psmouse_sendbyte(struct psmou
  * then waits for the response and puts it in the param array.
  */
 
-static int psmouse_command(struct psmouse *psmouse, unsigned char *param, int command)
+int psmouse_command(struct psmouse *psmouse, unsigned char *param, int command)
 {
 	int timeout = 500000; /* 500 msec */
 	int send = (command >> 12) & 0xf;
diff -puN drivers/input/mouse/synaptics.c~synaptics-cleanup drivers/input/mouse/synaptics.c
--- 25/drivers/input/mouse/synaptics.c~synaptics-cleanup	Wed Jun 11 13:20:02 2003
+++ 25-akpm/drivers/input/mouse/synaptics.c	Wed Jun 11 13:28:38 2003
@@ -27,19 +27,17 @@
  * Trademarks are the property of their respective owners.
  */
 
-#ifndef CONFIG_MOUSE_PS2_SYNAPTICS
-
-static inline void synaptics_process_byte(struct psmouse *psmouse, struct pt_regs *regs) {}
-static inline int synaptics_init(struct psmouse *psmouse) { return -1; }
-static inline void synaptics_disconnect(struct psmouse *psmouse) {}
-
-#else
+#include <linux/delay.h>
+#include <linux/module.h>
+#include <linux/slab.h>
+#include <linux/interrupt.h>
+#include <linux/input.h>
+#include <linux/serio.h>
+#include <linux/init.h>
 
+#include "psmouse.h"
 #include "synaptics.h"
 
-
-static int psmouse_command(struct psmouse *psmouse, unsigned char *param, int command);
-
 /*
  * Use the Synaptics extended ps/2 syntax to write a special command byte.
  * special command: 0xE8 rr 0xE8 ss 0xE8 tt 0xE8 uu where (rr*64)+(ss*16)+(tt*4)+uu
@@ -244,7 +242,7 @@ static struct synaptics_parameters defau
 	.updown_button_scrolling	= 1
 };
 
-static int synaptics_init(struct psmouse *psmouse)
+int synaptics_init(struct psmouse *psmouse)
 {
 	struct synaptics_data *priv;
 
@@ -278,7 +276,7 @@ static int synaptics_init(struct psmouse
 	return -1;
 }
 
-static void synaptics_disconnect(struct psmouse *psmouse)
+void synaptics_disconnect(struct psmouse *psmouse)
 {
 	struct synaptics_data *priv = psmouse->private;
 
@@ -761,7 +759,7 @@ static void synaptics_process_packet(str
 	input_sync(dev);
 }
 
-static void synaptics_process_byte(struct psmouse *psmouse, struct pt_regs *regs)
+void synaptics_process_byte(struct psmouse *psmouse, struct pt_regs *regs)
 {
 	struct input_dev *dev = &psmouse->dev;
 	struct synaptics_data *priv = psmouse->private;
@@ -797,5 +795,3 @@ static void synaptics_process_byte(struc
 		priv->proto_buf_tail = 0;
 	}
 }
-
-#endif /* CONFIG_MOUSE_PS2_SYNAPTICS */
diff -puN drivers/input/mouse/synaptics.h~synaptics-cleanup drivers/input/mouse/synaptics.h
--- 25/drivers/input/mouse/synaptics.h~synaptics-cleanup	Wed Jun 11 13:20:02 2003
+++ 25-akpm/drivers/input/mouse/synaptics.h	Wed Jun 11 13:22:14 2003
@@ -9,6 +9,8 @@
 #ifndef _SYNAPTICS_H
 #define _SYNAPTICS_H
 
+#ifdef CONFIG_MOUSE_PS2_SYNAPTICS
+
 /* synaptics queries */
 #define SYN_QUE_IDENTIFY		0x00
 #define SYN_QUE_MODES			0x01
@@ -155,4 +157,16 @@ struct synaptics_data {
 	int avg_w;				/* weighted average of previous w values */
 };
 
+void synaptics_process_byte(struct psmouse *psmouse, struct pt_regs *regs);
+int synaptics_init(struct psmouse *psmouse);
+void synaptics_disconnect(struct psmouse *psmouse);
+
+#else	/* CONFIG_MOUSE_PS2_SYNAPTICS */
+
+static inline void synaptics_process_byte(struct psmouse *psmouse, struct pt_regs *regs) {}
+static inline int synaptics_init(struct psmouse *psmouse) { return -1; }
+static inline void synaptics_disconnect(struct psmouse *psmouse) {}
+
+#endif
+
 #endif /* _SYNAPTICS_H */
diff -puN drivers/input/mouse/Makefile~synaptics-cleanup drivers/input/mouse/Makefile
--- 25/drivers/input/mouse/Makefile~synaptics-cleanup	Wed Jun 11 13:20:02 2003
+++ 25-akpm/drivers/input/mouse/Makefile	Wed Jun 11 13:22:55 2003
@@ -12,4 +12,6 @@ obj-$(CONFIG_MOUSE_MAPLE)	+= maplemouse.
 obj-$(CONFIG_MOUSE_PC110PAD)	+= pc110pad.o
 obj-$(CONFIG_MOUSE_PC9800)	+= 98busmouse.o
 obj-$(CONFIG_MOUSE_PS2)		+= psmouse.o
+obj-$(CONFIG_MOUSE_PS2_SYNAPTICS) += synaptics.o
+
 obj-$(CONFIG_MOUSE_SERIAL)	+= sermouse.o
diff -puN drivers/input/mouse/Kconfig~synaptics-cleanup drivers/input/mouse/Kconfig
diff -puN /dev/null drivers/input/mouse/psmouse.h
--- /dev/null	Thu Apr 11 07:25:15 2002
+++ 25-akpm/drivers/input/mouse/psmouse.h	Wed Jun 11 13:28:35 2003
@@ -0,0 +1,47 @@
+
+#define PSMOUSE_CMD_SETSCALE11	0x00e6
+#define PSMOUSE_CMD_SETRES	0x10e8
+#define PSMOUSE_CMD_GETINFO	0x03e9
+#define PSMOUSE_CMD_SETSTREAM	0x00ea
+#define PSMOUSE_CMD_POLL	0x03eb	
+#define PSMOUSE_CMD_GETID	0x02f2
+#define PSMOUSE_CMD_SETRATE	0x10f3
+#define PSMOUSE_CMD_ENABLE	0x00f4
+#define PSMOUSE_CMD_RESET_DIS	0x00f6
+#define PSMOUSE_CMD_RESET_BAT	0x02ff
+
+#define PSMOUSE_RET_BAT		0xaa
+#define PSMOUSE_RET_ACK		0xfa
+#define PSMOUSE_RET_NAK		0xfe
+
+#define PSMOUSE_PS2	1
+#define PSMOUSE_PS2PP	2
+#define PSMOUSE_PS2TPP	3
+#define PSMOUSE_GENPS	4
+#define PSMOUSE_IMPS	5
+#define PSMOUSE_IMEX	6
+#define PSMOUSE_SYNAPTICS 7
+
+
+struct psmouse {
+	void *private;
+	struct input_dev dev;
+	struct serio *serio;
+	char *vendor;
+	char *name;
+	unsigned char cmdbuf[8];
+	unsigned char packet[8];
+	unsigned char cmdcnt;
+	unsigned char pktcnt;
+	unsigned char type;
+	unsigned char model;
+	unsigned long last;
+	char acking;
+	volatile char ack;
+	char error;
+	char devname[64];
+	char phys[32];
+};
+
+int psmouse_command(struct psmouse *psmouse, unsigned char *param, int command);
+

_
