Input: ALPS - Introduce helper function for repeated commands
Subsystems (3)
PATCH 1/3 Input: ALPS - Introduce helper function for repeated commands
Several ALPS driver init sequences repeat a command three times, then issue PSMOUSE_CMD_GETINFO to read the result. Move this into a helper function to simplify the code.
--- drivers/input/mouse/alps.c | 50 +++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 26 deletions(-)
drivers/input/mouse/alps.c +24 -26
@@ -967,16 +967,31 @@ static int alps_command_mode_write_reg(struct psmouse *psmouse, int addr,return __alps_command_mode_write_reg (psmouse, value); } +static int alps_rpt_cmd (struct ps2dev *ps2dev,int init_command, +int repeated_command,unsigned char *param) +{ + param[0 ] =0 ; +if (init_command &&ps2_command (ps2dev, param, init_command)) +return -EIO ; + +if (ps2_command (ps2dev,NULL , repeated_command) || +ps2_command (ps2dev,NULL , repeated_command) || +ps2_command (ps2dev,NULL , repeated_command)) +return -EIO ; + + param[0 ] = param[1 ] = param[2 ] =0xff ; +if (ps2_command (ps2dev, param,PSMOUSE_CMD_GETINFO )) +return -EIO ; +return 0 ; +} +static int alps_enter_command_mode (struct psmouse *psmouse,unsigned char *resp) {unsigned char param[4 ];struct ps2dev *ps2dev = &psmouse->ps2dev; -if (ps2_command (ps2dev,NULL ,PSMOUSE_CMD_RESET_WRAP ) || -ps2_command (ps2dev,NULL ,PSMOUSE_CMD_RESET_WRAP ) || -ps2_command (ps2dev,NULL ,PSMOUSE_CMD_RESET_WRAP ) || -ps2_command (ps2dev, param,PSMOUSE_CMD_GETINFO )) { +if (alps_rpt_cmd (ps2dev,0 ,PSMOUSE_CMD_RESET_WRAP , param)) {psmouse_err (psmouse,"failed to enter command mode\n" );return -1 ; }
@@ -1015,15 +1030,8 @@ static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int* The bits 0-2 of the first byte will be 1s if some buttons are * pressed. */ - param[0 ] =0 ; -if (ps2_command (ps2dev, param,PSMOUSE_CMD_SETRES ) || -ps2_command (ps2dev,NULL ,PSMOUSE_CMD_SETSCALE11 ) || -ps2_command (ps2dev,NULL ,PSMOUSE_CMD_SETSCALE11 ) || -ps2_command (ps2dev,NULL ,PSMOUSE_CMD_SETSCALE11 )) -return NULL ; - - param[0 ] = param[1 ] = param[2 ] =0xff ; -if (ps2_command (ps2dev, param,PSMOUSE_CMD_GETINFO )) +if (alps_rpt_cmd (ps2dev,PSMOUSE_CMD_SETRES ,PSMOUSE_CMD_SETSCALE11 , + param))return NULL ; psmouse_dbg(psmouse, "E6 report: %2.2x %2.2x %2.2x",
@@ -1037,15 +1045,8 @@ static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int* Now try "E7 report". Allowed responses are in * alps_model_data[].signature */ - param[0 ] =0 ; -if (ps2_command (ps2dev, param,PSMOUSE_CMD_SETRES ) || -ps2_command (ps2dev,NULL ,PSMOUSE_CMD_SETSCALE21 ) || -ps2_command (ps2dev,NULL ,PSMOUSE_CMD_SETSCALE21 ) || -ps2_command (ps2dev,NULL ,PSMOUSE_CMD_SETSCALE21 )) -return NULL ; - - param[0 ] = param[1 ] = param[2 ] =0xff ; -if (ps2_command (ps2dev, param,PSMOUSE_CMD_GETINFO )) +if (alps_rpt_cmd (ps2dev,PSMOUSE_CMD_SETRES ,PSMOUSE_CMD_SETSCALE21 , + param))return NULL ; psmouse_dbg(psmouse, "E7 report: %2.2x %2.2x %2.2x",
@@ -1140,10 +1141,7 @@ static int alps_get_status(struct psmouse *psmouse, char *param)struct ps2dev *ps2dev = &psmouse->ps2dev;/* Get status: 0xF5 0xF5 0xF5 0xE9 */ -if (ps2_command (ps2dev,NULL ,PSMOUSE_CMD_DISABLE ) || -ps2_command (ps2dev,NULL ,PSMOUSE_CMD_DISABLE ) || -ps2_command (ps2dev,NULL ,PSMOUSE_CMD_DISABLE ) || -ps2_command (ps2dev, param,PSMOUSE_CMD_GETINFO )) +if (alps_rpt_cmd (ps2dev,0 ,PSMOUSE_CMD_DISABLE , param))return -1 ; psmouse_dbg(psmouse, "Status: %2.2x %2.2x %2.2x",
Signature · 1 line
1.7.10.4
PATCH 2/3 Input: ALPS - Add code to support "Rushmore" touchpads
These touchpads mostly speak the V3 protocol, but they use a different method for detection. The manufacturer's driver follows a sequence that looks something like:
Send E7 query and look for an exact match: 73 03 50 ("Dolphin") If no match, send EC query and look for 88 {07,08} xx ("Pinnacle") If no match, send E7 query and look for 73 02 {0a,14,3c,50} ("Mercury II") If no match, send a more complicated query and look for 88 05 xx ("Mercury")
This patch adds the new EC query before the usual E7 query. It is presumed (hoped) that anything that isn't in the Pinnacle series will not return "88 07 xx" or "88 08 xx".
Tested on:
Dell E6230 ("Rushmore" model from the "Pinnacle" series) Dell E6430 (same as above, but with trackstick + more buttons)
On both PCs, the E7 report is 73 03 0a, and the EC report is 88 08 1d.
--- drivers/input/mouse/alps.c | 93 ++++++++++++++++++++++++++++++++++++++++---- drivers/input/mouse/alps.h | 6 +++ 2 files changed, 92 insertions(+), 7 deletions(-)
drivers/input/mouse/alps.c +86 -7
@@ -114,6 +114,10 @@ static const struct alps_model_info alps_model_data[] = { { { 0x73, 0x02, 0x64 }, 0x8a, ALPS_PROTO_V4, 0x8f, 0x8f, 0 }, }; +static const struct alps_model_info alps_model_rushmore = { + { ALPS_RUSHMORE }, 0x00, ALPS_PROTO_V3, 0x8f, 0x8f, ALPS_DUALPOINT +}; + /* * XXX - this entry is suspicious. First byte has zero lower nibble, * which is what a normal mouse would report. Also, the value 0x0e
@@ -393,7 +397,7 @@ static void alps_process_trackstick_packet_v3(struct psmouse *psmouse)struct alps_data *priv = psmouse->private;unsigned char *packet = psmouse->packet;struct input_dev *dev = priv->dev2; -int x, y, z, left, right, middle; +int x, y, z, left, right, middle, divisor =8 ;/* Sanity check packet */ if (!(packet[0 ] &0x40 )) {
@@ -408,17 +412,24 @@ static void alps_process_trackstick_packet_v3(struct psmouse *psmouse)if (packet[1 ] ==0x7f && packet[2 ] ==0x7f && packet[4 ] ==0x7f )return ; - x = (s8)(((packet[0 ] &0x20 ) <<2 ) | (packet[1 ] &0x7f )); - y = (s8)(((packet[0 ] &0x10 ) <<3 ) | (packet[2 ] &0x7f )); - z = (packet[4 ] &0x7c ) >>2 ; +if (priv->i->signature[0 ] ==ALPS_RUSHMORE ) { + x = (s8)(((packet[0 ] &0x20 ) <<2 ) | ((packet[1 ] <<1 ) &0x7f )); + y = (s8)(((packet[2 ] &0x10 ) <<3 ) | ((packet[4 ] <<1 ) &0x7f )); + z = (packet[4 ] &0x7c ) >>2 ; + divisor =2 ; + }else { + x = (s8)(((packet[0 ] &0x20 ) <<2 ) | (packet[1 ] &0x7f )); + y = (s8)(((packet[0 ] &0x10 ) <<3 ) | (packet[2 ] &0x7f )); + z = (packet[4 ] &0x7c ) >>2 ; + }/* * The x and y values tend to be quite large, and when used * alone the trackstick is difficult to use. Scale them down * to compensate. */ - x /=8 ; - y /=8 ; + x /= divisor; + y /= divisor;input_report_rel (dev,REL_X , x);input_report_rel (dev,REL_Y , -y);
@@ -996,7 +1007,7 @@ static int alps_enter_command_mode(struct psmouse *psmouse,return -1 ; } -if (param[0 ] !=0x88 && param[1 ] !=0x07 ) { +if (param[0 ] !=0x88 ) {psmouse_dbg (psmouse,"unknown response while entering command mode: %2.2x %2.2x %2.2x\n" , param[0 ], param[1 ], param[2 ]);
@@ -1016,6 +1027,34 @@ static inline int alps_exit_command_mode(struct psmouse *psmouse)return 0 ; } +static const struct alps_model_info *alps_probe_pinnacle ( +struct psmouse *psmouse,int *version) +{ +struct ps2dev *ps2dev = &psmouse->ps2dev; +unsigned char param[4 ]; +const struct alps_model_info *model =NULL ; + +if (alps_rpt_cmd (ps2dev,PSMOUSE_CMD_SETSTREAM ,PSMOUSE_CMD_RESET_WRAP , + param) || + param[0 ] !=0x88 || + (param[1 ] !=0x07 && param[1 ] !=0x08 )) + goto out; + +/* For now this code has only been verified to detect Rushmore */ +if (param[1 ] ==0x08 ) + model = &alps_model_rushmore; +else if (param[2 ] >=0x80 && param[2 ] <=0x8f ) +psmouse_info (psmouse,"detected Pinnacle AG via EC report\n" ); +else if (param[2 ] >=0x90 && param[2 ] <=0x9d ) +psmouse_info (psmouse,"detected Pinnacle AGx via EC report\n" ); +else if (param[2 ] <0x80 ) +psmouse_info (psmouse,"detected Pinnacle via EC report\n" ); + +out: +alps_exit_command_mode (psmouse); +return model; +} +static const struct alps_model_info *alps_get_model (struct psmouse *psmouse,int *version) {struct ps2dev *ps2dev = &psmouse->ps2dev;
@@ -1024,6 +1063,11 @@ static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, intconst struct alps_model_info *model =NULL ;int i; +/* Newer devices detect based on the EC report, not the E7 report */ + model =alps_probe_pinnacle (psmouse, version); +if (model) +return model; +/* * First try "E6 report". * ALPS should return 0,0,10 or 0,0,100 if no buttons are pressed.
@@ -1285,6 +1329,38 @@ static int alps_absolute_mode_v3(struct psmouse *psmouse)return 0 ; } +static int alps_hw_init_rushmore (struct psmouse *psmouse) +{ +struct ps2dev *ps2dev = &psmouse->ps2dev; +int reg_val, ret =-1 ; + +if (alps_command_mode_read_reg (psmouse,0xc2d9 ) ==-1 || +alps_command_mode_write_reg (psmouse,0xc2cb ,0x00 )) + goto error; + + reg_val =alps_command_mode_read_reg (psmouse,0xc2c6 ); +if (reg_val ==-1 ) + goto error; +if (__alps_command_mode_write_reg (psmouse, reg_val &0xfd )) + goto error; + +if (alps_command_mode_write_reg (psmouse,0xc2c9 ,0x64 )) + goto error; + + reg_val =alps_command_mode_read_reg (psmouse,0xc2c4 ); +if (reg_val ==-1 ) + goto error; +if (__alps_command_mode_write_reg (psmouse, reg_val |0x02 )) + goto error; + +alps_exit_command_mode (psmouse); +return ps2_command (ps2dev,NULL ,PSMOUSE_CMD_ENABLE ); + +error: +alps_exit_command_mode (psmouse); +return ret; +} +static int alps_hw_init_v3 (struct psmouse *psmouse) {struct alps_data *priv = psmouse->private;
@@ -1298,6 +1374,9 @@ static int alps_hw_init_v3(struct psmouse *psmouse)if (alps_enter_command_mode (psmouse,NULL )) goto error; +if (priv->i->signature[0 ] ==ALPS_RUSHMORE ) +return alps_hw_init_rushmore (psmouse); +/* Check for trackstick */ reg_val =alps_command_mode_read_reg (psmouse,0x0008 );if (reg_val ==-1 )
drivers/input/mouse/alps.h +6 -0
@@ -17,6 +17,12 @@#define ALPS_PROTO_V3 2#define ALPS_PROTO_V4 3 +/* These are in the same "Pinnacle" family but have different init sequences */ +#define ALPS_PIN 0x01 +#define ALPS_PINAG 0x02 +#define ALPS_PINAGX 0x03 +#define ALPS_RUSHMORE 0x04 +struct alps_model_info {unsigned char signature[3 ];unsigned char command_mode_resp;/* v3/v4 only */
Signature · 1 line
1.7.10.4
Re: [PATCH 2/3] Input: ALPS - Add code to support "Rushmore" touchpads
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Kevin" == Kevin Cernekee <[email protected]> writes:
Kevin> These touchpads mostly speak the V3 protocol, but they use a different Kevin> method for detection. The manufacturer's driver follows a sequence that Kevin> looks something like:
Kevin> Send E7 query and look for an exact match: 73 03 50 ("Dolphin")
Kevin> If no match, send EC query and look for 88 {07,08} xx ("Pinnacle")
Kevin> If no match, send E7 query and look for 73 02 {0a,14,3c,50} ("Mercury II")
Kevin> If no match, send a more complicated query and look for 88 05 xx ("Mercury")Kevin> This patch adds the new EC query before the usual E7 query. It is Kevin> presumed (hoped) that anything that isn't in the Pinnacle series will not Kevin> return "88 07 xx" or "88 08 xx".
Kevin> Tested on:
Kevin> Dell E6230 ("Rushmore" model from the "Pinnacle" series) Kevin> Dell E6430 (same as above, but with trackstick + more buttons)
Kevin> On both PCs, the E7 report is 73 03 0a, and the EC report is 88 08 1d.
Kevin> Signed-off-by: Kevin Cernekee <[email protected]>
Thanks. I've tested it here on a e6230 (bios rev 08), and it gets correctly detected (but twice?):
input: AlpsPS/2 ALPS DualPoint TouchPad as /devices/platform/i8042/serio1/input/input14
input: AlpsPS/2 ALPS DualPoint TouchPad as /devices/platform/i8042/serio1/input/input16
But the input events seem very noisy (E.G. the cursor jumps up and down if I keep my finger pressed on the touchpad). Especially the Y coordinate seems unstable:
Event: time 1359201123.864208, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 1042
Event: time 1359201123.864208, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 669
Event: time 1359201123.864208, type 3 (EV_ABS), code 0 (ABS_X), value 1042
Event: time 1359201123.864208, type 3 (EV_ABS), code 1 (ABS_Y), value 669
Event: time 1359201123.864208, -------------- SYN_REPORT ------------
Event: time 1359201123.874130, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 1043
Event: time 1359201123.874130, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 659
Event: time 1359201123.874130, type 3 (EV_ABS), code 0 (ABS_X), value 1043
Event: time 1359201123.874130, type 3 (EV_ABS), code 1 (ABS_Y), value 659
Event: time 1359201123.874130, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 32
Event: time 1359201123.874130, -------------- SYN_REPORT ------------
Event: time 1359201123.883495, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 1038
Event: time 1359201123.883495, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 660
Event: time 1359201123.883495, type 3 (EV_ABS), code 0 (ABS_X), value 1038
Event: time 1359201123.883495, type 3 (EV_ABS), code 1 (ABS_Y), value 660
Event: time 1359201123.883495, -------------- SYN_REPORT ------------
Event: time 1359201123.893641, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 1037
Event: time 1359201123.893641, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 655
Event: time 1359201123.893641, type 3 (EV_ABS), code 0 (ABS_X), value 1037
Event: time 1359201123.893641, type 3 (EV_ABS), code 1 (ABS_Y), value 655
Event: time 1359201123.893641, -------------- SYN_REPORT ------------
Event: time 1359201123.904044, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 1039
Event: time 1359201123.904044, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 651
Event: time 1359201123.904044, type 3 (EV_ABS), code 0 (ABS_X), value 1039
Event: time 1359201123.904044, type 3 (EV_ABS), code 1 (ABS_Y), value 651
Event: time 1359201123.904044, -------------- SYN_REPORT ------------
Event: time 1359201123.914023, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 1040
Event: time 1359201123.914023, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 645
Event: time 1359201123.914023, type 3 (EV_ABS), code 0 (ABS_X), value 1040
Event: time 1359201123.914023, type 3 (EV_ABS), code 1 (ABS_Y), value 645
Event: time 1359201123.914023, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 30
Event: time 1359201123.914023, -------------- SYN_REPORT ------------
Event: time 1359201123.924340, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 1035
Event: time 1359201123.924340, type 3 (EV_ABS), code 0 (ABS_X), value 1035
Event: time 1359201123.924340, -------------- SYN_REPORT ------------
Event: time 1359201123.934719, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 1040
Event: time 1359201123.934719, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 635
Event: time 1359201123.934719, type 3 (EV_ABS), code 0 (ABS_X), value 1040
Event: time 1359201123.934719, type 3 (EV_ABS), code 1 (ABS_Y), value 635
Event: time 1359201123.934719, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 29
Event: time 1359201123.934719, -------------- SYN_REPORT ------------
Event: time 1359201123.946719, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 1050
Event: time 1359201123.946719, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 665
Event: time 1359201123.946719, type 3 (EV_ABS), code 0 (ABS_X), value 1050
Event: time 1359201123.946719, type 3 (EV_ABS), code 1 (ABS_Y), value 665
Event: time 1359201123.946719, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 23
Any idea why? Do you see this as well?
Signature · 1 line
Bye, Peter Korsgaard
Re: [PATCH 2/3] Input: ALPS - Add code to support "Rushmore" touchpads
Quoted 5 lines · Peter Korsgaard
Thanks. I've tested it here on a e6230 (bios rev 08), and it gets correctly detected (but twice?):
input: AlpsPS/2 ALPS DualPoint TouchPad as /devices/platform/i8042/serio1/input/input14
input: AlpsPS/2 ALPS DualPoint TouchPad as /devices/platform/i8042/serio1/input/input16
It should show one input device for the trackstick, and one input device for the touchpad:
[397682.041027] input: DualPoint Stick as /devices/platform/i8042/serio1/input/input17 [397682.054959] input: AlpsPS/2 ALPS DualPoint TouchPad as
/devices/platform/i8042/serio1/input/input18
I'm not sure what would cause it to register two identical touchpads; I don't see that on either E6230 or E6430. Did you build psmouse.ko from my DKMS sources, or apply the patches on top of some other baseline?
Quoted 3 lines
But the input events seem very noisy (E.G. the cursor jumps up and down if I keep my finger pressed on the touchpad). Especially the Y coordinate seems unstable:
OK - I do see this on E6230 but not E6430. Normal usage is fine but the "pressed finger" test fails on E6230. I'll do some digging and try to figure out why.
In another thread [1] it was mentioned that the ALPS_BITMAP_* constants needed to be tweaked for the Rushmore touchpads. This might be related.
I also saw some "lost sync" errors in the kernel log on E6430 after running for a few days, but I don't know how to reproduce the issue. They did not seem to be associated with any obvious touchpad misbehavior.
[1] https://bugs.launchpad.net/ubuntu/+source/linux/+bug/606238
Re: [PATCH 2/3] Input: ALPS - Add code to support "Rushmore" touchpads
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Kevin" == Kevin Cernekee <[email protected]> writes:
Hi,
Kevin> It should show one input device for the trackstick, and one input Kevin> device for the touchpad:
Kevin> [397682.041027] input: DualPoint Stick as Kevin> /devices/platform/i8042/serio1/input/input17 Kevin> [397682.054959] input: AlpsPS/2 ALPS DualPoint TouchPad as Kevin> /devices/platform/i8042/serio1/input/input18
Hmm, odd - I rebooted and now it seems ok:
dmesg|egrep -i 'stick|alps'
input: DualPoint Stick as /devices/platform/i8042/serio1/input/input13
input: AlpsPS/2 ALPS DualPoint TouchPad as /devices/platform/i8042/serio1/input/input14
What is this trackstick thing?
Kevin> I'm not sure what would cause it to register two identical touchpads; Kevin> I don't see that on either E6230 or E6430. Did you build psmouse.ko Kevin> from my DKMS sources, or apply the patches on top of some other Kevin> baseline?
I applied the series on top of 3.7.4.
Quoted 3 lines
Quoted 3 lines
But the input events seem very noisy (E.G. the cursor jumps up and down if I keep my finger pressed on the touchpad). Especially the Y coordinate seems unstable:
Kevin> OK - I do see this on E6230 but not E6430. Normal usage is fine but Kevin> the "pressed finger" test fails on E6230. I'll do some digging and Kevin> try to figure out why.
Great, thanks! Let me know if you want me to test something.
Signature · 1 line
Bye, Peter Korsgaard
Re: [PATCH 2/3] Input: ALPS - Add code to support "Rushmore" touchpads
Quoted 5 lines · Peter Korsgaard
Hmm, odd - I rebooted and now it seems ok:
dmesg|egrep -i 'stick|alps'
input: DualPoint Stick as /devices/platform/i8042/serio1/input/input13
input: AlpsPS/2 ALPS DualPoint TouchPad as /devices/platform/i8042/serio1/input/input14
I hope this code does not fail intermittently...
Quoted 1 line
What is this trackstick thing?
On other laptops (e.g. Dell E6430) there is a trackstick on the keyboard between the G/H/B keys, and its reports are handled by the ALPS driver.
There was a suggestion in the launchpad.net thread to check a register bit to see if the trackstick is present, but it isn't yet clear whether this bit actually indicates the presence of the trackstick or if it just "happens" to be set on the units that have tracksticks.
My suggestion was to avoid registering the trackstick if we have a foolproof way of knowing it's missing, otherwise just register it unconditionally to be safe.
Re: [PATCH 2/3] Input: ALPS - Add code to support "Rushmore" touchpads
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Kevin" == Kevin Cernekee <[email protected]> writes:
Hi,
Kevin> I hope this code does not fail intermittently...
I'll run some more / do some more reboots and let you know.
Quoted 1 line
Quoted 1 line
What is this trackstick thing?
Kevin> On other laptops (e.g. Dell E6430) there is a trackstick on the Kevin> keyboard between the G/H/B keys, and its reports are handled by the Kevin> ALPS driver.
Kevin> There was a suggestion in the launchpad.net thread to check a register Kevin> bit to see if the trackstick is present, but it isn't yet clear Kevin> whether this bit actually indicates the presence of the trackstick or Kevin> if it just "happens" to be set on the units that have tracksticks.
Kevin> My suggestion was to avoid registering the trackstick if we have a Kevin> foolproof way of knowing it's missing, otherwise just register it Kevin> unconditionally to be safe.
yeah, seems like the safest approach.
Signature · 1 line
Bye, Peter Korsgaard
Re: [PATCH 2/3] Input: ALPS - Add code to support "Rushmore" touchpads
In reply to Peter KorsgaardQuoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Peter" == Peter Korsgaard <[email protected]> writes:
Hi,
Old thread, but I only now got time to upgrade to 3.9 and retest.
Peter> Thanks. I've tested it here on a e6230 (bios rev 08), and it gets Peter> correctly detected
Peter> But the input events seem very noisy (E.G. the cursor jumps up and down Peter> if I keep my finger pressed on the touchpad). Especially the Y Peter> coordinate seems unstable:
Peter> Event: time 1359201123.864208, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 1042 Peter> Event: time 1359201123.864208, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 669 Peter> Event: time 1359201123.864208, type 3 (EV_ABS), code 0 (ABS_X), value 1042 Peter> Event: time 1359201123.864208, type 3 (EV_ABS), code 1 (ABS_Y), value 669 Peter> Event: time 1359201123.864208, -------------- SYN_REPORT ------------ Peter> Event: time 1359201123.874130, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 1043 Peter> Event: time 1359201123.874130, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 659 Peter> Event: time 1359201123.874130, type 3 (EV_ABS), code 0 (ABS_X), value 1043 Peter> Event: time 1359201123.874130, type 3 (EV_ABS), code 1 (ABS_Y), value 659 Peter> Event: time 1359201123.874130, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 32 Peter> Event: time 1359201123.874130, -------------- SYN_REPORT ------------
I still see this noisy output with 3.9:
sudo evtest /dev/input/event16 ~
Input driver version is 1.0.1
Input device ID: bus 0x11 vendor 0x2 product 0x8 version 0x300 Input device name: "AlpsPS/2 ALPS GlidePoint" Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 272 (BTN_LEFT)
Event code 273 (BTN_RIGHT)
Event code 274 (BTN_MIDDLE)
Event code 325 (BTN_TOOL_FINGER)
Event code 330 (BTN_TOUCH)
Event code 333 (BTN_TOOL_DOUBLETAP)
Event code 334 (BTN_TOOL_TRIPLETAP)
Event code 335 (BTN_TOOL_QUADTAP)
Event type 3 (EV_ABS)
Event code 0 (ABS_X)
Value 363
Min 0
Max 2000
Event code 1 (ABS_Y)
Value 295
Min 0
Max 1400
Event code 24 (ABS_PRESSURE)
Value 0
Min 0
Max 127
Event code 47 (ABS_MT_SLOT)
Value 0
Min 0
Max 1
Event code 53 (ABS_MT_POSITION_X)
Value 0
Min 0
Max 2000
Event code 54 (ABS_MT_POSITION_Y)
Value 0
Min 0
Max 1400
Event code 57 (ABS_MT_TRACKING_ID)
Value 0
Min 0
Max 65535
Properties:
Property type 3 (INPUT_PROP_SEMI_MT)
Testing ... (interrupt to exit)
Event: time 1367868378.646499, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 1147
Event: time 1367868378.646499, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 855
Event: time 1367868378.646499, type 3 (EV_ABS), code 0 (ABS_X), value 1147
Event: time 1367868378.646499, type 3 (EV_ABS), code 1 (ABS_Y), value 855
Event: time 1367868378.646499, -------------- SYN_REPORT ------------
Event: time 1367868378.656671, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 1145
Event: time 1367868378.656671, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 858
Event: time 1367868378.656671, type 3 (EV_ABS), code 0 (ABS_X), value 1145
Event: time 1367868378.656671, type 3 (EV_ABS), code 1 (ABS_Y), value 858
Event: time 1367868378.656671, -------------- SYN_REPORT ------------
Event: time 1367868378.667997, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 1144
Event: time 1367868378.667997, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 853
Event: time 1367868378.667997, type 3 (EV_ABS), code 0 (ABS_X), value 1144
Event: time 1367868378.667997, type 3 (EV_ABS), code 1 (ABS_Y), value 853
Event: time 1367868378.667997, -------------- SYN_REPORT ------------
Event: time 1367868378.677139, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 1142
Event: time 1367868378.677139, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 851
Event: time 1367868378.677139, type 3 (EV_ABS), code 0 (ABS_X), value 1142
Event: time 1367868378.677139, type 3 (EV_ABS), code 1 (ABS_Y), value 851
Event: time 1367868378.677139, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 33
Event: time 1367868378.677139, -------------- SYN_REPORT ------------
Event: time 1367868378.687460, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 1140
Event: time 1367868378.687460, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 849
Event: time 1367868378.687460, type 3 (EV_ABS), code 0 (ABS_X), value 1140
Event: time 1367868378.687460, type 3 (EV_ABS), code 1 (ABS_Y), value 849
Event: time 1367868378.687460, -------------- SYN_REPORT ------------
Event: time 1367868378.697723, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 1138
Event: time 1367868378.697723, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 843
Event: time 1367868378.697723, type 3 (EV_ABS), code 0 (ABS_X), value 1138
Event: time 1367868378.697723, type 3 (EV_ABS), code 1 (ABS_Y), value 843
Event: time 1367868378.697723, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 32
This is with a single finger stadily on the touchpad. X/Y/Z all seem to move a bit around.
I added a few debug printks to alps.c and see that it correctly gets detected as a rushmore/v3:
ALPS touchpad: E7=73 03 0a, EC=88 08 1dalps_identify detected proto 3
This is the data sequence it generates:
alps decode af 46 2c 08 35 1b
alps decode 9f 46 2c 08 31 1b
alps decode 8f 46 2c 08 33 1b
alps decode 8f 46 2c 08 32 1b
alps decode 8f 46 2c 08 32 1b
alps decode bf 46 2c 08 25 1b
alps decode 9f 46 2c 08 32 1b
alps decode bf 46 2c 08 26 1b
alps decode 8f 46 2c 08 31 1b
alps decode 8f 46 2c 08 38 1b
alps decode 8f 46 2c 08 32 1c
alps decode 9f 46 2c 08 31 1c
alps decode bf 46 2c 08 30 1c
alps decode af 46 2c 08 36 1b
alps decode af 46 2c 08 35 1b
alps decode 9f 46 2c 08 35 1b
alps decode bf 46 2c 08 29 1b
alps decode 8f 46 2c 08 31 1c
alps decode 9f 46 2b 08 3e 1b
alps decode 9f 46 2c 08 38 1b
alps decode 9f 46 2c 08 32 1b
alps decode 9f 46 2c 08 35 1c
alps decode af 46 2c 08 37 1b
Is this expected behaviour? From a quick look at alps_decode_pinnacle() it looks sensible. Anything I can do to debug it further?
Signature · 1 line
Bye, Peter Korsgaard
PATCH 3/3 Input: ALPS - Detect Pinnacle AGx using EC report instead of E7 report
In reply to Kevin CernekeeThe E7 report output can be ambiguous for newer touchpads; the manufacturer's own drivers use the EC report instead, and check a wider range of IDs than what is in the current table. Implement similar behavior in alps.c.
Tested on Dell E6410 (E7 report: 73 02 64; EC report: 88 07 9d)
--- drivers/input/mouse/alps.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/input/mouse/alps.c +6 -4
@@ -109,8 +109,6 @@ static const struct alps_model_info alps_model_data[] = { { { 0x73, 0x02, 0x50 }, 0x00, ALPS_PROTO_V2, 0xcf, 0xcf, ALPS_FOUR_BUTTONS }, /* Dell Vostro 1400 */ { { 0x52, 0x01, 0x14 }, 0x00, ALPS_PROTO_V2, 0xff, 0xff, ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED }, /* Toshiba Tecra A11-11L */ - { { 0x73, 0x02, 0x64 }, 0x9b, ALPS_PROTO_V3, 0x8f, 0x8f, ALPS_DUALPOINT }, - { { 0x73, 0x02, 0x64 }, 0x9d, ALPS_PROTO_V3, 0x8f, 0x8f, ALPS_DUALPOINT }, { { 0x73, 0x02, 0x64 }, 0x8a, ALPS_PROTO_V4, 0x8f, 0x8f, 0 }, };
@@ -118,6 +116,10 @@ static const struct alps_model_info alps_model_rushmore = { { ALPS_RUSHMORE }, 0x00, ALPS_PROTO_V3, 0x8f, 0x8f, ALPS_DUALPOINT }; +static const struct alps_model_info alps_model_pinnacle_agx = { + {ALPS_PINAGX },0x00 ,ALPS_PROTO_V3 ,0x8f ,0x8f ,ALPS_DUALPOINT +}; +/* * XXX - this entry is suspicious. First byte has zero lower nibble, * which is what a normal mouse would report. Also, the value 0x0e
@@ -1040,13 +1042,13 @@ static const struct alps_model_info *alps_probe_pinnacle( (param[1] != 0x07 && param[1] != 0x08)) goto out; -/* For now this code has only been verified to detect Rushmore */ +/* This code has not been tested with Pinnacle AG or Pinnacle */ if (param[1 ] ==0x08 ) model = &alps_model_rushmore;else if (param[2 ] >=0x80 && param[2 ] <=0x8f )psmouse_info (psmouse,"detected Pinnacle AG via EC report\n" );else if (param[2 ] >=0x90 && param[2 ] <=0x9d ) -psmouse_info (psmouse,"detected Pinnacle AGx via EC report\n" ); + model = &alps_model_pinnacle_agx;else if (param[2 ] <0x80 )psmouse_info (psmouse,"detected Pinnacle via EC report\n" );
Signature · 1 line
1.7.10.4