From rea-fbsd@codelabs.ru  Tue Feb 19 14:28:16 2008
Return-Path: <rea-fbsd@codelabs.ru>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9EA1F16A417;
	Tue, 19 Feb 2008 14:28:16 +0000 (UTC)
	(envelope-from rea-fbsd@codelabs.ru)
Received: from 0.mx.codelabs.ru (0.mx.codelabs.ru [144.206.177.45])
	by mx1.freebsd.org (Postfix) with ESMTP id 4D62E13C469;
	Tue, 19 Feb 2008 14:28:16 +0000 (UTC)
	(envelope-from rea-fbsd@codelabs.ru)
Received: from void.codelabs.ru (void.codelabs.ru [144.206.177.25])
	by 0.mx.codelabs.ru with esmtps (TLSv1:CAMELLIA256-SHA:256)
	id 1JRTSA-00032F-Rf; Tue, 19 Feb 2008 17:28:15 +0300
Message-Id: <20080219142814.A9ACE1AF41E@void.codelabs.ru>
Date: Tue, 19 Feb 2008 17:28:14 +0300 (MSK)
From: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
Reply-To: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc: njl@freebsd.org, rik@freebsd.org
Subject: [patch] psm: try to detect Synaptics touchpad before IntelliMouse
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         120833
>Category:       kern
>Synopsis:       [psm] [patch] try to detect Synaptics touchpad before IntelliMouse
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 19 14:30:01 UTC 2008
>Closed-Date:    Sun Jun 01 13:45:15 UTC 2008
>Last-Modified:  Sun Jun  8 09:10:03 UTC 2008
>Originator:     Eygene Ryabinkin
>Release:        FreeBSD 6.3-RELEASE amd64
>Organization:
Code Labs
>Environment:

System: FreeBSD XXX 6.3-RELEASE FreeBSD 6.3-RELEASE #15: Tue Feb 19 16:24:48 MSK 2008 root@XXX:/usr/obj/usr/src/sys/XXX amd64

>Description:

On HP/Compaq 6910p (GB951EA) notebook, psm driver detects Synaptics
touchpad as the IntelliMouse:
-----
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: [GIANT-LOCKED]
psm0: model IntelliMouse, device ID 3-00, 3 buttons
-----

>How-To-Repeat:

Get HP 6910p (the one at hand was the rik@'s one), enable Synaptics
hw.psm.synaptics_support, boot FreeBSD and look at dmesg.  Additionally,
one can try to use synaptics driver for Xorg (from ports): it will
refuse to find the device.

>Fix:

The simplest fix is to reorder touchpad detection in dev/atkbdc/psm.c:

--- patch-try_synaptics_earlier begins here ---
--- psm.c.orig	2008-02-19 16:59:05.000000000 +0300
+++ psm.c	2008-02-19 16:59:56.000000000 +0300
@@ -357,6 +357,8 @@
       0x08, MOUSE_4D_PACKETSIZE, enable_4dmouse, },
     { MOUSE_MODEL_4DPLUS,		/* A4 Tech 4D+ Mouse */
       0xc8, MOUSE_4DPLUS_PACKETSIZE, enable_4dplus, },
+    { MOUSE_MODEL_SYNAPTICS,		/* Synaptics Touchpad */
+      0xc0, MOUSE_SYNAPTICS_PACKETSIZE, enable_synaptics, },
     { MOUSE_MODEL_INTELLI,		/* Microsoft IntelliMouse */
       0x08, MOUSE_PS2INTELLI_PACKETSIZE, enable_msintelli, },
     { MOUSE_MODEL_GLIDEPOINT,		/* ALPS GlidePoint */
@@ -365,8 +367,6 @@
       0x80, MOUSE_PS2_PACKETSIZE, enable_kmouse, },
     { MOUSE_MODEL_VERSAPAD,		/* Interlink electronics VersaPad */
       0xe8, MOUSE_PS2VERSA_PACKETSIZE, enable_versapad, },
-    { MOUSE_MODEL_SYNAPTICS,		/* Synaptics Touchpad */
-      0xc0, MOUSE_SYNAPTICS_PACKETSIZE, enable_synaptics, },
     { MOUSE_MODEL_GENERIC,
       0xc0, MOUSE_PS2_PACKETSIZE, NULL, },
 };
--- patch-try_synaptics_earlier ends here ---

This works: FreeBSD's psm(4) detects the touchpad and Xorg happily
works with both touchpad and stick.  I don't know if it will break
something: it seems to me that Synaptics detection routine is rather
specific to the Synaptics itself, but the reality can be different.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: philip 
State-Changed-When: Sun Jun 1 13:45:14 UTC 2008 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=120833 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/120833: commit references a PR
Date: Sun,  1 Jun 2008 13:45:21 +0000 (UTC)

 philip      2008-06-01 13:45:14 UTC
 
   FreeBSD src repository
 
   Modified files:
     sys/dev/atkbdc       psm.c 
   Log:
   SVN rev 179474 on 2008-06-01 13:44:51Z by philip
   
   Try to detect a Synaptics touchpad before IntelliMouse.  Some touchpads will
   pretend to be IntelliMouse (which have a few more features than generic mice)
   causing the IntelliMouse probe to work and the Synaptics code never to be
   called.
   
   This should not break "real" IntelliMouse because the Synaptics detection code
   is fairly specific.
   
   PR:             kern/120833
   Submitted by:   Eygene Ryabinkin <rea-fbsd -at- codelabs.ru>
   MFC after:      1 week
   
   Revision  Changes    Path
   1.97      +2 -2      src/sys/dev/atkbdc/psm.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/120833: commit references a PR
Date: Sun,  8 Jun 2008 09:07:03 +0000 (UTC)

 philip      2008-06-08 09:06:45 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_7)
     sys/dev/atkbdc       psm.c 
   Log:
   SVN rev 179649 on 2008-06-08 09:06:45Z by philip
   
   MFC r179474:
   
     Try to detect a Synaptics touchpad before IntelliMouse.  Some touchpads will
     pretend to be IntelliMouse (which have a few more features than generic mice)
     causing the IntelliMouse probe to work and the Synaptics code never to be
     called.
   
     This should not break "real" IntelliMouse because the Synaptics detection code
     is fairly specific.
   
   PR:             kern/120833
   Submitted by:   Eygene Ryabinkin <rea-fbsd -at- codelabs.ru>
   
   Revision  Changes    Path
   1.93.2.3  +2 -2      src/sys/dev/atkbdc/psm.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
