Re: Synaptics touchpad misdetected as clickpad [with patch]

2015-03-04 Thread Rhialto
On Tue 03 Mar 2015 at 02:30:47 +, Christos Zoulas wrote:
 In article 20150303004630.gh6...@falu.nl, Rhialto  rhia...@falu.nl wrote:
 -=-=-=-=-=-
 
 and no click pad. Which is isn't. It has 2 separate buttons below the
 touchpad. Attaching an usb mouse serves as a workaround.
 
 Any other info I can give?
 
 You can turn debugging on and it will print more info...

Ok, I enabled SYNAPTICSDEBUG and booted with -x.
The kernel messages are now like so:


pms0 at pckbc1 (aux slot)
pms0: Synaptics touchpad version 6.5
pms0: synaptics_probe: Capabilities 0xa051.
pms0: pms_synaptics_probe_extended: Extended Buttons: 0.
pms0: pms_synaptics_probe_extended: Extended Capabilities: 0xa0 0x00 0x00.
pms0: pms_synaptics_probe_extended: Continued Capabilities 0x0f 0xf1 0x40.
pms0: Palm detect, One button click pad

Looking at the code which prints this, in
src/sys/dev/pckbport/synaptics.c, function
pms_synaptics_probe_extended(),

 191 /* Ask about click pad */
 192 if (((sc-caps  SYNAPTICS_CAP_EXTNUM) + 0x08) =
 193 SYNAPTICS_CONTINUED_CAPABILITIES)
 194 {
 195 res = pms_sliced_command(psc-sc_kbctag,
 196 psc-sc_kbcslot, SYNAPTICS_CONTINUED_CAPABILITIES);
 197 cmd[0] = PMS_SEND_DEV_STATUS;
 198 res |= pckbport_poll_cmd(psc-sc_kbctag,
 199 psc-sc_kbcslot, cmd, 1, 3, resp, 0);
 200 if (res == 0) {
 201 u_char clickpad_type = (resp[1]  0x1);
 202 clickpad_type |= ((resp[0]  4)  0x1);
 203 
 204 aprint_debug_dev(psc-sc_dev, %s: Continued 
 205 Capabilities 0x%02x 0x%02x 0x%02x.\n, 
__func_ _,
 206 resp[0], resp[1], resp[2]);
 207 switch (clickpad_type) {
 208 case 1:
 209 sc-flags |= 
SYN_FLAG_HAS_ONE_BUTTON_CLICKP AD;
 210 break;
 211 case 2:
 212 sc-flags |= 
SYN_FLAG_HAS_TWO_BUTTON_CLICKP AD;
 213 break;
 214 default:
 215 break;
 216 }
 217 }
 218 }

I have to wonder how case 2 can ever be reached, given the
initialisation of clickpad_type. This smells like there is something
incorrect here with clickpad_type.

If I look at what Linux does, in 
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/input/mouse/synaptics.h?id=refs/tags/v4.0-rc2
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/input/mouse/synaptics.c?id=refs/tags/v4.0-rc2

then

/*
 * The following describes response for the 0x0c query.
 *
 * byte masknamemeaning
 *  --- 
 * 10x01adjustable thresholdcapacitive button sensitivity
 *  can be adjusted
 * 10x02report max  query 0x0d gives max coord reported
 * 10x04clearpadsensor is ClearPad product
 * 10x08advanced gesturenot particularly meaningful
 * 10x10clickpad bit 0  1-button ClickPad
 * 10x60multifinger modeidentifies firmware finger counting
 *  (not reporting!) algorithm.
 *  Not particularly meaningful
 * 10x80covered pad W clipped to 14, 15 == pad mostly 
covered
 * 20x01clickpad bit 1  2-button ClickPad
 * 20x02deluxe LED controls touchpad support LED commands
 *  ala multimedia control bar
 * 20x04reduced filtering   firmware does less filtering on
 *  position data, driver should watch
 *  for noise.
 * 20x08image sensorimage sensor tracks 5 fingers, but only
 *  reports 2.
 * 20x01uniform clickpadwhole clickpad moves instead of being
 *  hinged at the top.
 * 20x20report min  query 0x0f gives min coord reported
 */
#define SYN_CAP_CLICKPAD(ex0c)  ((ex0c)  0x10) /* 1-button 
ClickPad */
#define SYN_CAP_CLICKPAD2BTN(ex0c)  ((ex0c)  0x000100) /* 2-button 
ClickPad */

and

if (SYN_EXT_CAP_REQUESTS(priv-capabilities) = 4) {
if (synaptics_send_cmd(psmouse, SYN_QUE_EXT_CAPAB_0C, cap)) {
psmouse_warn(psmouse,
 device claims to have extended capability 0x0c, but I'm 
not able to read it.\n);
} else {
priv-ext_cap_0c = (cap[0]  16) | (cap[1]  8) | cap[2];
}
}

I tried this patch:


Index: synaptics.c

Re: Synaptics touchpad misdetected as clickpad [with patch]

2015-03-04 Thread Christos Zoulas
In article 20150304214425.gi20...@falu.nl, Rhialto  rhia...@falu.nl wrote:
-=-=-=-=-=-

On Tue 03 Mar 2015 at 02:30:47 +, Christos Zoulas wrote:
 In article 20150303004630.gh6...@falu.nl, Rhialto  rhia...@falu.nl wrote:
 -=-=-=-=-=-
 
 and no click pad. Which is isn't. It has 2 separate buttons below the
 touchpad. Attaching an usb mouse serves as a workaround.
 
 Any other info I can give?
 
 You can turn debugging on and it will print more info...

Ok, I enabled SYNAPTICSDEBUG and booted with -x.
The kernel messages are now like so:


pms0 at pckbc1 (aux slot)
pms0: Synaptics touchpad version 6.5
pms0: synaptics_probe: Capabilities 0xa051.
pms0: pms_synaptics_probe_extended: Extended Buttons: 0.
pms0: pms_synaptics_probe_extended: Extended Capabilities: 0xa0 0x00 0x00.
pms0: pms_synaptics_probe_extended: Continued Capabilities 0x0f 0xf1 0x40.
pms0: Palm detect, One button click pad

Looking at the code which prints this, in
src/sys/dev/pckbport/synaptics.c, function
pms_synaptics_probe_extended(),

 191 /* Ask about click pad */
 192 if (((sc-caps  SYNAPTICS_CAP_EXTNUM) + 0x08) =
 193 SYNAPTICS_CONTINUED_CAPABILITIES)
 194 {
 195 res = pms_sliced_command(psc-sc_kbctag,
 196 psc-sc_kbcslot, SYNAPTICS_CONTINUED_CAPABILITIES);
 197 cmd[0] = PMS_SEND_DEV_STATUS;
 198 res |= pckbport_poll_cmd(psc-sc_kbctag,
 199 psc-sc_kbcslot, cmd, 1, 3, resp, 0);
 200 if (res == 0) {
 201 u_char clickpad_type = (resp[1]  0x1);
 202 clickpad_type |= ((resp[0]  4)  0x1);
 203 
 204 aprint_debug_dev(psc-sc_dev, %s: Continued 
 205 Capabilities 0x%02x 0x%02x 0x%02x.\n,
__func_ _,
 206 resp[0], resp[1], resp[2]);
 207 switch (clickpad_type) {
 208 case 1:
 209 sc-flags |=
SYN_FLAG_HAS_ONE_BUTTON_CLICKP AD;
 210 break;
 211 case 2:
 212 sc-flags |=
SYN_FLAG_HAS_TWO_BUTTON_CLICKP AD;
 213 break;
 214 default:
 215 break;
 216 }
 217 }
 218 }

I have to wonder how case 2 can ever be reached, given the
initialisation of clickpad_type. This smells like there is something
incorrect here with clickpad_type.

If I look at what Linux does, in 
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/input/mouse/synaptics.h?id=refs/tags/v4.0-rc2
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/input/mouse/synaptics.c?id=refs/tags/v4.0-rc2

then

/*
 * The following describes response for the 0x0c query.
 *
 * bytemasknamemeaning
 * --- 
 * 1   0x01adjustable thresholdcapacitive button sensitivity
 * can be adjusted
 * 1   0x02report max  query 0x0d gives max coord reported
 * 1   0x04clearpadsensor is ClearPad product
 * 1   0x08advanced gesturenot particularly meaningful
 * 1   0x10clickpad bit 0  1-button ClickPad
 * 1   0x60multifinger modeidentifies firmware finger counting
 * (not reporting!) algorithm.
 * Not particularly meaningful
 * 1   0x80covered pad W clipped to 14, 15 == pad mostly 
 covered
 * 2   0x01clickpad bit 1  2-button ClickPad
 * 2   0x02deluxe LED controls touchpad support LED commands
 * ala multimedia control bar
 * 2   0x04reduced filtering   firmware does less filtering on
 * position data, driver should watch
 * for noise.
 * 2   0x08image sensorimage sensor tracks 5 fingers, but only
 * reports 2.
 * 2   0x01uniform clickpadwhole clickpad moves instead of being
 * hinged at the top.
 * 2   0x20report min  query 0x0f gives min coord reported
 */
#define SYN_CAP_CLICKPAD(ex0c) ((ex0c)  0x10) /* 1-button 
ClickPad */
#define SYN_CAP_CLICKPAD2BTN(ex0c) ((ex0c)  0x000100) /* 2-button 
ClickPad */

and

if (SYN_EXT_CAP_REQUESTS(priv-capabilities) = 4) {
   if (synaptics_send_cmd(psmouse, SYN_QUE_EXT_CAPAB_0C, cap)) {
   psmouse_warn(psmouse,
device claims to have extended capability 0x0c, but I'm 
 not able
to read it.\n);
   } else {
   priv-ext_cap_0c = (cap[0]  16) | (cap[1]  8) | cap[2];
   

Re: Synaptics touchpad misdetected as clickpad [with patch]

2015-03-04 Thread Rhialto
On Wed 04 Mar 2015 at 22:16:28 +, Christos Zoulas wrote:
 Sure why don't you send a full patch that also has the above comment
 reproduced...

Here it is. I adjusted the comment to zero-based.
I also gave it a quick test and worked the same as the previous patch.

Index: synaptics.c
===
RCS file: /cvsroot/src/sys/dev/pckbport/synaptics.c,v
retrieving revision 1.32
diff -u -r1.32 synaptics.c
--- synaptics.c 23 May 2014 01:11:29 -  1.32
+++ synaptics.c 4 Mar 2015 22:42:41 -
@@ -197,18 +197,46 @@
cmd[0] = PMS_SEND_DEV_STATUS;
res |= pckbport_poll_cmd(psc-sc_kbctag,
psc-sc_kbcslot, cmd, 1, 3, resp, 0);
+/*
+ * The following describes response for the
+ * SYNAPTICS_CONTINUED_CAPABILITIES query.
+ *
+ * bytemasknamemeaning
+ * --- 
+ * 0   0x01adjustable thresholdcapacitive button sensitivity
+ * can be adjusted
+ * 0   0x02report max  query 0x0d gives max coord reported
+ * 0   0x04clearpadsensor is ClearPad product
+ * 0   0x08advanced gesturenot particularly meaningful
+ * 0   0x10clickpad bit 0  1-button ClickPad
+ * 0   0x60multifinger modeidentifies firmware finger counting
+ * (not reporting!) algorithm.
+ * Not particularly meaningful
+ * 0   0x80covered pad W clipped to 14, 15 == pad mostly 
covered
+ * 1   0x01clickpad bit 1  2-button ClickPad
+ * 1   0x02deluxe LED controls touchpad support LED commands
+ * ala multimedia control bar
+ * 1   0x04reduced filtering   firmware does less filtering on
+ * position data, driver should watch
+ * for noise.
+ * 1   0x08image sensorimage sensor tracks 5 fingers, but only
+ * reports 2.
+ * 1   0x01uniform clickpadwhole clickpad moves instead of being
+ * hinged at the top.
+ * 1   0x20report min  query 0x0f gives min coord reported
+ */
if (res == 0) {
-   u_char clickpad_type = (resp[1]  0x1);
-   clickpad_type |= ((resp[0]  4)  0x1);
+   u_char clickpad_type = (resp[0]  0x10);
+   clickpad_type |=   (resp[1]  0x01);
 
aprint_debug_dev(psc-sc_dev, %s: Continued 
Capabilities 0x%02x 0x%02x 0x%02x.\n, __func__,
resp[0], resp[1], resp[2]);
switch (clickpad_type) {
-   case 1:
+   case 0x10:
sc-flags |= SYN_FLAG_HAS_ONE_BUTTON_CLICKPAD;
break;
-   case 2:
+   case 0x01:
sc-flags |= SYN_FLAG_HAS_TWO_BUTTON_CLICKPAD;
break;
default:
 christos
-Olaf.
-- 
___ Olaf 'Rhialto' Seibert  -- The Doctor: No, 'eureka' is Greek for
\X/ rhialto/at/xs4all.nl-- 'this bath is too hot.'


pgp6uCYs32UG2.pgp
Description: PGP signature


Re: Synaptics touchpad misdetected as clickpad [with patch]

2015-03-04 Thread Christos Zoulas
On Mar 4, 11:55pm, rhia...@falu.nl (Rhialto) wrote:
-- Subject: Re: Synaptics touchpad misdetected as clickpad [with patch]

| Here it is. I adjusted the comment to zero-based.
| I also gave it a quick test and worked the same as the previous patch.

Thanks, committed!

christos


Synaptics touchpad misdetected as clickpad

2015-03-02 Thread Rhialto
I just tried a self-built fresh -current on my laptop to see how the
graphics support is coming along.

X works fine, so far, with the programs that come included in the live
image, but I noticed that the left of the 2 buttons of my touchpad
doesn't work any more.

pms0 at pckbc1 (aux slot)
pms0: Synaptics touchpad version 6.5 
pms0: Palm detect, One button click pad
pckbc1: using irq 12 for aux slot
wsmouse0 at pms0 mux 0

It used to be detected as 

pms0 at pckbc1 (aux slot)
pms0: Synaptics touchpad version 6.5
pms0: Palm detect
pckbc1: using irq 12 for aux slot
wsmouse0 at pms0 mux 0

and no click pad. Which is isn't. It has 2 separate buttons below the
touchpad. Attaching an usb mouse serves as a workaround.

Any other info I can give?

-Olaf.
-- 
___ Olaf 'Rhialto' Seibert  -- The Doctor: No, 'eureka' is Greek for
\X/ rhialto/at/xs4all.nl-- 'this bath is too hot.'


pgpKD8VsFFg30.pgp
Description: PGP signature


Re: Synaptics touchpad misdetected as clickpad

2015-03-02 Thread Christos Zoulas
In article 20150303004630.gh6...@falu.nl, Rhialto  rhia...@falu.nl wrote:
-=-=-=-=-=-

I just tried a self-built fresh -current on my laptop to see how the
graphics support is coming along.

X works fine, so far, with the programs that come included in the live
image, but I noticed that the left of the 2 buttons of my touchpad
doesn't work any more.

pms0 at pckbc1 (aux slot)
pms0: Synaptics touchpad version 6.5 
pms0: Palm detect, One button click pad
pckbc1: using irq 12 for aux slot
wsmouse0 at pms0 mux 0

It used to be detected as 

pms0 at pckbc1 (aux slot)
pms0: Synaptics touchpad version 6.5
pms0: Palm detect
pckbc1: using irq 12 for aux slot
wsmouse0 at pms0 mux 0

and no click pad. Which is isn't. It has 2 separate buttons below the
touchpad. Attaching an usb mouse serves as a workaround.

Any other info I can give?

You can turn debugging on and it will print more info...

christos