Re: [PATCH 2.6.11-rc3] IBM Trackpoint support

2005-02-13 Thread Dmitry Torokhov
On Sunday 13 February 2005 14:13, Stephen Evanchik wrote:
> On Thu, 3 Feb 2005 22:52:44 -0500, Dmitry Torokhov
> <[EMAIL PROTECTED]> wrote:
> > OK, I have read the code once again, and saw that you have special
> > handling within PS/2 protocol based on model constant. Please set
> > psmouse type to PSMOUSE_TRACKPOINT instead of model and provide full
> > protocol handler, like ALPS, Synaptics and Logitech do. Trackpoint
> > is different and complex enough to warrant it.
> 
> I'm not sure that I think a protocol handler is necessary unless I am
> misunderstanding what you mean. The TrackPoint is nothing more than a
> PS/2 mouse with 2 or 3 buttons that responds to an additional set of
> commands. The extra handling has to do with middle-to-scroll which
> could be done in userspace.
> 

If middle-to-scroll is movd to userspace and there is no trackpoint-
specific handling added to the "normal" psmouse handler then we don't
need a new handler of course.

-- 
Dmitry
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11-rc3] IBM Trackpoint support

2005-02-13 Thread Stephen Evanchik
On Sun, 13 Feb 2005 20:31:49 +0100, Vojtech Pavlik <[EMAIL PROTECTED]> wrote:
>
> You're right. The IBM trackpoints unfortunately don't have a 'native'
> mode, they always do full processing and send classic PS/2 packets.
> 
> I think we shouldn't need a handler, since we can use the PS/2 protocol
> one. We'll need some options to set the trackpoint tap behavior (as far
> as I know it can only be mapped to a button), and we'll need a safe
> detection, but that's all.

The tap only sends a button one event. As far as the Press to Select
qualities are concerned, the necessary options are exposed by the
driver in the sysfs filesystem now. Understanding their  effects on
how a press, drag, double press is detected is another matter.

I'll send a 2.6.11-rc4 based patch later today for consideration.

Stephen
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11-rc3] IBM Trackpoint support

2005-02-13 Thread Vojtech Pavlik
On Sun, Feb 13, 2005 at 02:13:15PM -0500, Stephen Evanchik wrote:

> On Thu, 3 Feb 2005 22:52:44 -0500, Dmitry Torokhov
> <[EMAIL PROTECTED]> wrote:
> > OK, I have read the code once again, and saw that you have special
> > handling within PS/2 protocol based on model constant. Please set
> > psmouse type to PSMOUSE_TRACKPOINT instead of model and provide full
> > protocol handler, like ALPS, Synaptics and Logitech do. Trackpoint
> > is different and complex enough to warrant it.
> 
> I'm not sure that I think a protocol handler is necessary unless I am
> misunderstanding what you mean. The TrackPoint is nothing more than a
> PS/2 mouse with 2 or 3 buttons that responds to an additional set of
> commands. The extra handling has to do with middle-to-scroll which
> could be done in userspace.
> 
> Aside from that the only time TracKPoint specific processing occurs is
> when some property is being manipulated.
> 
> Do you still think a custom handler is necessary? 
 
You're right. The IBM trackpoints unfortunately don't have a 'native'
mode, they always do full processing and send classic PS/2 packets.

I think we shouldn't need a handler, since we can use the PS/2 protocol
one. We'll need some options to set the trackpoint tap behavior (as far
as I know it can only be mapped to a button), and we'll need a safe
detection, but that's all.

-- 
Vojtech Pavlik
SuSE Labs, SuSE CR
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11-rc3] IBM Trackpoint support

2005-02-13 Thread Stephen Evanchik
On Thu, 3 Feb 2005 22:52:44 -0500, Dmitry Torokhov
<[EMAIL PROTECTED]> wrote:
> OK, I have read the code once again, and saw that you have special
> handling within PS/2 protocol based on model constant. Please set
> psmouse type to PSMOUSE_TRACKPOINT instead of model and provide full
> protocol handler, like ALPS, Synaptics and Logitech do. Trackpoint
> is different and complex enough to warrant it.

I'm not sure that I think a protocol handler is necessary unless I am
misunderstanding what you mean. The TrackPoint is nothing more than a
PS/2 mouse with 2 or 3 buttons that responds to an additional set of
commands. The extra handling has to do with middle-to-scroll which
could be done in userspace.

Aside from that the only time TracKPoint specific processing occurs is
when some property is being manipulated.

Do you still think a custom handler is necessary? 

Stephen
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11-rc3] IBM Trackpoint support

2005-02-13 Thread Vojtech Pavlik
On Sun, Feb 13, 2005 at 02:07:39PM -0500, Stephen Evanchik wrote:

> > > Perhaps this should be done in userspace? It is probably usable on
> > > non-trackpoint devices, too...
> > 
> > For a big part it's not possible to do in userspace, because the
> > touchpoint doesn't give the pressure information, it only can be mapped
> > to a button click.
> > 
> > But middle-button-to-scroll would be doable in userspace, yes.
> 
> Middle-to-scroll in the newer Xorg releases. I received a number of
> requests from users to include this feature, I'm not sure why the Xorg
> option is inadequate. It can be removed if necessary.
 
I'm glad it's in the Xorg X server. It's the right place for it to be.

-- 
Vojtech Pavlik
SuSE Labs, SuSE CR
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11-rc3] IBM Trackpoint support

2005-02-13 Thread Stephen Evanchik
On Mon, 7 Feb 2005 11:14:17 +0100, Vojtech Pavlik <[EMAIL PROTECTED]> wrote:
> > Perhaps this should be done in userspace? It is probably usable on
> > non-trackpoint devices, too...
> 
> For a big part it's not possible to do in userspace, because the
> touchpoint doesn't give the pressure information, it only can be mapped
> to a button click.
> 
> But middle-button-to-scroll would be doable in userspace, yes.
> 

Middle-to-scroll in the newer Xorg releases. I received a number of
requests from users to include this feature, I'm not sure why the Xorg
option is inadequate. It can be removed if necessary.


Stephen
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11-rc3] IBM Trackpoint support

2005-02-07 Thread Vojtech Pavlik
On Sat, Feb 05, 2005 at 11:44:05AM +0100, Pavel Machek wrote:

> > Here is a patch that exposes the IBM TrackPoint's extended properties
> > as well as scroll wheel emulation.
> > 
> > 
> > I would appreciate comments and suggestions to make this more acceptable.
> > 
> 
> Perhaps this should be done in userspace? It is probably usable on
> non-trackpoint devices, too...
 
For a big part it's not possible to do in userspace, because the
touchpoint doesn't give the pressure information, it only can be mapped
to a button click.

But middle-button-to-scroll would be doable in userspace, yes.

-- 
Vojtech Pavlik
SuSE Labs, SuSE CR
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11-rc3] IBM Trackpoint support

2005-02-06 Thread Domen Puncer
I'm a bit late, sorry. Haven't seen these mentioned in replies:


On 03/02/05 17:43 -0500, Stephen Evanchik wrote:
> +int tp_sens = TP_DEF_SENS;
> +module_param_named(sens, tp_sens, uint, 0);
> +MODULE_PARM_DESC(sens, "Sensitivity");

I don't see out-of-file usages... these could be static.

...
> + static int name(char* page, char** start, off_t off, int count, int*
> eof, void* data) \
> + { \
> + int len; \
> + struct psmouse *psmouse = (struct psmouse *)data; \
> + struct trackpoint_data *tp = (struct 
> trackpoint_data*)psmouse->private; \

No need to cast (void *).

...
> +static int scroll_write_func(struct file *file, const char __user
> *buffer, unsigned long count, void *data)
> +{
> + int len = count;
> + unsigned char tmp[5];
> + struct psmouse *psmouse = (struct psmouse *)data;
> + struct trackpoint_data *tp = (struct trackpoint_data*)psmouse->private;
> + if(count > sizeof(tmp) - 1)
> + len = sizeof(tmp) - 1;

How about: len = min(count, sizeof(tmp) - 1);?

...
> +no_ext_dev:

Nitpick:
Some like ' ' before label (makes diff -pu patches more readable)



Domen
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11-rc3] IBM Trackpoint support

2005-02-05 Thread Vojtech Pavlik
On Sat, Feb 05, 2005 at 01:56:07AM -0500, Dmitry Torokhov wrote:
> On Friday 04 February 2005 09:45, Vojtech Pavlik wrote:
> > On Fri, Feb 04, 2005 at 09:17:33AM -0500, Dmitry Torokhov wrote:
> >  
> > > It is still a problem if driver is registered after the port has been
> > > detected wich quite often is the case as many people have psmouse as a
> > > module.
> > > 
> > > I wonder if we should make driver registration asynchronous too.
> > 
> > Probably yes.
> > 
> > > I
> > > don't forsee any issues providing that I bump up module's reference
> > > count while driver structure is "in flight", do you?
> >  
> > No, looks OK to me, too.
> 
> Ok, what about the following patch then?

Applied. ;)

> 
> -- 
> Dmitry
> 
> 
> ===
> 
> 
> [EMAIL PROTECTED], 2005-02-05 01:48:45-05:00, [EMAIL PROTECTED]
>   Input: make serio drivers register asynchronously. This should
>  speed up boot process as some drivers take a long time
>  probing for supported devices.
>   
>  Also change __inline__ to inline in serio.h
>   
>   Signed-off-by: Dmitry Torokhov <[EMAIL PROTECTED]>
> 
> 
>  drivers/input/serio/serio.c |   65 
> 
>  include/linux/serio.h   |   25 ++--
>  2 files changed, 51 insertions(+), 39 deletions(-)
> 
> 
> ===
> 
> 
> 
> diff -Nru a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
> --- a/drivers/input/serio/serio.c 2005-02-05 01:53:56 -05:00
> +++ b/drivers/input/serio/serio.c 2005-02-05 01:53:56 -05:00
> @@ -44,7 +44,7 @@
>  EXPORT_SYMBOL(__serio_register_port);
>  EXPORT_SYMBOL(serio_unregister_port);
>  EXPORT_SYMBOL(__serio_unregister_port_delayed);
> -EXPORT_SYMBOL(serio_register_driver);
> +EXPORT_SYMBOL(__serio_register_driver);
>  EXPORT_SYMBOL(serio_unregister_driver);
>  EXPORT_SYMBOL(serio_open);
>  EXPORT_SYMBOL(serio_close);
> @@ -120,18 +120,19 @@
>   * Serio event processing.
>   */
>  
> -struct serio_event {
> - int type;
> - struct serio *serio;
> - struct module *owner;
> - struct list_head node;
> -};
> -
>  enum serio_event_type {
>   SERIO_RESCAN,
>   SERIO_RECONNECT,
>   SERIO_REGISTER_PORT,
>   SERIO_UNREGISTER_PORT,
> + SERIO_REGISTER_DRIVER,
> +};
> +
> +struct serio_event {
> + enum serio_event_type type;
> + void *object;
> + struct module *owner;
> + struct list_head node;
>  };
>  
>  static DEFINE_SPINLOCK(serio_event_lock);/* protects serio_event_list */
> @@ -140,7 +141,7 @@
>  static DECLARE_COMPLETION(serio_exited);
>  static int serio_pid;
>  
> -static void serio_queue_event(struct serio *serio, struct module *owner,
> +static void serio_queue_event(void *object, struct module *owner,
> enum serio_event_type event_type)
>  {
>   unsigned long flags;
> @@ -156,7 +157,7 @@
>* we need to preseve sequence of distinct events.
>*/
>   list_for_each_entry_reverse(event, &serio_event_list, node) {
> - if (event->serio == serio) {
> + if (event->object == object) {
>   if (event->type == event_type)
>   goto out;
>   break;
> @@ -170,7 +171,7 @@
>   }
>  
>   event->type = event_type;
> - event->serio = serio;
> + event->object = object;
>   event->owner = owner;
>  
>   list_add_tail(&event->node, &serio_event_list);
> @@ -198,7 +199,7 @@
>  
>   list_for_each_safe(node, next, &serio_event_list) {
>   e = list_entry(node, struct serio_event, node);
> - if (event->serio == e->serio) {
> + if (event->object == e->object) {
>   /*
>* If this event is of different type we should not
>* look further - we only suppress duplicate events
> @@ -241,6 +242,7 @@
>  static void serio_handle_events(void)
>  {
>   struct serio_event *event;
> + struct serio_driver *serio_drv;
>  
>   down(&serio_sem);
>  
> @@ -248,21 +250,26 @@
>  
>   switch (event->type) {
>   case SERIO_REGISTER_PORT:
> - serio_add_port(event->serio);
> + serio_add_port(event->object);
>   break;
>  
>   case SERIO_UNREGISTER_PORT:
> - serio_disconnect_port(event->serio);
> - serio_destroy_port(event->serio);
> + serio_disconnect_port(event->object);
> + serio_destroy_port(event->object);
>   break;
>  
>   case SERIO_RECONNECT:
> - serio_reconnect_port(event->serio);
> +   

Re: [PATCH 2.6.11-rc3] IBM Trackpoint support

2005-02-05 Thread Pavel Machek
Hi!

> Here is a patch that exposes the IBM TrackPoint's extended properties
> as well as scroll wheel emulation.
> 
> 
> I would appreciate comments and suggestions to make this more acceptable.
> 
> 
> Stephen
> 
> 
> diff -uNr a/drivers/input/mouse/Makefile b/drivers/input/mouse/Makefile
> --- a/drivers/input/mouse/Makefile2005-02-03 17:30:40.0 -0500
> +++ b/drivers/input/mouse/Makefile2005-02-03 17:29:42.0 -0500
> @@ -14,4 +14,4 @@
>  obj-$(CONFIG_MOUSE_SERIAL)   += sermouse.o
>  obj-$(CONFIG_MOUSE_VSXXXAA)  += vsxxxaa.o
>  
> -psmouse-objs  := psmouse-base.o alps.o logips2pp.o synaptics.o
> +psmouse-objs  := psmouse-base.o alps.o logips2pp.o synaptics.o trackpoint.o
> diff -uNr a/drivers/input/mouse/psmouse-base.c
> b/drivers/input/mouse/psmouse-base.c
> --- a/drivers/input/mouse/psmouse-base.c  2005-02-03 17:30:40.0 
> -0500
> +++ b/drivers/input/mouse/psmouse-base.c  2005-02-03 17:29:42.0 
> -0500
> @@ -23,6 +23,7 @@
>  #include "psmouse.h"
>  #include "synaptics.h"
>  #include "logips2pp.h"
> +#include "trackpoint.h"
>  #include "alps.h"
>  
>  #define DRIVER_DESC  "PS/2 mouse driver"
> @@ -119,6 +120,13 @@
>   }
>  
>  /*
> + * TrackPoint scroll simulation handler if the BTN_MIDDLE is down
> + */
> +
> + if(psmouse->model == PSMOUSE_TRACKPOINT)
> + trackpoint_sim_scroll(psmouse);
> +
> +/*
>   * Generic PS/2 Mouse
>   */
>  

Perhaps this should be done in userspace? It is probably usable on
non-trackpoint devices, too...
Pavel


-- 
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11-rc3] IBM Trackpoint support

2005-02-04 Thread Dmitry Torokhov
On Friday 04 February 2005 09:45, Vojtech Pavlik wrote:
> On Fri, Feb 04, 2005 at 09:17:33AM -0500, Dmitry Torokhov wrote:
>  
> > It is still a problem if driver is registered after the port has been
> > detected wich quite often is the case as many people have psmouse as a
> > module.
> > 
> > I wonder if we should make driver registration asynchronous too.
> 
> Probably yes.
> 
> > I
> > don't forsee any issues providing that I bump up module's reference
> > count while driver structure is "in flight", do you?
>  
> No, looks OK to me, too.
> 

Ok, what about the following patch then?

-- 
Dmitry


===


[EMAIL PROTECTED], 2005-02-05 01:48:45-05:00, [EMAIL PROTECTED]
  Input: make serio drivers register asynchronously. This should
 speed up boot process as some drivers take a long time
 probing for supported devices.
  
 Also change __inline__ to inline in serio.h
  
  Signed-off-by: Dmitry Torokhov <[EMAIL PROTECTED]>


 drivers/input/serio/serio.c |   65 
 include/linux/serio.h   |   25 ++--
 2 files changed, 51 insertions(+), 39 deletions(-)


===



diff -Nru a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
--- a/drivers/input/serio/serio.c   2005-02-05 01:53:56 -05:00
+++ b/drivers/input/serio/serio.c   2005-02-05 01:53:56 -05:00
@@ -44,7 +44,7 @@
 EXPORT_SYMBOL(__serio_register_port);
 EXPORT_SYMBOL(serio_unregister_port);
 EXPORT_SYMBOL(__serio_unregister_port_delayed);
-EXPORT_SYMBOL(serio_register_driver);
+EXPORT_SYMBOL(__serio_register_driver);
 EXPORT_SYMBOL(serio_unregister_driver);
 EXPORT_SYMBOL(serio_open);
 EXPORT_SYMBOL(serio_close);
@@ -120,18 +120,19 @@
  * Serio event processing.
  */
 
-struct serio_event {
-   int type;
-   struct serio *serio;
-   struct module *owner;
-   struct list_head node;
-};
-
 enum serio_event_type {
SERIO_RESCAN,
SERIO_RECONNECT,
SERIO_REGISTER_PORT,
SERIO_UNREGISTER_PORT,
+   SERIO_REGISTER_DRIVER,
+};
+
+struct serio_event {
+   enum serio_event_type type;
+   void *object;
+   struct module *owner;
+   struct list_head node;
 };
 
 static DEFINE_SPINLOCK(serio_event_lock);  /* protects serio_event_list */
@@ -140,7 +141,7 @@
 static DECLARE_COMPLETION(serio_exited);
 static int serio_pid;
 
-static void serio_queue_event(struct serio *serio, struct module *owner,
+static void serio_queue_event(void *object, struct module *owner,
  enum serio_event_type event_type)
 {
unsigned long flags;
@@ -156,7 +157,7 @@
 * we need to preseve sequence of distinct events.
 */
list_for_each_entry_reverse(event, &serio_event_list, node) {
-   if (event->serio == serio) {
+   if (event->object == object) {
if (event->type == event_type)
goto out;
break;
@@ -170,7 +171,7 @@
}
 
event->type = event_type;
-   event->serio = serio;
+   event->object = object;
event->owner = owner;
 
list_add_tail(&event->node, &serio_event_list);
@@ -198,7 +199,7 @@
 
list_for_each_safe(node, next, &serio_event_list) {
e = list_entry(node, struct serio_event, node);
-   if (event->serio == e->serio) {
+   if (event->object == e->object) {
/*
 * If this event is of different type we should not
 * look further - we only suppress duplicate events
@@ -241,6 +242,7 @@
 static void serio_handle_events(void)
 {
struct serio_event *event;
+   struct serio_driver *serio_drv;
 
down(&serio_sem);
 
@@ -248,21 +250,26 @@
 
switch (event->type) {
case SERIO_REGISTER_PORT:
-   serio_add_port(event->serio);
+   serio_add_port(event->object);
break;
 
case SERIO_UNREGISTER_PORT:
-   serio_disconnect_port(event->serio);
-   serio_destroy_port(event->serio);
+   serio_disconnect_port(event->object);
+   serio_destroy_port(event->object);
break;
 
case SERIO_RECONNECT:
-   serio_reconnect_port(event->serio);
+   serio_reconnect_port(event->object);
break;
 
case SERIO_RESCAN:
-   serio_disconnect_port(event->serio);
-   serio_find_driver(event->se

Re: [PATCH 2.6.11-rc3] IBM Trackpoint support

2005-02-04 Thread Vojtech Pavlik
On Fri, Feb 04, 2005 at 09:17:33AM -0500, Dmitry Torokhov wrote:
 
> It is still a problem if driver is registered after the port has been
> detected wich quite often is the case as many people have psmouse as a
> module.
> 
> I wonder if we should make driver registration asynchronous too.

Probably yes.

> I
> don't forsee any issues providing that I bump up module's reference
> count while driver structure is "in flight", do you?
 
No, looks OK to me, too.

-- 
Vojtech Pavlik
SuSE Labs, SuSE CR
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11-rc3] IBM Trackpoint support

2005-02-04 Thread Dmitry Torokhov
On Fri, 4 Feb 2005 07:54:54 +0100, Vojtech Pavlik <[EMAIL PROTECTED]> wrote:
> On Fri, Feb 04, 2005 at 01:52:39AM -0500, Dmitry Torokhov wrote:
> > On Friday 04 February 2005 01:35, Vojtech Pavlik wrote:
> > > On Thu, Feb 03, 2005 at 07:34:16PM -0500, Dmitry Torokhov wrote:
> > > > On Thursday 03 February 2005 17:43, Stephen Evanchik wrote:
> > > > > Vojtech,
> > > > >
> > > > > Here is a patch that exposes the IBM TrackPoint's extended properties
> > > > > as well as scroll wheel emulation.
> > > > >
> > > > >
> > > >
> > > > Hi,
> > > >
> > > > Very nice although I have a couple of comments.
> > > >
> > > > >  /*
> > > > > + * Try to initialize the IBM TrackPoint
> > > > > + */
> > > > > +   if (max_proto > PSMOUSE_PS2 && trackpoint_init(psmouse) == 0) 
> > > > > {
> > > > > +   psmouse->vendor = "IBM";
> > > > > +   psmouse->name = "TrackPoint";
> > > > > +
> > > > > +   return PSMOUSE_PS2;
> > > >
> > > > Why PSMOUSE_PS2? Reconnect will surely not like it.
> > >
> > > Indeed. IIRC this patch killed wheel mouse detection in ubuntu.
> > >
> >
> > We may need yet another psmouse_reset after unsuccessful test.
> 
> We probably should do one after every test for isolation. It's not that
> big a problem now that we do the probing from a thread.
> 

It is still a problem if driver is registered after the port has been
detected wich quite often is the case as many people have psmouse as a
module.

I wonder if we should make driver registration asynchronous too. I
don't forsee any issues providing that I bump up module's reference
count while driver structure is "in flight", do you?

-- 
Dmitry
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11-rc3] IBM Trackpoint support

2005-02-04 Thread Dmitry Torokhov
On Fri, 4 Feb 2005 14:45:28 +0100, Vojtech Pavlik <[EMAIL PROTECTED]> wrote:
> On Fri, Feb 04, 2005 at 08:17:43AM -0500, Stephen Evanchik wrote:
> > On Fri, 4 Feb 2005 07:35:20 +0100, Vojtech Pavlik <[EMAIL PROTECTED]> wrote:
> > > Indeed. IIRC this patch killed wheel mouse detection in ubuntu.
> >
> > Earlier versions of the patch didn't disable the device while probing
> > so events could be interpreted as the magic ID of a TrackPoint. It now
> > resets and disables the PS/2 device before detection but not after a
> > detect failure.
> 
> Since we fixed libps2, this shouldn't happen anymore, as long as the
> BIOS doesn't inject an endless stream of data from an USB mouse.
> 

I don't think changes in libps2 affect this problem in any way -
psmouse does PSMOUSE_CMD_RESET_DIS before trying to do any protocol
probing so there should be no events from the mouse during detection
phase.

-- 
Dmitry
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11-rc3] IBM Trackpoint support

2005-02-04 Thread Vojtech Pavlik
On Fri, Feb 04, 2005 at 08:17:43AM -0500, Stephen Evanchik wrote:
> On Fri, 4 Feb 2005 07:35:20 +0100, Vojtech Pavlik <[EMAIL PROTECTED]> wrote:
> > > >  /*
> > > > + * Try to initialize the IBM TrackPoint
> > > > + */
> > > > +   if (max_proto > PSMOUSE_PS2 && trackpoint_init(psmouse) == 0) {
> > > > +   psmouse->vendor = "IBM";
> > > > +   psmouse->name = "TrackPoint";
> > > > +
> > > > +   return PSMOUSE_PS2;
> > >
> > > Why PSMOUSE_PS2? Reconnect will surely not like it.
> > 
> > Indeed. IIRC this patch killed wheel mouse detection in ubuntu.
> 
> Earlier versions of the patch didn't disable the device while probing
> so events could be interpreted as the magic ID of a TrackPoint. It now
> resets and disables the PS/2 device before detection but not after a
> detect failure.

Since we fixed libps2, this shouldn't happen anymore, as long as the
BIOS doesn't inject an endless stream of data from an USB mouse.

> I'll clean that up so its more sensible.

Thanks.

-- 
Vojtech Pavlik
SuSE Labs, SuSE CR
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11-rc3] IBM Trackpoint support

2005-02-04 Thread Stephen Evanchik
On Fri, 4 Feb 2005 07:35:20 +0100, Vojtech Pavlik <[EMAIL PROTECTED]> wrote:
> > >  /*
> > > + * Try to initialize the IBM TrackPoint
> > > + */
> > > +   if (max_proto > PSMOUSE_PS2 && trackpoint_init(psmouse) == 0) {
> > > +   psmouse->vendor = "IBM";
> > > +   psmouse->name = "TrackPoint";
> > > +
> > > +   return PSMOUSE_PS2;
> >
> > Why PSMOUSE_PS2? Reconnect will surely not like it.
> 
> Indeed. IIRC this patch killed wheel mouse detection in ubuntu.

Earlier versions of the patch didn't disable the device while probing
so events could be interpreted as the magic ID of a TrackPoint. It now
resets and disables the PS/2 device before detection but not after a
detect failure.

I'll clean that up so its more sensible.


Stephen
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11-rc3] IBM Trackpoint support

2005-02-03 Thread Dmitry Torokhov
On Friday 04 February 2005 01:35, Vojtech Pavlik wrote:
> On Thu, Feb 03, 2005 at 07:34:16PM -0500, Dmitry Torokhov wrote:
> > On Thursday 03 February 2005 17:43, Stephen Evanchik wrote:
> > > Vojtech,
> > > 
> > > Here is a patch that exposes the IBM TrackPoint's extended properties
> > > as well as scroll wheel emulation.
> > > 
> > > 
> > 
> > Hi,
> > 
> > Very nice although I have a couple of comments.
> > 
> > >  /*
> > > + * Try to initialize the IBM TrackPoint
> > > + */
> > > + if (max_proto > PSMOUSE_PS2 && trackpoint_init(psmouse) == 0) {
> > > + psmouse->vendor = "IBM";
> > > + psmouse->name = "TrackPoint";
> > > + 
> > > + return PSMOUSE_PS2;
> > 
> > Why PSMOUSE_PS2? Reconnect will surely not like it.
> 
> Indeed. IIRC this patch killed wheel mouse detection in ubuntu.
> 

We may need yet another psmouse_reset after unsuccessful test.

-- 
Dmitry
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11-rc3] IBM Trackpoint support

2005-02-03 Thread Vojtech Pavlik
On Fri, Feb 04, 2005 at 01:52:39AM -0500, Dmitry Torokhov wrote:
> On Friday 04 February 2005 01:35, Vojtech Pavlik wrote:
> > On Thu, Feb 03, 2005 at 07:34:16PM -0500, Dmitry Torokhov wrote:
> > > On Thursday 03 February 2005 17:43, Stephen Evanchik wrote:
> > > > Vojtech,
> > > > 
> > > > Here is a patch that exposes the IBM TrackPoint's extended properties
> > > > as well as scroll wheel emulation.
> > > > 
> > > > 
> > > 
> > > Hi,
> > > 
> > > Very nice although I have a couple of comments.
> > > 
> > > >  /*
> > > > + * Try to initialize the IBM TrackPoint
> > > > + */
> > > > +   if (max_proto > PSMOUSE_PS2 && trackpoint_init(psmouse) == 0) {
> > > > +   psmouse->vendor = "IBM";
> > > > +   psmouse->name = "TrackPoint";
> > > > + 
> > > > +   return PSMOUSE_PS2;
> > > 
> > > Why PSMOUSE_PS2? Reconnect will surely not like it.
> > 
> > Indeed. IIRC this patch killed wheel mouse detection in ubuntu.
> > 
> 
> We may need yet another psmouse_reset after unsuccessful test.
 
We probably should do one after every test for isolation. It's not that
big a problem now that we do the probing from a thread.

-- 
Vojtech Pavlik
SuSE Labs, SuSE CR
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11-rc3] IBM Trackpoint support

2005-02-03 Thread Fabio Massimo Di Nitto
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Vojtech Pavlik wrote:
| On Thu, Feb 03, 2005 at 07:34:16PM -0500, Dmitry Torokhov wrote:
|
|>On Thursday 03 February 2005 17:43, Stephen Evanchik wrote:
|>
|>>Vojtech,
|>>
|>>Here is a patch that exposes the IBM TrackPoint's extended properties
|>>as well as scroll wheel emulation.
|>>
|>>
|>
|>Hi,
|>
|>Very nice although I have a couple of comments.
|>
|>
|>> /*
|>>+ * Try to initialize the IBM TrackPoint
|>>+ */
|>>+  if (max_proto > PSMOUSE_PS2 && trackpoint_init(psmouse) == 0) {
|>>+  psmouse->vendor = "IBM";
|>>+  psmouse->name = "TrackPoint";
|>>+
|>>+  return PSMOUSE_PS2;
|>
|>Why PSMOUSE_PS2? Reconnect will surely not like it.
|
|
| Indeed. IIRC this patch killed wheel mouse detection in ubuntu.
|
That's correct. I had to revert it unfortunatly and i am dealing to
give it another shot if you want to get it tested again
before inclusion in the main tree, but it has to happen no later than
next week since we are very close to feature freeze for the next release.
Regards,
Fabio
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iQIVAwUBQgMaXlA6oBJjVJ+OAQKn7A//ULwd9zWcnqgmY0+uacKYT9LYa2hcIBuu
P9i08D/GpTGSglJ0iLBKM6eHw1eKLMwC1snVQ99TyCVMIicEBnNgcF31McEui/Q7
ZJug1Twndb0pUAc/erKUzdqLmQTIPax1eJLLCEmw81UWA0sW2PW52DZ26/4jqSFz
qpNYpvkT8h4X5Gc4l8j/erMYasN4jglcdjDKzfj6NMsVqWC5VJN5W863KPyM2dmf
BN9Mx8jDSzO6PgfquhKJa/6pUV7OODko6PwnJFkWC3SR03x8SjX7EKKDpkYW8OnX
RZGq2Tkmv5B2lme4v9e+O5+UPRzBuahxyknZw9WOcRBUeMpzAAXrIL6cDsWb9ZAd
ZCbIp3MS2be+hIY3hElbHiMN6+XLmr41u5PHGoxBOg8t4UPPTij7/ym3w4iB9Fbu
JIjEDsUfSVjzMZ0+tLGFl+2CtwrrBtmvGnuzLEzJxbwRWlzirIBj5VxAyLUVfXUB
TT0tAeDcopHqki3kFifiXUJ9XKPocwgznosZpISfNdJLB4+kw6S0/XamsbzZBJzr
K1Me547OABE8d/vc4dR7nDKqw4quZk6qThK7wqziiz6mGlBC28gLkfyxfGvVj/Uv
6uaE7RNOvRQYQNUFMMt6BH7vogCp7GsqrMfiiNc72SaxN8Gp4g2cH8v7xpUXcrJ0
mc6TtaGNagQ=
=AVn/
-END PGP SIGNATURE-
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11-rc3] IBM Trackpoint support

2005-02-03 Thread Vojtech Pavlik
On Thu, Feb 03, 2005 at 07:34:16PM -0500, Dmitry Torokhov wrote:
> On Thursday 03 February 2005 17:43, Stephen Evanchik wrote:
> > Vojtech,
> > 
> > Here is a patch that exposes the IBM TrackPoint's extended properties
> > as well as scroll wheel emulation.
> > 
> > 
> 
> Hi,
> 
> Very nice although I have a couple of comments.
> 
> >  /*
> > + * Try to initialize the IBM TrackPoint
> > + */
> > +   if (max_proto > PSMOUSE_PS2 && trackpoint_init(psmouse) == 0) {
> > +   psmouse->vendor = "IBM";
> > +   psmouse->name = "TrackPoint";
> > + 
> > +   return PSMOUSE_PS2;
> 
> Why PSMOUSE_PS2? Reconnect will surely not like it.

Indeed. IIRC this patch killed wheel mouse detection in ubuntu.

> 
> > +int tp_sens = TP_DEF_SENS;
> > +module_param_named(sens, tp_sens, uint, 0);
> > +MODULE_PARM_DESC(sens, "Sensitivity");
> 
> > +int tp_mb_scroll = TP_DEF_MB_SCROLL;
> > +module_param_named(mb_scroll, tp_mb_scroll, uint, 0);
> > +MODULE_PARM_DESC(mb_scroll, "Scroll with middle button");
> 
> All of this should be handled via sysfs dynamically, we don't need any
> more pmouse module parameters.

Exactly.

> > +remove_proc_entry("neg_inertia", tp_dir);
> > +remove_proc_entry("speed", tp_dir);
> > +remove_proc_entry("sensitivity", tp_dir);
> > +remove_proc_entry("trackpoint", NULL);
> > +}
> 
> No new proc stuff please (it will be visible from sysfs when you redo the
> module parameters).

... automatically, even ...

> > +
> > +   tp->scrolling = 0;
> > +   tp->mb_was_down = 0;
> > +   }
> > +else if(tp->scrolling) {
> > +
> > +   /* Vertical scrolling */
> > +   diff = (int) ((packet[0] << 3) & 0x100) - (int) packet[2];
> > +if( diff < -2 ) {
> > +   input_report_rel(&psmouse->dev, REL_WHEEL, 1);
> > +   }
> > +   else if(diff > 2) {
> > +   input_report_rel(&psmouse->dev, REL_WHEEL, -1);
> > +   }
> > +
> > +/* Horizontal scrolling */
> > +diff = (int) packet[1] - (int) ((packet[0] << 4) & 0x100);
> > +if( diff < -2) {
> > +input_report_rel(&psmouse->dev, REL_HWHEEL, 1);
> > +}
> > +else if( diff > 2) {
> > +input_report_rel(&psmouse->dev, REL_HWHEEL, -1);
> > +}
> > +
> > +   packet[1] &= 0x00;
> > +   packet[2] &= 0x00;
> > +   }
> 
> Looks like whitespace damage (tabs vs spaces) plus it should be "} else {"
> on one line.

What a shame that this thing doesn't have a raw mode where it'd report
the pressure ...

> > +int trackpoint_reconnect(struct psmouse *psmouse)
> > +{
> > +   unsigned char toggle;
> > +   struct trackpoint_data *tp = psmouse->private;
> > +
> > +   /* Push the config to the device */
> > +   
> 
> I'd like to verify that it still recognized as trackpoint - suspends often
> play tricks on PS/2 devices.
> 
> > +
> > +   printk("IBM TrackPoint firmware: 0x%02X\n", param[1]);
> 
> KERN_INFO?

-- 
Vojtech Pavlik
SuSE Labs, SuSE CR
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11-rc3] IBM Trackpoint support

2005-02-03 Thread Stephen Evanchik
On Thu, 3 Feb 2005 22:52:44 -0500, Dmitry Torokhov
<[EMAIL PROTECTED]> wrote:
> OK, I have read the code once again, and saw that you have special
> handling within PS/2 protocol based on model constant. Please set
> psmouse type to PSMOUSE_TRACKPOINT instead of model and provide full
> protocol handler, like ALPS, Synaptics and Logitech do. Trackpoint
> is different and complex enough to warrant it.

Thanks, I've made all the changes suggested and I'll incorporate this
too. I'll send a new patch at the end of the weekend when I get back.


Stephen
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11-rc3] IBM Trackpoint support

2005-02-03 Thread Dmitry Torokhov
On Thursday 03 February 2005 19:34, Dmitry Torokhov wrote:
> On Thursday 03 February 2005 17:43, Stephen Evanchik wrote:
> > Vojtech,
> > 
> > Here is a patch that exposes the IBM TrackPoint's extended properties
> > as well as scroll wheel emulation.
> > 
> > 
> 
> Hi,
> 
> Very nice although I have a couple of comments.
> 
> >  /*
> > + * Try to initialize the IBM TrackPoint
> > + */
> > +   if (max_proto > PSMOUSE_PS2 && trackpoint_init(psmouse) == 0) {
> > +   psmouse->vendor = "IBM";
> > +   psmouse->name = "TrackPoint";
> > + 
> > +   return PSMOUSE_PS2;
> 
> Why PSMOUSE_PS2? Reconnect will surely not like it.
>

OK, I have read the code once again, and saw that you have special
handling within PS/2 protocol based on model constant. Please set
psmouse type to PSMOUSE_TRACKPOINT instead of model and provide full
protocol handler, like ALPS, Synaptics and Logitech do. Trackpoint
is different and complex enough to warrant it.

-- 
Dmitry
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11-rc3] IBM Trackpoint support

2005-02-03 Thread Dmitry Torokhov
On Thursday 03 February 2005 17:43, Stephen Evanchik wrote:
> Vojtech,
> 
> Here is a patch that exposes the IBM TrackPoint's extended properties
> as well as scroll wheel emulation.
> 
> 

Hi,

Very nice although I have a couple of comments.

>  /*
> + * Try to initialize the IBM TrackPoint
> + */
> + if (max_proto > PSMOUSE_PS2 && trackpoint_init(psmouse) == 0) {
> + psmouse->vendor = "IBM";
> + psmouse->name = "TrackPoint";
> + 
> + return PSMOUSE_PS2;

Why PSMOUSE_PS2? Reconnect will surely not like it.

> +int tp_sens = TP_DEF_SENS;
> +module_param_named(sens, tp_sens, uint, 0);
> +MODULE_PARM_DESC(sens, "Sensitivity");

> +int tp_mb_scroll = TP_DEF_MB_SCROLL;
> +module_param_named(mb_scroll, tp_mb_scroll, uint, 0);
> +MODULE_PARM_DESC(mb_scroll, "Scroll with middle button");

All of this should be handled via sysfs dynamically, we don't need any
more pmouse module parameters.

> +__obsolete_setup("pts=");
> +__obsolete_setup("backup=");
> +__obsolete_setup("draghyst=");

What are these? They can't be obsolete as the module has never been part
of the vanilla kernel.

> +
> +/*
> + * Device IO: read, write and toggle bit
> + */
> +static void trackpoint_command(struct ps2dev *ps2dev, unsigned char cmd)
> +{
> + ps2_command(ps2dev, NULL, MAKE_PS2_CMD(0, 0, TP_COMMAND));
> + ps2_command(ps2dev, NULL, MAKE_PS2_CMD(0, 0, cmd));
> +}
> +

Error checking would be nice.

> +
> +#ifdef CONFIG_PROC_FS
...
> +{
> +remove_proc_entry("scroll_delay", tp_dir);
> +remove_proc_entry("scroll", tp_dir);
> +remove_proc_entry("transparent", tp_dir);
> +remove_proc_entry("ext_dev", tp_dir);
> +remove_proc_entry("mb", tp_dir);
> +remove_proc_entry("skip_back", tp_dir);
> +remove_proc_entry("ptson", tp_dir);
> +remove_proc_entry("jenks_curv", tp_dir);
> +remove_proc_entry("z_time", tp_dir);
> +remove_proc_entry("up_thresh", tp_dir);
> +remove_proc_entry("thresh", tp_dir);
> +remove_proc_entry("min_drag", tp_dir);
> +remove_proc_entry("drag_hyst", tp_dir);
> +remove_proc_entry("backup", tp_dir);
> +remove_proc_entry("neg_inertia", tp_dir);
> +remove_proc_entry("speed", tp_dir);
> +remove_proc_entry("sensitivity", tp_dir);
> +remove_proc_entry("trackpoint", NULL);
> +}

No new proc stuff please (it will be visible from sysfs when you redo the
module parameters).

> +
> + tp->scrolling = 0;
> + tp->mb_was_down = 0;
> + }
> +else if(tp->scrolling) {
> +
> + /* Vertical scrolling */
> + diff = (int) ((packet[0] << 3) & 0x100) - (int) packet[2];
> +if( diff < -2 ) {
> + input_report_rel(&psmouse->dev, REL_WHEEL, 1);
> + }
> + else if(diff > 2) {
> + input_report_rel(&psmouse->dev, REL_WHEEL, -1);
> + }
> +
> +/* Horizontal scrolling */
> +diff = (int) packet[1] - (int) ((packet[0] << 4) & 0x100);
> +if( diff < -2) {
> +input_report_rel(&psmouse->dev, REL_HWHEEL, 1);
> +}
> +else if( diff > 2) {
> +input_report_rel(&psmouse->dev, REL_HWHEEL, -1);
> +}
> +
> + packet[1] &= 0x00;
> + packet[2] &= 0x00;
> + }

Looks like whitespace damage (tabs vs spaces) plus it should be "} else {"
on one line.

> +int trackpoint_reconnect(struct psmouse *psmouse)
> +{
> + unsigned char toggle;
> + struct trackpoint_data *tp = psmouse->private;
> +
> + /* Push the config to the device */
> + 

I'd like to verify that it still recognized as trackpoint - suspends often
play tricks on PS/2 devices.

> +
> + printk("IBM TrackPoint firmware: 0x%02X\n", param[1]);

KERN_INFO?


-- 
Dmitry
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2.6.11-rc3] IBM Trackpoint support

2005-02-03 Thread Stephen Evanchik
Vojtech,

Here is a patch that exposes the IBM TrackPoint's extended properties
as well as scroll wheel emulation.


I would appreciate comments and suggestions to make this more acceptable.


Stephen


diff -uNr a/drivers/input/mouse/Makefile b/drivers/input/mouse/Makefile
--- a/drivers/input/mouse/Makefile  2005-02-03 17:30:40.0 -0500
+++ b/drivers/input/mouse/Makefile  2005-02-03 17:29:42.0 -0500
@@ -14,4 +14,4 @@
 obj-$(CONFIG_MOUSE_SERIAL) += sermouse.o
 obj-$(CONFIG_MOUSE_VSXXXAA)+= vsxxxaa.o
 
-psmouse-objs  := psmouse-base.o alps.o logips2pp.o synaptics.o
+psmouse-objs  := psmouse-base.o alps.o logips2pp.o synaptics.o trackpoint.o
diff -uNr a/drivers/input/mouse/psmouse-base.c
b/drivers/input/mouse/psmouse-base.c
--- a/drivers/input/mouse/psmouse-base.c2005-02-03 17:30:40.0 
-0500
+++ b/drivers/input/mouse/psmouse-base.c2005-02-03 17:29:42.0 
-0500
@@ -23,6 +23,7 @@
 #include "psmouse.h"
 #include "synaptics.h"
 #include "logips2pp.h"
+#include "trackpoint.h"
 #include "alps.h"
 
 #define DRIVER_DESC"PS/2 mouse driver"
@@ -119,6 +120,13 @@
}
 
 /*
+ * TrackPoint scroll simulation handler if the BTN_MIDDLE is down
+ */
+
+   if(psmouse->model == PSMOUSE_TRACKPOINT)
+   trackpoint_sim_scroll(psmouse);
+
+/*
  * Generic PS/2 Mouse
  */
 
@@ -482,6 +490,16 @@
return PSMOUSE_IMPS;
 
 /*
+ * Try to initialize the IBM TrackPoint
+ */
+   if (max_proto > PSMOUSE_PS2 && trackpoint_init(psmouse) == 0) {
+   psmouse->vendor = "IBM";
+   psmouse->name = "TrackPoint";
+ 
+   return PSMOUSE_PS2;
+   }
+
+/*
  * Okay, all failed, we have a standard mouse here. The number of the buttons
  * is still a question, though. We assume 3.
  */
diff -uNr a/drivers/input/mouse/trackpoint.c b/drivers/input/mouse/trackpoint.c
--- a/drivers/input/mouse/trackpoint.c  1969-12-31 19:00:00.0 -0500
+++ b/drivers/input/mouse/trackpoint.c  2005-02-03 17:29:42.0 -0500
@@ -0,0 +1,649 @@
+/*
+ * Stephen Evanchik <[EMAIL PROTECTED]>
+ *
+ * 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.
+ *
+ * 29/01/2005 - Fixed UltraNav support
+ * Moved to libps2 interface
+ * Renamed internal property variables to be consistent with 
reference docs
+ * Fixed negative inertia not being set properly
+ * Added middle button scroll module parameter
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "psmouse.h"
+#include "trackpoint.h"
+
+
+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_reach = TP_DEF_REACH;
+module_param_named(reach, tp_reach, uint, 0);
+MODULE_PARM_DESC(reach, "Backup Range");
+
+int tp_draghys = TP_DEF_DRAGHYS;
+module_param_named(draghys, tp_draghys, uint, 0);
+MODULE_PARM_DESC(draghys, "Resistance to dragging");
+
+int tp_mindrag = TP_DEF_MINDRAG;
+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");
+
+
+/* Toggles */
+int tp_ptson = TP_DEF_PTSON;
+module_param_named(ptson, tp_ptson, uint, 0);
+MODULE_PARM_DESC(ptson, "Press to Select");
+
+int tp_mb = TP_DEF_MB;
+module_param_named(mb, tp_mb, uint, 0);
+MODULE_PARM_DESC(mb, "Middle button is disabled");
+
+int tp_mb_scroll = TP_DEF_MB_SCROLL;
+module_param_named(mb_scroll, tp_mb_scroll, uint, 0);
+MODULE_PARM_DESC(mb_scroll, "Scroll with middle button");
+
+
+__obsolete_setup("pts=");
+__obsolete_setup("backup=");
+__obsolete_setup("draghyst=");
+
+/*
+ * Device IO: read, write and toggle bit
+ */
+static void trackpoint_command(struct ps2dev *ps2dev, unsigned char cmd)
+{  
+   ps2_command(ps2dev, NULL, MAKE_PS2_CMD(0, 0, TP_COMMAND));
+   ps2_command(ps2dev, NULL, MAKE_PS2_CMD(0, 0, cmd));
+}
+
+static void trackpoint_read(struct ps2dev *ps2dev, unsigned char loc,
unsigned char *results)
+{
+   ps2_command(ps2dev, NULL, MAKE_PS2_CMD(0, 0, TP_COMMAND));
+   ps2_command(ps2