From: Alex Chiang on
Hi Dmitry,

I just got a shiny new piece of hardware (HP Envy 15) with a
Synaptics touchpad, and I can't seem to make the touchpad work
correctly. In this version of the touchpad, there are actually
two physical buttons underneath the pad. In essence, this is a
touchpad that you can click too.

I can't get the clicking to work. Of course, I can tap to click,
but lacking access to the physical buttons means that I can't
right-click.

Currently, I'm not sure if this is a driver issue or perhaps
something higher up the stack, perhaps in X or maybe pilot error.
;)

Distro is Ubuntu Karmic, kernel is latest upstream last pulled on
13 Dec.

Would like some pointers on how to get started debugging.

Thanks,
/ac

dmesg snip:
Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
brd: module loaded
loop: module loaded
input: Macintosh mouse button emulation as /devices/virtual/input/input3
[...]
Synaptics Touchpad, model: 1, fw: 7.4, id: 0x1e0b1, caps: 0xd04771/0xe40000
input: SynPS/2 Synaptics TouchPad as /devices/platform/i8042/serio1/input/input10

/proc/bus/input/devices snip:
I: Bus=0017 Vendor=0001 Product=0001 Version=0100
N: Name="Macintosh mouse button emulation"
P: Phys=
S: Sysfs=/devices/virtual/input/input3
U: Uniq=
H: Handlers=mouse0 event3
B: EV=7
B: KEY=70000 0 0 0 0
B: REL=3

I: Bus=0011 Vendor=0002 Product=0007 Version=01b1
N: Name="SynPS/2 Synaptics TouchPad"
P: Phys=isa0060/serio1/input0
S: Sysfs=/devices/platform/i8042/serio1/input/input10
U: Uniq=
H: Handlers=mouse2 event10
B: EV=b
B: KEY=420 30000 0 0 0 0
B: ABS=11000003

xinput list snip:
"Macintosh mouse button emulation" id=9 [XExtensionPointer]
Type is MOUSE
Num_buttons is 5
Num_axes is 2
Mode is Relative
Motion_buffer is 256
Axis 0 :
Min_value is -1
Max_value is -1
Resolution is 1
Axis 1 :
Min_value is -1
Max_value is -1
Resolution is 1
"SynPS/2 Synaptics TouchPad" id=10 [XExtensionPointer]
Type is TOUCHPAD
Num_buttons is 12
Num_axes is 2
Mode is Relative
Motion_buffer is 256
Axis 0 :
Min_value is 1472
Max_value is 5472
Resolution is 1
Axis 1 :
Min_value is 1408
Max_value is 4448
Resolution is 1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Dmitry Torokhov on
Hi Alex,

On Sun, Dec 13, 2009 at 06:48:28PM -0700, Alex Chiang wrote:
> Hi Dmitry,
>
> I just got a shiny new piece of hardware (HP Envy 15) with a
> Synaptics touchpad, and I can't seem to make the touchpad work
> correctly. In this version of the touchpad, there are actually
> two physical buttons underneath the pad. In essence, this is a
> touchpad that you can click too.
>
> I can't get the clicking to work. Of course, I can tap to click,
> but lacking access to the physical buttons means that I can't
> right-click.
>
> Currently, I'm not sure if this is a driver issue or perhaps
> something higher up the stack, perhaps in X or maybe pilot error.
> ;)
>
> Distro is Ubuntu Karmic, kernel is latest upstream last pulled on
> 13 Dec.
>
> Would like some pointers on how to get started debugging.
>
> Thanks,
> /ac
>
> dmesg snip:
> Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
> brd: module loaded
> loop: module loaded
> input: Macintosh mouse button emulation as /devices/virtual/input/input3
> [...]
> Synaptics Touchpad, model: 1, fw: 7.4, id: 0x1e0b1, caps: 0xd04771/0xe40000
> input: SynPS/2 Synaptics TouchPad as /devices/platform/i8042/serio1/input/input10
>

Hmm, that's the new Synaptics "clickpad"... Takashi Iwai just posted a
coupleof patches for it on the input mailing list.

--
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Alex Chiang on
Hi Dmitry, Takashi,

* Dmitry Torokhov <dmitry.torokhov(a)gmail.com>:
> Hi Alex,
>
> On Sun, Dec 13, 2009 at 06:48:28PM -0700, Alex Chiang wrote:
> > Hi Dmitry,
> >
> > I just got a shiny new piece of hardware (HP Envy 15) with a
> > Synaptics touchpad, and I can't seem to make the touchpad work
> > correctly. In this version of the touchpad, there are actually
> > two physical buttons underneath the pad. In essence, this is a
> > touchpad that you can click too.
> >
> > I can't get the clicking to work. Of course, I can tap to click,
> > but lacking access to the physical buttons means that I can't
> > right-click.
> >
> > Currently, I'm not sure if this is a driver issue or perhaps
> > something higher up the stack, perhaps in X or maybe pilot error.
> > ;)
> >
> > Distro is Ubuntu Karmic, kernel is latest upstream last pulled on
> > 13 Dec.
> >
> > Would like some pointers on how to get started debugging.
> >
> > Thanks,
> > /ac
> >
> > dmesg snip:
> > Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
> > brd: module loaded
> > loop: module loaded
> > input: Macintosh mouse button emulation as /devices/virtual/input/input3
> > [...]
> > Synaptics Touchpad, model: 1, fw: 7.4, id: 0x1e0b1, caps: 0xd04771/0xe40000
> > input: SynPS/2 Synaptics TouchPad as /devices/platform/i8042/serio1/input/input10
> >
>
> Hmm, that's the new Synaptics "clickpad"... Takashi Iwai just posted a
> coupleof patches for it on the input mailing list.

I can't respond to that thread directly because I'm not a
subscriber and can't find the message-id, so just responding
here.

Thanks, I did grab Takashi's patches and verify that they work
for me. I tested the separated patches, not the v2 combined
patch, although it doesn't make any difference based on visual
inspection of v2.

If you want, you can add my:

Tested-by: Alex Chiang <achiang(a)hp.com>

Thanks!
/ac

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Takashi Iwai on
At Mon, 14 Dec 2009 22:26:28 -0800,
Dmitry Torokhov wrote:
>
> [1 <text/plain; us-ascii (7bit)>]
> Hi Alex,
>
> On Mon, Dec 14, 2009 at 08:41:27PM -0700, Alex Chiang wrote:
> >
> > Thanks, I did grab Takashi's patches and verify that they work
> > for me. I tested the separated patches, not the v2 combined
> > patch, although it doesn't make any difference based on visual
> > inspection of v2.
> >
> > If you want, you can add my:
> >
> > Tested-by: Alex Chiang <achiang(a)hp.com>
>
> Thank you very much for testing, however could you please try a slightly
> different patch below (I did not quite like that the original patch
> mangled device's capability field and how it was reusing 'middle' field
> for different things)? It should apply on top of patch that
> I am attaching. I hope I did not screw it up too much,

I can't test the patch right now since I'm at home, but I'm afraid
it's a bit different behavior. Namely,

> @@ -330,20 +339,52 @@ static void synaptics_parse_new_hw(unsigned char buf[],
> struct synaptics_data *priv,
> struct synaptics_hw_state *hw)
> {
> - hw->x = (((buf[3] & 0x10) << 8) | ((buf[1] & 0x0f) << 8) | buf[4]);
> - hw->y = (((buf[3] & 0x20) << 7) | ((buf[1] & 0xf0) << 4) | buf[5]);
> + int x = (((buf[3] & 0x10) << 8) | ((buf[1] & 0x0f) << 8) | buf[4]);
> + int y = (((buf[3] & 0x20) << 7) | ((buf[1] & 0xf0) << 4) | buf[5]);
>
> hw->z = buf[2];
> hw->w = (((buf[0] & 0x30) >> 2) |
> ((buf[0] & 0x04) >> 1) |
> ((buf[3] & 0x04) >> 2));
>
> - hw->left = buf[0] & 0x01;
> - hw->right = buf[0] & 0x02;
> + if (SYN_CAP_CLICKPAD(priv->ext_cap)) {
> + int click = (buf[0] ^ buf[3]) & 0x01;
> +
> + if (click && y < YMIN_NOMINAL) {
> + /*
> + * User pressed in ClickZone; report new button
> + * state but use old coordinates and don't report
> + * any pressure to prevent pointer movement.
> + */
> + hw->left = x < CLICKPAD_LEFT_BTN_X;
> + hw->right = x > CLICKPAD_RIGHT_BTN_X;
> + hw->middle = x >= CLICKPAD_LEFT_BTN_X &&
> + x <= CLICKPAD_RIGHT_BTN_X;
> + hw->z = 0;
> +
> + } else {
> + /*
> + * Finger is outside of the ClickZone - report
> + * current coordinates.
> + */
> + hw->x = x;
> + hw->y = y;
> +
> + if (!click)
> + hw->left = hw->right = hw->middle = 0;
> + }

Here, when you touch outside the button area, left/right/middle are
always zero because hw was initialized. So the above code gives the
click "released" state outside the button area.

In my original patch, the button states are kept. This makes the
second touch while pressing the pad as dragging. Since the button
choice is done by the first touch, you can't determine the button
position by the current touch. Thus, remembering the last button
states is mandatory for ClickZone mode.


thanks,

Takashi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Dmitry Torokhov on
On Tue, Dec 15, 2009 at 07:40:55AM +0100, Takashi Iwai wrote:
> At Mon, 14 Dec 2009 22:26:28 -0800,
> Dmitry Torokhov wrote:
> >
> > [1 <text/plain; us-ascii (7bit)>]
> > Hi Alex,
> >
> > On Mon, Dec 14, 2009 at 08:41:27PM -0700, Alex Chiang wrote:
> > >
> > > Thanks, I did grab Takashi's patches and verify that they work
> > > for me. I tested the separated patches, not the v2 combined
> > > patch, although it doesn't make any difference based on visual
> > > inspection of v2.
> > >
> > > If you want, you can add my:
> > >
> > > Tested-by: Alex Chiang <achiang(a)hp.com>
> >
> > Thank you very much for testing, however could you please try a slightly
> > different patch below (I did not quite like that the original patch
> > mangled device's capability field and how it was reusing 'middle' field
> > for different things)? It should apply on top of patch that
> > I am attaching. I hope I did not screw it up too much,
>
> I can't test the patch right now since I'm at home, but I'm afraid
> it's a bit different behavior. Namely,
>
> > @@ -330,20 +339,52 @@ static void synaptics_parse_new_hw(unsigned char buf[],
> > struct synaptics_data *priv,
> > struct synaptics_hw_state *hw)
> > {
> > - hw->x = (((buf[3] & 0x10) << 8) | ((buf[1] & 0x0f) << 8) | buf[4]);
> > - hw->y = (((buf[3] & 0x20) << 7) | ((buf[1] & 0xf0) << 4) | buf[5]);
> > + int x = (((buf[3] & 0x10) << 8) | ((buf[1] & 0x0f) << 8) | buf[4]);
> > + int y = (((buf[3] & 0x20) << 7) | ((buf[1] & 0xf0) << 4) | buf[5]);
> >
> > hw->z = buf[2];
> > hw->w = (((buf[0] & 0x30) >> 2) |
> > ((buf[0] & 0x04) >> 1) |
> > ((buf[3] & 0x04) >> 2));
> >
> > - hw->left = buf[0] & 0x01;
> > - hw->right = buf[0] & 0x02;
> > + if (SYN_CAP_CLICKPAD(priv->ext_cap)) {
> > + int click = (buf[0] ^ buf[3]) & 0x01;
> > +
> > + if (click && y < YMIN_NOMINAL) {
> > + /*
> > + * User pressed in ClickZone; report new button
> > + * state but use old coordinates and don't report
> > + * any pressure to prevent pointer movement.
> > + */
> > + hw->left = x < CLICKPAD_LEFT_BTN_X;
> > + hw->right = x > CLICKPAD_RIGHT_BTN_X;
> > + hw->middle = x >= CLICKPAD_LEFT_BTN_X &&
> > + x <= CLICKPAD_RIGHT_BTN_X;
> > + hw->z = 0;
> > +
> > + } else {
> > + /*
> > + * Finger is outside of the ClickZone - report
> > + * current coordinates.
> > + */
> > + hw->x = x;
> > + hw->y = y;
> > +
> > + if (!click)
> > + hw->left = hw->right = hw->middle = 0;
> > + }
>
> Here, when you touch outside the button area, left/right/middle are
> always zero because hw was initialized. So the above code gives the
> click "released" state outside the button area.
>

No, I got rid of resetting hw state to 0.

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