[openfirmware] [commit] r2989 - dev/olpc/touchpad

repository service svn at openfirmware.info
Tue May 29 20:44:37 CEST 2012


Author: wmb
Date: Tue May 29 20:44:37 2012
New Revision: 2989
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2989

Log:
OLPC trac #11902 - ALPS touchpad driver - use mouse emulation mode on initial open so the menu works, switching to ALPS mode only during selftest.

Modified:
   dev/olpc/touchpad/touchpad.fth

Modified: dev/olpc/touchpad/touchpad.fth
==============================================================================
--- dev/olpc/touchpad/touchpad.fth	Fri May 25 03:24:28 2012	(r2988)
+++ dev/olpc/touchpad/touchpad.fth	Tue May 29 20:44:37 2012	(r2989)
@@ -72,17 +72,21 @@
    touchpad-id  h# ffff and  h# 0067 =
 ;
 
+variable mode  \ 0 - unknown  1 - GS  2 - PT  3 - mouse
+
 \ Ref: 5.2.10 (2-1) of Hybrid-GP2B-T-1.pdf
-: advanced-mode  ( -- )  stream-off stream-off stream-off stream-off  ;  \ 4 f5 commands
+: advanced-mode  ( -- )  stream-off stream-off stream-off stream-off  0 mode !  ;  \ 4 f5 commands
 
 \ Ref: 5.2.10 (2-2) of Hybrid-GP2B-T-1.pdf
-: mouse-mode  ( -- )  h# ff read2 drop drop  ;  \ Response is 0,aa
+: mouse-mode  ( -- )    \ Response is 0,aa
+   h# ff read2 drop drop
+   stream-mode  3 mode !
+;
 
 \ Send the common "three f2 commands" prefix.  "f2" is normally the
 \ "identify" command; the response (for a mouse-like device) is 0x00
 : alps-prefix  ( -- )  3 0  do  h# f2 read1 drop  loop  ;
 
-variable mode  \ 0 - unknown  1 - GS  2 - PT  3 - mouse
 0 instance value packet-type
 
 \ Ref: 5.2.10 (3) of Hybrid-GP2B-T-1.pdf
@@ -104,16 +108,16 @@
 : start  ( -- )
    setup
    olpc-touchpad?  if
-      0 mode !  advanced-mode stream-on
+      advanced-mode stream-on
    else
-      stream-mode  3 mode !
+      mouse-mode
    then
 ;
 
 \ Substitute "start" for "stream-mode" in the driver's open
 \ method, so we can use advance-mode for the ALPS touchpad.
 
-patch start stream-mode open
+patch mouse-mode stream-mode open
 
 
 \ I have been unable to get this to work.  The response is always
@@ -543,6 +547,8 @@
       if  track  then
    exit-test?  until
 
+   mouse-mode  \ Restore the standard mouse mode so the menu will work
+
    close
    cursor-on
    page



More information about the openfirmware mailing list