diff -uN linux-2.6.3-rc2-vanilla/drivers/input/mouse/Makefile linux-2.6.3-rc2/drivers/input/mouse/Makefile --- linux-2.6.3-rc2-vanilla/drivers/input/mouse/Makefile 2004-02-03 22:43:17.000000000 -0500 +++ linux-2.6.3-rc2/drivers/input/mouse/Makefile 2004-02-11 20:25:20.000000000 -0500 @@ -14,4 +14,4 @@ obj-$(CONFIG_MOUSE_PS2) += psmouse.o obj-$(CONFIG_MOUSE_SERIAL) += sermouse.o -psmouse-objs := psmouse-base.o logips2pp.o synaptics.o +psmouse-objs := psmouse-base.o logips2pp.o synaptics.o trackpoint.o diff -uN linux-2.6.3-rc2-vanilla/drivers/input/mouse/built-in.o linux-2.6.3-rc2/drivers/input/mouse/built-in.o --- linux-2.6.3-rc2-vanilla/drivers/input/mouse/built-in.o 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.6.3-rc2/drivers/input/mouse/built-in.o 2004-02-11 20:37:37.000000000 -0500 @@ -0,0 +1 @@ +! Binary files linux-2.6.3-rc2-vanilla/drivers/input/mouse/logips2pp.o and linux-2.6.3-rc2/drivers/input/mouse/logips2pp.o differ diff -uN linux-2.6.3-rc2-vanilla/drivers/input/mouse/psmouse-base.c linux-2.6.3-rc2/drivers/input/mouse/psmouse-base.c --- linux-2.6.3-rc2-vanilla/drivers/input/mouse/psmouse-base.c 2004-02-03 22:43:18.000000000 -0500 +++ linux-2.6.3-rc2/drivers/input/mouse/psmouse-base.c 2004-02-11 20:25:09.000000000 -0500 @@ -21,6 +21,7 @@ #include "psmouse.h" #include "synaptics.h" #include "logips2pp.h" +#include "trackpoint.h" MODULE_AUTHOR("Vojtech Pavlik "); MODULE_DESCRIPTION("PS/2 mouse driver"); @@ -347,6 +348,17 @@ psmouse->name = "Mouse"; psmouse->model = 0; + /* + * Try to initialize the IBM TrackPoint + */ + if (!trackpoint_init(psmouse)) { + + psmouse->vendor = "IBM"; + psmouse->name = "TrackPoint"; + + return PSMOUSE_PS2; + } + /* * Try Synaptics TouchPad */ Binary files linux-2.6.3-rc2-vanilla/drivers/input/mouse/psmouse-base.o and linux-2.6.3-rc2/drivers/input/mouse/psmouse-base.o differ Binary files linux-2.6.3-rc2-vanilla/drivers/input/mouse/psmouse.ko and linux-2.6.3-rc2/drivers/input/mouse/psmouse.ko differ diff -uN linux-2.6.3-rc2-vanilla/drivers/input/mouse/psmouse.mod.c linux-2.6.3-rc2/drivers/input/mouse/psmouse.mod.c --- linux-2.6.3-rc2-vanilla/drivers/input/mouse/psmouse.mod.c 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.6.3-rc2/drivers/input/mouse/psmouse.mod.c 2004-02-11 20:57:05.000000000 -0500 @@ -0,0 +1,42 @@ +#include +#include +#include + +MODULE_INFO(vermagic, VERMAGIC_STRING); + +static const struct modversion_info ____versions[] +__attribute_used__ +__attribute__((section("__versions"))) = { + { 0x32819afe, "struct_module" }, + { 0xd15bfbab, "serio_register_device" }, + { 0xfc196f25, "malloc_sizes" }, + { 0xeae3dfd6, "__const_udelay" }, + { 0x39a82bbf, "serio_interrupt" }, + { 0x1d26aa98, "sprintf" }, + { 0xda02d67, "jiffies" }, + { 0xeff9a597, "input_event" }, + { 0xaa136450, "param_get_charp" }, + { 0x1b7d4074, "printk" }, + { 0xdc76cbcb, "param_set_bool" }, + { 0xfdc0f33a, "serio_close" }, + { 0x46f1598d, "serio_open" }, + { 0x1af7d0f, "kmem_cache_alloc" }, + { 0x72216fa9, "param_get_uint" }, + { 0xd2ffae12, "input_register_device" }, + { 0xa3fd5359, "serio_unregister_device" }, + { 0xf4bcf4ca, "__serio_unregister_port" }, + { 0x2cd7da6c, "param_set_charp" }, + { 0x8c76d19d, "serio_reconnect" }, + { 0xdd833ca7, "__serio_register_port" }, + { 0x37a0cba, "kfree" }, + { 0xf0c15333, "input_unregister_device" }, + { 0x8abac70a, "param_set_uint" }, + { 0xd840be60, "serio_rescan" }, + { 0x5611e4ec, "param_get_bool" }, +}; + +static const char __module_depends[] +__attribute_used__ +__attribute__((section(".modinfo"))) = +"depends="; + Binary files linux-2.6.3-rc2-vanilla/drivers/input/mouse/psmouse.mod.o and linux-2.6.3-rc2/drivers/input/mouse/psmouse.mod.o differ Binary files linux-2.6.3-rc2-vanilla/drivers/input/mouse/psmouse.o and linux-2.6.3-rc2/drivers/input/mouse/psmouse.o differ Binary files linux-2.6.3-rc2-vanilla/drivers/input/mouse/synaptics.o and linux-2.6.3-rc2/drivers/input/mouse/synaptics.o differ diff -uN linux-2.6.3-rc2-vanilla/drivers/input/mouse/trackpoint.c linux-2.6.3-rc2/drivers/input/mouse/trackpoint.c --- linux-2.6.3-rc2-vanilla/drivers/input/mouse/trackpoint.c 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.6.3-rc2/drivers/input/mouse/trackpoint.c 2004-02-12 11:27:07.000000000 -0500 @@ -0,0 +1,207 @@ +/* + * Stephen Evanchik + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published by + * the Free Software Foundation. + * + * Trademarks are the property of their respective owners. + * + */ + +#include +#include +#include +#include +#include +#include "psmouse.h" +#include "trackpoint.h" + +int tp_pts = TP_DEF_PTS; +module_param_named(pts, tp_pts, uint, 0); +MODULE_PARM_DESC(pts, "Press to Select"); + +int tp_sens = TP_DEF_SENS; +module_param_named(sens, tp_sens, uint, 0); +MODULE_PARM_DESC(sens, "Sensitivity"); + +int tp_speed = TP_DEF_SPEED; +module_param_named(speed, tp_speed, uint, 0); +MODULE_PARM_DESC(speed, "Speed of pointer"); + +int tp_backup = TP_DEF_BACKUP; +module_param_named(backup, tp_backup, uint, 0); +MODULE_PARM_DESC(backup, "Backup Range"); + +int tp_draghyst = TP_DEF_DRAG_HYST; +module_param_named(draghyst, tp_draghyst, uint, 0); +MODULE_PARM_DESC(draghyst, "Resistance to dragging"); + +int tp_mindrag = TP_DEF_MIN_DRAG; +module_param_named(mindrag, tp_mindrag, uint, 0); +MODULE_PARM_DESC(mindrag, "Drag threshold"); + +int tp_thresh = TP_DEF_THRESH; +module_param_named(thresh, tp_thresh, uint, 0); +MODULE_PARM_DESC(thresh, "Force necessary to trigger a press or release"); + +int tp_upthresh = TP_UP_THRESH; +module_param_named(upthresh, tp_upthresh, uint, 0); +MODULE_PARM_DESC(upthresh, "Force necessary to trigger a click"); + +int tp_ztime = TP_DEF_Z_TIME; +module_param_named(ztime, tp_ztime, uint, 0); +MODULE_PARM_DESC(ztime, "Determines how sharp a press is"); + +int tp_jenks = TP_DEF_JENKS_CURV; +module_param_named(jenks, tp_jenks, uint, 0); +MODULE_PARM_DESC(jenks, "Double click sensitivity"); + + +static void trackpoint_read(struct psmouse *psmouse, unsigned char loc, unsigned char *results); +static void trackpoint_write(struct psmouse *psmouse, unsigned char loc, unsigned char val); + +static int trackpoint_toggle_bit(struct psmouse *psmouse, unsigned char loc, unsigned char mask); + +static void trackpoint_defaults(struct trackpoint_data *tp); +static int trackpoint_proc_init(struct psmouse *psmouse); + +void trackpoint_disconnect(struct psmouse *psmouse); +int trackpoint_reconnect(struct psmouse *psmouse); + + +int trackpoint_init(struct psmouse *psmouse) +{ + unsigned char param[2]; + struct trackpoint_data *priv; + + param[0] = param[1] = 0; + + psmouse_command(psmouse, param, MAKE_PS2_CMD(0, 2, TP_READ_ID)); + + if(param[0] != TP_MAGIC_IDENT) + return -1; + + psmouse->private = priv = kmalloc(sizeof(struct trackpoint_data), GFP_KERNEL); + + if(!priv) + return -1; + + memset(priv, 0, sizeof(struct trackpoint_data)); + + priv->firmware_id = param[1]; + + psmouse->reconnect = trackpoint_reconnect; + psmouse->disconnect = trackpoint_disconnect; + + /* + * Initialize the device's default settings + */ + trackpoint_defaults(priv); + trackpoint_reconnect(psmouse); + + trackpoint_proc_init(psmouse); + + printk("IBM TrackPoint firmware: 0x%02X\n", param[1]); + + return 0; +} + +void trackpoint_disconnect(struct psmouse *psmouse) +{ + kfree(psmouse->private); +} + +int trackpoint_reconnect(struct psmouse *psmouse) +{ + unsigned char toggle; + struct trackpoint_data *tp = psmouse->private; + + /* Push the config to the device */ + + trackpoint_write(psmouse, TP_SENS, tp->sens); + trackpoint_write(psmouse, TP_NEG_INERT, tp->inertia); + trackpoint_write(psmouse, TP_SPEED, tp->speed); + + trackpoint_read(psmouse, TP_TOGGLE_PTS, &toggle); + + if((toggle & TP_MASK_PTS) != tp->ptson) + trackpoint_toggle_bit(psmouse, TP_TOGGLE_PTS, TP_MASK_PTS); + + trackpoint_write(psmouse, TP_BACKUP, tp->reach); + trackpoint_write(psmouse, TP_DRAG_HYST, tp->draghys); + trackpoint_write(psmouse, TP_MIN_DRAG, tp->mindrag); + + trackpoint_write(psmouse, TP_THRESH, tp->thresh); + trackpoint_write(psmouse, TP_UP_THRESH, tp->up_thresh); + + trackpoint_write(psmouse, TP_Z_TIME, tp->z_time); + trackpoint_write(psmouse, TP_JENKS_CURV, tp->jenks_curv); + + trackpoint_read(psmouse, TP_TOGGLE_SKIP_BACK, &toggle); + + if((toggle & TP_MASK_SKIP_BACK) != tp->skipback) + trackpoint_toggle_bit(psmouse, TP_TOGGLE_SKIP_BACK, TP_MASK_SKIP_BACK); + + /* TODO: Add external device pass through */ + + return 0; +} + +static void trackpoint_defaults(struct trackpoint_data *tp) +{ + tp->ptson = tp_pts; + tp->sens = tp_sens; + tp->speed = tp_speed; + tp->reach = tp_backup; + + tp->draghys = tp_draghyst; + tp->mindrag = tp_mindrag; + + tp->thresh = tp_thresh; + tp->up_thresh = tp_upthresh; + + tp->z_time = tp_ztime; + tp->jenks_curv = tp_jenks; + + tp->skipback = TP_DEF_SKIP_BACK; +} + +static void trackpoint_read(struct psmouse *psmouse, unsigned char loc, unsigned char *results) +{ + psmouse_command(psmouse, NULL, MAKE_PS2_CMD(0, 0, TP_COMMAND)); + psmouse_command(psmouse, results, MAKE_PS2_CMD(0, 1, loc)); +} + +static void trackpoint_write(struct psmouse *psmouse, unsigned char loc, unsigned char val) +{ + psmouse_command(psmouse, NULL, MAKE_PS2_CMD(0, 0, TP_COMMAND)); + psmouse_command(psmouse, NULL, MAKE_PS2_CMD(0,0, TP_WRITE_MEM)); + psmouse_command(psmouse, &val, MAKE_PS2_CMD(1,0, loc)); +} + +static int trackpoint_toggle_bit(struct psmouse *psmouse, unsigned char loc, unsigned char mask) +{ + /* Bad things will happen if the loc param isn't in this range */ + if(loc < 0x20 || loc >= 0x2F) + return -1; + + psmouse_command(psmouse, NULL, MAKE_PS2_CMD(0, 0, TP_COMMAND)); + psmouse_command(psmouse, NULL, MAKE_PS2_CMD(0, 0, TP_TOGGLE)); + psmouse_command(psmouse, &mask, MAKE_PS2_CMD(1, 0, loc)); + + return 0; +} + +#ifdef CONFIG_PROC_FS + +static int trackpoint_proc_init(struct psmouse *psmouse) +{ + return 0; +} + +#else +static int trackpoint_proc_init(struct psmouse *psmouse) { return 0; } +#endif + + diff -uN linux-2.6.3-rc2-vanilla/drivers/input/mouse/trackpoint.h linux-2.6.3-rc2/drivers/input/mouse/trackpoint.h --- linux-2.6.3-rc2-vanilla/drivers/input/mouse/trackpoint.h 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.6.3-rc2/drivers/input/mouse/trackpoint.h 2004-02-11 22:55:10.000000000 -0500 @@ -0,0 +1,140 @@ +/* + * IBM TrackPoint PS/2 mouse driver + * + * Stephen Evanchik + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published by + * the Free Software Foundation. + */ + +#ifndef _TRACKPOINT_H +#define _TRACKPOINT_H + +/* + * These constants are from the TrackPoint System + * Engineering documentation Version 4 from IBM Watson + * research: + * http://wwwcssrv.almaden.ibm.com/trackpoint/download.html + */ + +#define TP_READ_ID (0xE1) /* Sent for device identification */ +#define TP_MAGIC_IDENT (0x01) /* Sent after a TP_READ_ID followed */ + /* by the firmware ID */ + +#define TP_COMMAND (0xE2) /* Commands start with this */ + + +/* + * Commands + */ +#define TP_RECALIB (0x51) /* Recalibrate */ +#define TP_POWER_DOWN (0x44) /* Can only be undone through HW reset */ +#define TP_EXT_DEV (0x21) /* Determines if external device is connected (RO) */ +#define TP_EXT_BTN (0x4B) /* Read extended button status */ + +/* + * Mode manipulation + */ +#define TP_SET_SOFT_TRANS (0x4E) /* Set mode */ +#define TP_CAN_SOFT_TRANS (0xB9) /* Cancel mode */ +#define TP_SET_HARD_TRANS (0x45) /* Mode can only be set */ + + +/* + * Register oriented commands/properties + */ +#define TP_WRITE_MEM (0x81) +#define TP_READ_MEM (0x80) /* Not used in this implementation */ + +/* +* RAM Locations for properties + */ +#define TP_SENS (0x4A) /* Sensitivity */ +#define TP_MB (0x4C) /* Read Middle Button Status (RO) */ +#define TP_NEG_INERT (0x4D) /* Negative Inertia */ +#define TP_SPEED (0x60) /* Speed of TP Cursor */ +#define TP_BACKUP (0x57) /* Backup for Z-axis press */ +#define TP_DRAG_HYST (0x58) /* Drag Hysteresis */ + /* (how hard it is to drag */ + /* with Z-axis pressed) */ + +#define TP_MIN_DRAG (0x59) /* Minimum amount of force needed */ + /* to trigger dragging */ + +#define TP_THRESH (0x5C) /* Minimum value for a Z-axis press */ +#define TP_UP_THRESH (0x5A) /* Used to generate a 'click' on Z-axis */ +#define TP_Z_TIME (0x5E) /* How sharp of a press */ +#define TP_JENKS_CURV (0x5D) /* Minimum curvature for double click */ + +/* + * Toggling Flag bits + */ +#define TP_TOGGLE (0x47) /* Toggle command */ + +#define TP_TOGGLE_MB (0x23) /* Disable/Enable Middle Button */ +#define TP_TOGGLE_DRIFT (0x23) /* Drift Correction */ +#define TP_TOGGLE_BURST (0x28) /* Burst Mode */ +#define TP_TOGGLE_PTS (0x2C) /* Press to Select */ +#define TP_TOGGLE_HARD_TRANS (0x2C) /* Alternate method to set Hard Transparency */ +#define TP_TOGGLE_TWOHAND (0x2D) /* Two handed */ +#define TP_TOGGLE_STICKY_TWO (0x2D) /* Sticky two handed */ +#define TP_TOGGLE_SKIP_BACK (0x2D) /* Suppress movement */ + /* after drag release */ + +/* + * Various makses for registers + * XOR'd to current contents for new value + */ +#define TP_MASK_PTS (0x01) +#define TP_MASK_SKIP_BACK (0x08) +#define TP_MASK_TWOHAND (0x01) +#define TP_MASK_STICKY_TWO (0x04) +#define TP_MASK_HARD_TRANS (0x80) +#define TP_MASK_BURST (0x80) +#define TP_MASK_MB (0x01) +#define TP_MASK_DRIFT (0x80) + +/* + * Default power on values + */ +#define TP_DEF_PTS (0x00) +#define TP_DEF_SENS (0x80) +#define TP_DEF_NEG_INT (0x06) +#define TP_DEF_SPEED (0x61) +#define TP_DEF_BACKUP (0x0A) + +#define TP_DEF_DRAG_HYST (0xFF) +#define TP_DEF_MIN_DRAG (0x14) + +#define TP_DEF_THRESH (0x08) +#define TP_DEF_UP_THRESH (0xFF) +#define TP_DEF_Z_TIME (0x26) +#define TP_DEF_JENKS_CURV (0x87) +#define TP_DEF_SKIP_BACK (0x00) + +#define MAKE_PS2_CMD(params, results, cmd) ((params<<12) | (results<<8) | (cmd)) + +enum +{ TP_SOFT_TRANS, TP_HARD_TRANS }; + +struct trackpoint_data +{ + + unsigned char firmware_id; + + unsigned char mode; /* Transparency mode */ + + unsigned char sens, speed, inertia, reach; + unsigned char draghys, mindrag; + unsigned char thresh, up_thresh; + unsigned char z_time, jenks_curv; + + unsigned char ptson; /* Press to Select */ + unsigned char twohand, skipback; +}; + +extern int trackpoint_init (struct psmouse *psmouse); + + +#endif /* _TRACKPOINT_H */ Binary files linux-2.6.3-rc2-vanilla/drivers/input/mouse/trackpoint.o and linux-2.6.3-rc2/drivers/input/mouse/trackpoint.o differ