Input: ALPS - Detect trackstick presence for v7 protocol
diff mbox

Message ID 1427031971-13018-1-git-send-email-pali.rohar@gmail.com
State Accepted
Headers show

Commit Message

Pali Rohár March 22, 2015, 1:46 p.m. UTC
This patch adds detection of trackstick for v7 protocol devices. Code in this
patch is used in official Dell touchpad linux drivers for Dell models:
Dell Latitude E5250/5250, E5450/5450, E5550/5550

Detection code and base reg for alps v3 rushmore and v7 devices is exacly same.

Also user in bug https://bugzilla.kernel.org/show_bug.cgi?id=94801 reported
that Toshiba Sattellite Z30-A-1DG has only alps v7 touchpad device without
trackstick and kernel reports to userspace also redundant trackstick device.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
---
 drivers/input/mouse/alps.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

Comments

Hans de Goede March 23, 2015, 11:39 a.m. UTC | #1
Hi,

On 22-03-15 14:46, Pali Rohár wrote:
> This patch adds detection of trackstick for v7 protocol devices. Code in this
> patch is used in official Dell touchpad linux drivers for Dell models:
> Dell Latitude E5250/5250, E5450/5450, E5550/5550
>
> Detection code and base reg for alps v3 rushmore and v7 devices is exacly same.
>
> Also user in bug https://bugzilla.kernel.org/show_bug.cgi?id=94801 reported
> that Toshiba Sattellite Z30-A-1DG has only alps v7 touchpad device without
> trackstick and kernel reports to userspace also redundant trackstick device.
>
> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>

Looks good, but has this been tested on a laptop which actually has a v7 pad +
trackstick? I would like to see this actually tested on at least one such
laptop before it gets merged.

Regards,

Hans



> ---
>   drivers/input/mouse/alps.c |   12 ++++++++----
>   1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
> index 33198b9..c9cd27a 100644
> --- a/drivers/input/mouse/alps.c
> +++ b/drivers/input/mouse/alps.c
> @@ -30,6 +30,7 @@
>   #define ALPS_CMD_NIBBLE_10	0x01f2
>
>   #define ALPS_REG_BASE_RUSHMORE	0xc2c0
> +#define ALPS_REG_BASE_V7	0xc2c0
>   #define ALPS_REG_BASE_PINNACLE	0x0000
>
>   static const struct alps_nibble_commands alps_v3_nibble_commands[] = {
> @@ -1795,7 +1796,7 @@ static int alps_absolute_mode_v3(struct psmouse *psmouse)
>   	return 0;
>   }
>
> -static int alps_probe_trackstick_v3(struct psmouse *psmouse, int reg_base)
> +static int alps_probe_trackstick_v3_v7(struct psmouse *psmouse, int reg_base)
>   {
>   	int ret = -EIO, reg_val;
>
> @@ -1880,7 +1881,7 @@ static int alps_hw_init_v3(struct psmouse *psmouse)
>   	int reg_val;
>   	unsigned char param[4];
>
> -	reg_val = alps_probe_trackstick_v3(psmouse, ALPS_REG_BASE_PINNACLE);
> +	reg_val = alps_probe_trackstick_v3_v7(psmouse, ALPS_REG_BASE_PINNACLE);
>   	if (reg_val == -EIO)
>   		goto error;
>
> @@ -2260,8 +2261,8 @@ static int alps_set_protocol(struct psmouse *psmouse,
>   		priv->x_bits = 16;
>   		priv->y_bits = 12;
>
> -		if (alps_probe_trackstick_v3(psmouse,
> -					     ALPS_REG_BASE_RUSHMORE) < 0)
> +		if (alps_probe_trackstick_v3_v7(psmouse,
> +						ALPS_REG_BASE_RUSHMORE) < 0)
>   			priv->flags &= ~ALPS_DUALPOINT;
>
>   		break;
> @@ -2311,6 +2312,9 @@ static int alps_set_protocol(struct psmouse *psmouse,
>   		if (priv->fw_ver[1] != 0xba)
>   			priv->flags |= ALPS_BUTTONPAD;
>
> +		if (alps_probe_trackstick_v3_v7(psmouse, ALPS_REG_BASE_V7) < 0)
> +			priv->flags &= ~ALPS_DUALPOINT;
> +
>   		break;
>   	}
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Pali Rohár March 23, 2015, 5:02 p.m. UTC | #2
On Monday 23 March 2015 12:39:48 Hans de Goede wrote:
> Hi,
> 
> On 22-03-15 14:46, Pali Rohár wrote:
> > This patch adds detection of trackstick for v7 protocol
> > devices. Code in this patch is used in official Dell
> > touchpad linux drivers for Dell models: Dell Latitude
> > E5250/5250, E5450/5450, E5550/5550
> > 
> > Detection code and base reg for alps v3 rushmore and v7
> > devices is exacly same.
> > 
> > Also user in bug
> > https://bugzilla.kernel.org/show_bug.cgi?id=94801 reported
> > that Toshiba Sattellite Z30-A-1DG has only alps v7 touchpad
> > device without trackstick and kernel reports to userspace
> > also redundant trackstick device.
> > 
> > Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> 
> Looks good, but has this been tested on a laptop which
> actually has a v7 pad + trackstick? I would like to see this
> actually tested on at least one such laptop before it gets
> merged.
> 
> Regards,
> 
> Hans
> 

I did not tested my patch on any v7 touchpad-only laptop.

But I guess Dell should have tested it... Of course we can wait 
until somebody test this patch and after that we will merge it.

@Santiago: Can you test this patch? You also have v7 touchpad 
only laptop (without trackstick).
Hans de Goede March 24, 2015, 7:27 a.m. UTC | #3
Hi,

On 23-03-15 18:02, Pali Rohár wrote:
> On Monday 23 March 2015 12:39:48 Hans de Goede wrote:
>> Hi,
>>
>> On 22-03-15 14:46, Pali Rohár wrote:
>>> This patch adds detection of trackstick for v7 protocol
>>> devices. Code in this patch is used in official Dell
>>> touchpad linux drivers for Dell models: Dell Latitude
>>> E5250/5250, E5450/5450, E5550/5550
>>>
>>> Detection code and base reg for alps v3 rushmore and v7
>>> devices is exacly same.
>>>
>>> Also user in bug
>>> https://bugzilla.kernel.org/show_bug.cgi?id=94801 reported
>>> that Toshiba Sattellite Z30-A-1DG has only alps v7 touchpad
>>> device without trackstick and kernel reports to userspace
>>> also redundant trackstick device.
>>>
>>> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
>>
>> Looks good, but has this been tested on a laptop which
>> actually has a v7 pad + trackstick? I would like to see this
>> actually tested on at least one such laptop before it gets
>> merged.
>>
>> Regards,
>>
>> Hans
>>
>
> I did not tested my patch on any v7 touchpad-only laptop.

Ah, but I'm not worried about testing on a touchpad-only laptop,
we are already reporting a trackpoint there even though there
is none. I'm worried about breaking existing v7 using laptops
which actually have a trackstick.

So if this is tested on a v7 laptop with trackstick, and it
does not break the trackstick then that is good enough for me.

Regards,

Hans
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Pali Rohár March 24, 2015, 4:46 p.m. UTC | #4
Hello, I can compile psmouse.ko module for you. Just let me know 
which ubuntu kernel (and from) are you using.

On Tuesday 24 March 2015 11:25:13 Santiago Gala wrote:
> I can't compile the  kernel in this laptop, sorry, I tried but
> couln't complete: it requires too much free disk (more than
> 9GB) and the SSD is very small.
> 
> If there is a way (I have not found it even though I know that
> dkms exists) to just compile the modjule I could easily test
> the patch with the mainline ubuntu binary of the relevant
> 4.0.0-rcN, but spending some time trying it didn't show how
> to do i
> 
> Regards
> Santiago
> 
> El mar., 24 de marzo de 2015 a las 8:30, Hans de Goede
> (<hdegoede@redhat.com>)
> 
> escribió:
> > Hi,
> > 
> > On 23-03-15 18:02, Pali Rohár wrote:
> > > On Monday 23 March 2015 12:39:48 Hans de Goede wrote:
> > >> Hi,
> > >> 
> > >> On 22-03-15 14:46, Pali Rohár wrote:
> > >>> This patch adds detection of trackstick for v7 protocol
> > >>> devices. Code in this patch is used in official Dell
> > >>> touchpad linux drivers for Dell models: Dell Latitude
> > >>> E5250/5250, E5450/5450, E5550/5550
> > >>> 
> > >>> Detection code and base reg for alps v3 rushmore and v7
> > >>> devices is exacly same.
> > >>> 
> > >>> Also user in bug
> > >>> https://bugzilla.kernel.org/show_bug.cgi?id=94801
> > >>> reported that Toshiba Sattellite Z30-A-1DG has only
> > >>> alps v7 touchpad device without trackstick and kernel
> > >>> reports to userspace also redundant trackstick device.
> > >>> 
> > >>> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> > >> 
> > >> Looks good, but has this been tested on a laptop which
> > >> actually has a v7 pad + trackstick? I would like to see
> > >> this actually tested on at least one such laptop before
> > >> it gets merged.
> > >> 
> > >> Regards,
> > >> 
> > >> Hans
> > > 
> > > I did not tested my patch on any v7 touchpad-only laptop.
> > 
> > Ah, but I'm not worried about testing on a touchpad-only
> > laptop, we are already reporting a trackpoint there even
> > though there is none. I'm worried about breaking existing
> > v7 using laptops which actually have a trackstick.
> > 
> > So if this is tested on a v7 laptop with trackstick, and it
> > does not break the trackstick then that is good enough for
> > me.
> > 
> > Regards,
> > 
> > Hans
Dmitry Torokhov March 24, 2015, 5:01 p.m. UTC | #5
On Tue, Mar 24, 2015 at 10:25:13AM +0000, Santiago Gala wrote:
> I can't compile the  kernel in this laptop, sorry, I tried but couln't
> complete: it requires too much free disk (more than 9GB) and the SSD is
> very small.
> 
> If there is a way (I have not found it even though I know that dkms exists)
> to just compile the modjule I could easily test the patch with the mainline
> ubuntu binary of the relevant 4.0.0-rcN, but spending some time trying it
> didn't show how to do i

If you have another more powerful box you can always compile the kernel
there and then use "sshfs -o allow_others local_dir
remote_box:kernel/build/dir/" to mount the build directory on the target
box and do "cd local_dir; sudo make modules_install install" to install
the kernel.

Thanks.
Pali Rohár March 27, 2015, 8:08 p.m. UTC | #6
Hello,

there should no functional changes (e.g. acceleration speed, 
etc.). And if yes, there is probably some side effect which 
should be investigated.

Please can you provide output from dmesg (grep for psmouse or 
input) and also output from lsinput?

That changed acceleration/speed sounds like psmouse fallbacks to 
some ImPS/2 relative protocol and not ALPS...

On Friday 27 March 2015 20:46:59 Santiago Gala wrote:
> It works quite well! :)
> 
> I got some issues: at first it didn't work after I mv'ed the
> original and put the unzipped new in its place. After reboot
> it failed exactly the same, but after I "sudo
> /etc/init.d/lightdm stop; sudo modprobe -r psmouse; sudo
> modprobe psmouse; sudo /etc/init.d/lightdm start" it worked.
> Then I remembered about the initrd.img which should contain
> it. So I did "sudo dpkg-reconfigure
> linux-image-4.0.0-040000rc5-generic", rebooted again and here
> I am.
> 
> 
> Things seem to work all right. The only thing I notice is that
> the old driver moved fast in console mode (with gpm) while
> the new one is rather slow, would need to tweak the
> acceleration configuration. even after adding
> "responsiveness=15" to the configuration, as the sample
> /etc/gpm.conf says, it is slower than the previous kernel
> with the stock configuration.
> 
> 
> Regards
> 
> Santiago
> 
> 
> El vie., 27 de marzo de 2015 a las 18:17, Pali Rohár
> (<pali.rohar@gmail.com>) escribió:
> 
> On Thursday 26 March 2015 16:33:13 you wrote:
> > El mar., 24 de marzo de 2015 a las 17:48, Pali Rohár
> > (<pali.rohar@gmail.com>)
> > 
> > escribió:
> > > Hello, I can compile psmouse.ko module for you. Just let
> > > me know which ubuntu kernel (and from) are you using.
> > 
> > This one could do:
> > 
> > http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.0-rc5-vivid
> > /
> > 
> > or at a choice any further one (they get published as they
> > are released)
> > 
> > Regards
> > Santiago
> 
> Hello, in attachment is gzipped psmouse.ko module compiled
> against above ubuntu kernel from linus git tree (3c435c1e)
> with additional patches:
> 
> https://lkml.org/lkml/2015/3/21/282
> https://lkml.org/lkml/2015/3/22/93
> https://lkml.org/lkml/2015/3/22/94
> 
> Test it and if everything works as expected, please send email
> to all all people and ML. Thanks.
> 
> --
> Pali Rohár
> pali.rohar@gmail.com
Pali Rohár March 27, 2015, 8:54 p.m. UTC | #7
On Friday 27 March 2015 21:32:12 Santiago Gala wrote:
> I guess the difference is more due to new limits reported.
> 
> Now I get only one device:
> 
> /dev/input/event11
>    bustype : BUS_I8042
>    vendor  : 0x2
>    product : 0x8
>    version : 1792
>    name    : "AlpsPS/2 ALPS GlidePoint"
>    phys    : "isa0060/serio1/input0"
>    bits ev : EV_SYN EV_KEY EV_ABS
> 

Ok, it means that trackstick detection patch detected that you do 
not have trackstick (and you have only touchpad device).

And also that psmouse.ko is really using ALPS driver.

> And it produces different output in evemu-describe. I attach
> alps11-new.txt (the new one). See fragment of difference with
> relevant previous one:
> 
> @@ -38,17 +38,17 @@
>  #     Event code 53 (ABS_MT_POSITION_X)
>  #       Value      0
>  #       Min        0
> -#       Max      448
> +#       Max     4095
>  #       Fuzz       0
>  #       Flat       0
> -#       Resolution 4
> +#       Resolution 42
>  #     Event code 54 (ABS_MT_POSITION_Y)
>  #       Value      0
>  #       Min        0
> -#       Max        0
> +#       Max     2047
>  #       Fuzz       0
>  #       Flat       0
> -#       Resolution 0
> +#       Resolution 38
>  #     Event code 57 (ABS_MT_TRACKING_ID)
>  #       Value      0
>  #       Min        0
> 
> So resolutions are reported clearly different than with the
> broken patch.
> 

Can you look at difference between old 3.19 kernel version and 
this new one? To check if there is no regression.

> Regards
> Santiago
> 
> El vie., 27 de marzo de 2015 a las 21:09, Pali Rohár
> (<pali.rohar@gmail.com>)
> 
> escribió:
> > Hello,
> > 
> > there should no functional changes (e.g. acceleration speed,
> > etc.). And if yes, there is probably some side effect which
> > should be investigated.
> > 
> > Please can you provide output from dmesg (grep for psmouse
> > or input) and also output from lsinput?
> > 
> > That changed acceleration/speed sounds like psmouse
> > fallbacks to some ImPS/2 relative protocol and not ALPS...
> > 
> > On Friday 27 March 2015 20:46:59 Santiago Gala wrote:
> > > It works quite well! :)
> > > 
> > > I got some issues: at first it didn't work after I mv'ed
> > > the original and put the unzipped new in its place. After
> > > reboot it failed exactly the same, but after I "sudo
> > > /etc/init.d/lightdm stop; sudo modprobe -r psmouse; sudo
> > > modprobe psmouse; sudo /etc/init.d/lightdm start" it
> > > worked. Then I remembered about the initrd.img which
> > > should contain it. So I did "sudo dpkg-reconfigure
> > > linux-image-4.0.0-040000rc5-generic", rebooted again and
> > > here I am.
> > > 
> > > 
> > > Things seem to work all right. The only thing I notice is
> > > that the old driver moved fast in console mode (with gpm)
> > > while the new one is rather slow, would need to tweak the
> > > acceleration configuration. even after adding
> > > "responsiveness=15" to the configuration, as the sample
> > > /etc/gpm.conf says, it is slower than the previous kernel
> > > with the stock configuration.
> > > 
> > > 
> > > Regards
> > > 
> > > Santiago
> > > 
> > > 
> > > El vie., 27 de marzo de 2015 a las 18:17, Pali Rohár
> > > (<pali.rohar@gmail.com>) escribió:
> > > 
> > > On Thursday 26 March 2015 16:33:13 you wrote:
> > > > El mar., 24 de marzo de 2015 a las 17:48, Pali Rohár
> > > > (<pali.rohar@gmail.com>)
> > > > 
> > > > escribió:
> > > > > Hello, I can compile psmouse.ko module for you. Just
> > > > > let me know which ubuntu kernel (and from) are you
> > > > > using.
> > > > 
> > > > This one could do:
> > > > 
> > > > http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.0-rc5-v
> > > > ivid /
> > > > 
> > > > or at a choice any further one (they get published as
> > > > they are released)
> > > > 
> > > > Regards
> > > > Santiago
> > > 
> > > Hello, in attachment is gzipped psmouse.ko module compiled
> > > against above ubuntu kernel from linus git tree (3c435c1e)
> > > with additional patches:
> > > 
> > > https://lkml.org/lkml/2015/3/21/282
> > > https://lkml.org/lkml/2015/3/22/93
> > > https://lkml.org/lkml/2015/3/22/94
> > > 
> > > Test it and if everything works as expected, please send
> > > email to all all people and ML. Thanks.
> > > 
> > > --
> > > Pali Rohár
> > > pali.rohar@gmail.com
> > 
> > --
> > Pali Rohár
> > pali.rohar@gmail.com
Dmitry Torokhov March 28, 2015, 3:43 a.m. UTC | #8
On Sat, Mar 28, 2015 at 01:30:58AM +0000, Santiago Gala wrote:
> The behaviour is the same with 3.19.1 as with 4.0.0-rc5 + the patched
> psmouse you give me. The difference in lsinput is just name and current
> position:
> 
> $ diff -u alps06.txt alps11-new.txt
> --- alps06.txt  2015-03-18 07:21:08.827315595 +0100
> +++ alps11-new.txt      2015-03-27 21:24:44.285503438 +0100
> @@ -1,5 +1,5 @@
>  # EVEMU 1.2
> -# Input device name: "AlpsPS/2 ALPS DualPoint TouchPad"
> +# Input device name: "AlpsPS/2 ALPS GlidePoint"
>  # Input device ID: bus 0x11 vendor 0x02 product 0x08 version 0x700
>  # Supported events:
>  #   Event type 0 (EV_SYN)
> @@ -15,14 +15,14 @@
>  #     Event code 335 (BTN_TOOL_QUADTAP)
>  #   Event type 3 (EV_ABS)
>  #     Event code 0 (ABS_X)
> -#       Value   1076
> +#       Value   1549
>  #       Min        0
>  #       Max     4095
>  #       Fuzz       0
>  #       Flat       0
>  #       Resolution 42
>  #     Event code 1 (ABS_Y)
> -#       Value    869
> +#       Value    877
>  #       Min        0
>  #       Max     2047
>  #       Fuzz       0
> @@ -59,7 +59,7 @@
>  # Properties:
>  #   Property  type 0 (INPUT_PROP_POINTER)
>  #   Property  type 2 (INPUT_PROP_BUTTONPAD)
> -N: AlpsPS/2 ALPS DualPoint TouchPad
> +N: AlpsPS/2 ALPS GlidePoint
>  I: 0011 0002 0008 0700
>  P: 05 00 00 00 00 00 00 00
>  B: 00 0b 00 00 00 00 00 00 00

Hmm, if resolution is the same I wonder if we are dropping some
packets... Is there any messages from psmouse module in dmesg?

Thanks.

> 
> 
> El vie., 27 de marzo de 2015 a las 21:56, Pali Rohár (<pali.rohar@gmail.com>)
> escribió:
> 
> > On Friday 27 March 2015 21:32:12 Santiago Gala wrote:
> > > I guess the difference is more due to new limits reported.
> > >
> > > Now I get only one device:
> > >
> > > /dev/input/event11
> > >    bustype : BUS_I8042
> > >    vendor  : 0x2
> > >    product : 0x8
> > >    version : 1792
> > >    name    : "AlpsPS/2 ALPS GlidePoint"
> > >    phys    : "isa0060/serio1/input0"
> > >    bits ev : EV_SYN EV_KEY EV_ABS
> > >
> >
> > Ok, it means that trackstick detection patch detected that you do
> > not have trackstick (and you have only touchpad device).
> >
> > And also that psmouse.ko is really using ALPS driver.
> >
> > > And it produces different output in evemu-describe. I attach
> > > alps11-new.txt (the new one). See fragment of difference with
> > > relevant previous one:
> > >
> > > @@ -38,17 +38,17 @@
> > >  #     Event code 53 (ABS_MT_POSITION_X)
> > >  #       Value      0
> > >  #       Min        0
> > > -#       Max      448
> > > +#       Max     4095
> > >  #       Fuzz       0
> > >  #       Flat       0
> > > -#       Resolution 4
> > > +#       Resolution 42
> > >  #     Event code 54 (ABS_MT_POSITION_Y)
> > >  #       Value      0
> > >  #       Min        0
> > > -#       Max        0
> > > +#       Max     2047
> > >  #       Fuzz       0
> > >  #       Flat       0
> > > -#       Resolution 0
> > > +#       Resolution 38
> > >  #     Event code 57 (ABS_MT_TRACKING_ID)
> > >  #       Value      0
> > >  #       Min        0
> > >
> > > So resolutions are reported clearly different than with the
> > > broken patch.
> > >
> >
> > Can you look at difference between old 3.19 kernel version and
> > this new one? To check if there is no regression.
> >
> > > Regards
> > > Santiago
> > >
> > > El vie., 27 de marzo de 2015 a las 21:09, Pali Rohár
> > > (<pali.rohar@gmail.com>)
> > >
> > > escribió:
> > > > Hello,
> > > >
> > > > there should no functional changes (e.g. acceleration speed,
> > > > etc.). And if yes, there is probably some side effect which
> > > > should be investigated.
> > > >
> > > > Please can you provide output from dmesg (grep for psmouse
> > > > or input) and also output from lsinput?
> > > >
> > > > That changed acceleration/speed sounds like psmouse
> > > > fallbacks to some ImPS/2 relative protocol and not ALPS...
> > > >
> > > > On Friday 27 March 2015 20:46:59 Santiago Gala wrote:
> > > > > It works quite well! :)
> > > > >
> > > > > I got some issues: at first it didn't work after I mv'ed
> > > > > the original and put the unzipped new in its place. After
> > > > > reboot it failed exactly the same, but after I "sudo
> > > > > /etc/init.d/lightdm stop; sudo modprobe -r psmouse; sudo
> > > > > modprobe psmouse; sudo /etc/init.d/lightdm start" it
> > > > > worked. Then I remembered about the initrd.img which
> > > > > should contain it. So I did "sudo dpkg-reconfigure
> > > > > linux-image-4.0.0-040000rc5-generic", rebooted again and
> > > > > here I am.
> > > > >
> > > > >
> > > > > Things seem to work all right. The only thing I notice is
> > > > > that the old driver moved fast in console mode (with gpm)
> > > > > while the new one is rather slow, would need to tweak the
> > > > > acceleration configuration. even after adding
> > > > > "responsiveness=15" to the configuration, as the sample
> > > > > /etc/gpm.conf says, it is slower than the previous kernel
> > > > > with the stock configuration.
> > > > >
> > > > >
> > > > > Regards
> > > > >
> > > > > Santiago
> > > > >
> > > > >
> > > > > El vie., 27 de marzo de 2015 a las 18:17, Pali Rohár
> > > > > (<pali.rohar@gmail.com>) escribió:
> > > > >
> > > > > On Thursday 26 March 2015 16:33:13 you wrote:
> > > > > > El mar., 24 de marzo de 2015 a las 17:48, Pali Rohár
> > > > > > (<pali.rohar@gmail.com>)
> > > > > >
> > > > > > escribió:
> > > > > > > Hello, I can compile psmouse.ko module for you. Just
> > > > > > > let me know which ubuntu kernel (and from) are you
> > > > > > > using.
> > > > > >
> > > > > > This one could do:
> > > > > >
> > > > > > http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.0-rc5-v
> > > > > > ivid /
> > > > > >
> > > > > > or at a choice any further one (they get published as
> > > > > > they are released)
> > > > > >
> > > > > > Regards
> > > > > > Santiago
> > > > >
> > > > > Hello, in attachment is gzipped psmouse.ko module compiled
> > > > > against above ubuntu kernel from linus git tree (3c435c1e)
> > > > > with additional patches:
> > > > >
> > > > > https://lkml.org/lkml/2015/3/21/282
> > > > > https://lkml.org/lkml/2015/3/22/93
> > > > > https://lkml.org/lkml/2015/3/22/94
> > > > >
> > > > > Test it and if everything works as expected, please send
> > > > > email to all all people and ML. Thanks.
> > > > >
> > > > > --
> > > > > Pali Rohár
> > > > > pali.rohar@gmail.com
> > > >
> > > > --
> > > > Pali Rohár
> > > > pali.rohar@gmail.com
> >
> > --
> > Pali Rohár
> > pali.rohar@gmail.com
> >
Pali Rohár March 28, 2015, 8:51 a.m. UTC | #9
On Saturday 28 March 2015 04:43:35 Dmitry Torokhov wrote:
> On Sat, Mar 28, 2015 at 01:30:58AM +0000, Santiago Gala wrote:
> > The behaviour is the same with 3.19.1 as with 4.0.0-rc5 +
> > the patched psmouse you give me. The difference in lsinput
> > is just name and current position:
> > 
> > $ diff -u alps06.txt alps11-new.txt
> > --- alps06.txt  2015-03-18 07:21:08.827315595 +0100
> > +++ alps11-new.txt      2015-03-27 21:24:44.285503438 +0100
> > @@ -1,5 +1,5 @@
> > 
> >  # EVEMU 1.2
> > 
> > -# Input device name: "AlpsPS/2 ALPS DualPoint TouchPad"
> > +# Input device name: "AlpsPS/2 ALPS GlidePoint"
> > 
> >  # Input device ID: bus 0x11 vendor 0x02 product 0x08
> >  version 0x700 # Supported events:
> >  #   Event type 0 (EV_SYN)
> > 
> > @@ -15,14 +15,14 @@
> > 
> >  #     Event code 335 (BTN_TOOL_QUADTAP)
> >  #   Event type 3 (EV_ABS)
> >  #     Event code 0 (ABS_X)
> > 
> > -#       Value   1076
> > +#       Value   1549
> > 
> >  #       Min        0
> >  #       Max     4095
> >  #       Fuzz       0
> >  #       Flat       0
> >  #       Resolution 42
> >  #     Event code 1 (ABS_Y)
> > 
> > -#       Value    869
> > +#       Value    877
> > 
> >  #       Min        0
> >  #       Max     2047
> >  #       Fuzz       0
> > 
> > @@ -59,7 +59,7 @@
> > 
> >  # Properties:
> >  #   Property  type 0 (INPUT_PROP_POINTER)
> >  #   Property  type 2 (INPUT_PROP_BUTTONPAD)
> > 
> > -N: AlpsPS/2 ALPS DualPoint TouchPad
> > +N: AlpsPS/2 ALPS GlidePoint
> > 
> >  I: 0011 0002 0008 0700
> >  P: 05 00 00 00 00 00 00 00
> >  B: 00 0b 00 00 00 00 00 00 00
> 
> Hmm, if resolution is the same I wonder if we are dropping
> some packets... Is there any messages from psmouse module in
> dmesg?
> 
> Thanks.
> 

For me output/diff looks ok. Name is based on DUALPOINT flag 
which is cleared for non trackstick device version. And my patch 
adding that trackstick detection for v7.
Dmitry Torokhov March 29, 2015, 3:59 a.m. UTC | #10
On Tue, Mar 24, 2015 at 08:27:29AM +0100, Hans de Goede wrote:
> Hi,
> 
> On 23-03-15 18:02, Pali Rohár wrote:
> >On Monday 23 March 2015 12:39:48 Hans de Goede wrote:
> >>Hi,
> >>
> >>On 22-03-15 14:46, Pali Rohár wrote:
> >>>This patch adds detection of trackstick for v7 protocol
> >>>devices. Code in this patch is used in official Dell
> >>>touchpad linux drivers for Dell models: Dell Latitude
> >>>E5250/5250, E5450/5450, E5550/5550
> >>>
> >>>Detection code and base reg for alps v3 rushmore and v7
> >>>devices is exacly same.
> >>>
> >>>Also user in bug
> >>>https://bugzilla.kernel.org/show_bug.cgi?id=94801 reported
> >>>that Toshiba Sattellite Z30-A-1DG has only alps v7 touchpad
> >>>device without trackstick and kernel reports to userspace
> >>>also redundant trackstick device.
> >>>
> >>>Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> >>
> >>Looks good, but has this been tested on a laptop which
> >>actually has a v7 pad + trackstick? I would like to see this
> >>actually tested on at least one such laptop before it gets
> >>merged.
> >>
> >>Regards,
> >>
> >>Hans
> >>
> >
> >I did not tested my patch on any v7 touchpad-only laptop.
> 
> Ah, but I'm not worried about testing on a touchpad-only laptop,
> we are already reporting a trackpoint there even though there
> is none. I'm worried about breaking existing v7 using laptops
> which actually have a trackstick.
> 
> So if this is tested on a v7 laptop with trackstick, and it
> does not break the trackstick then that is good enough for me.

I wonder if Masaki might have devices with V7 and trackstick available
and could test the patch for us?

Thanks.
Pali Rohár May 28, 2015, 7:39 a.m. UTC | #11
On Saturday 28 March 2015 20:59:35 Dmitry Torokhov wrote:
> On Tue, Mar 24, 2015 at 08:27:29AM +0100, Hans de Goede wrote:
> > Hi,
> > 
> > On 23-03-15 18:02, Pali Rohár wrote:
> > >On Monday 23 March 2015 12:39:48 Hans de Goede wrote:
> > >>Hi,
> > >>
> > >>On 22-03-15 14:46, Pali Rohár wrote:
> > >>>This patch adds detection of trackstick for v7 protocol
> > >>>devices. Code in this patch is used in official Dell
> > >>>touchpad linux drivers for Dell models: Dell Latitude
> > >>>E5250/5250, E5450/5450, E5550/5550
> > >>>
> > >>>Detection code and base reg for alps v3 rushmore and v7
> > >>>devices is exacly same.
> > >>>
> > >>>Also user in bug
> > >>>https://bugzilla.kernel.org/show_bug.cgi?id=94801 reported
> > >>>that Toshiba Sattellite Z30-A-1DG has only alps v7 touchpad
> > >>>device without trackstick and kernel reports to userspace
> > >>>also redundant trackstick device.
> > >>>
> > >>>Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> > >>
> > >>Looks good, but has this been tested on a laptop which
> > >>actually has a v7 pad + trackstick? I would like to see this
> > >>actually tested on at least one such laptop before it gets
> > >>merged.
> > >>
> > >>Regards,
> > >>
> > >>Hans
> > >>
> > >
> > >I did not tested my patch on any v7 touchpad-only laptop.
> > 
> > Ah, but I'm not worried about testing on a touchpad-only laptop,
> > we are already reporting a trackpoint there even though there
> > is none. I'm worried about breaking existing v7 using laptops
> > which actually have a trackstick.
> > 
> > So if this is tested on a v7 laptop with trackstick, and it
> > does not break the trackstick then that is good enough for me.
> 
> I wonder if Masaki might have devices with V7 and trackstick available
> and could test the patch for us?
> 
> Thanks.
> 

Masaki ping, do you have any V7 device with trackstick for testing?
Pali Rohár Jan. 5, 2016, 4:44 p.m. UTC | #12
On Sunday 22 March 2015 14:46:11 Pali Rohár wrote:
> This patch adds detection of trackstick for v7 protocol devices. Code in this
> patch is used in official Dell touchpad linux drivers for Dell models:
> Dell Latitude E5250/5250, E5450/5450, E5550/5550
> 
> Detection code and base reg for alps v3 rushmore and v7 devices is exacly same.
> 
> Also user in bug https://bugzilla.kernel.org/show_bug.cgi?id=94801 reported
> that Toshiba Sattellite Z30-A-1DG has only alps v7 touchpad device without
> trackstick and kernel reports to userspace also redundant trackstick device.
> 
> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> ---

Hello!

Alex now tested this patch on two Dell machines with ALPS: E5450 (with
TrackStick) and E5250 (without TrackStick).

With patch nothing was changed for E5450. And E5250 with patch does not
show trackstick input device anymore.

Tested-by: Alex Hung <alex.hung@canonical.com>

>  drivers/input/mouse/alps.c |   12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
> index 33198b9..c9cd27a 100644
> --- a/drivers/input/mouse/alps.c
> +++ b/drivers/input/mouse/alps.c
> @@ -30,6 +30,7 @@
>  #define ALPS_CMD_NIBBLE_10	0x01f2
>  
>  #define ALPS_REG_BASE_RUSHMORE	0xc2c0
> +#define ALPS_REG_BASE_V7	0xc2c0
>  #define ALPS_REG_BASE_PINNACLE	0x0000
>  
>  static const struct alps_nibble_commands alps_v3_nibble_commands[] = {
> @@ -1795,7 +1796,7 @@ static int alps_absolute_mode_v3(struct psmouse *psmouse)
>  	return 0;
>  }
>  
> -static int alps_probe_trackstick_v3(struct psmouse *psmouse, int reg_base)
> +static int alps_probe_trackstick_v3_v7(struct psmouse *psmouse, int reg_base)
>  {
>  	int ret = -EIO, reg_val;
>  
> @@ -1880,7 +1881,7 @@ static int alps_hw_init_v3(struct psmouse *psmouse)
>  	int reg_val;
>  	unsigned char param[4];
>  
> -	reg_val = alps_probe_trackstick_v3(psmouse, ALPS_REG_BASE_PINNACLE);
> +	reg_val = alps_probe_trackstick_v3_v7(psmouse, ALPS_REG_BASE_PINNACLE);
>  	if (reg_val == -EIO)
>  		goto error;
>  
> @@ -2260,8 +2261,8 @@ static int alps_set_protocol(struct psmouse *psmouse,
>  		priv->x_bits = 16;
>  		priv->y_bits = 12;
>  
> -		if (alps_probe_trackstick_v3(psmouse,
> -					     ALPS_REG_BASE_RUSHMORE) < 0)
> +		if (alps_probe_trackstick_v3_v7(psmouse,
> +						ALPS_REG_BASE_RUSHMORE) < 0)
>  			priv->flags &= ~ALPS_DUALPOINT;
>  
>  		break;
> @@ -2311,6 +2312,9 @@ static int alps_set_protocol(struct psmouse *psmouse,
>  		if (priv->fw_ver[1] != 0xba)
>  			priv->flags |= ALPS_BUTTONPAD;
>  
> +		if (alps_probe_trackstick_v3_v7(psmouse, ALPS_REG_BASE_V7) < 0)
> +			priv->flags &= ~ALPS_DUALPOINT;
> +
>  		break;
>  	}
>
Hans de Goede Jan. 6, 2016, 8:12 a.m. UTC | #13
Hi,

On 05-01-16 17:44, Pali Rohár wrote:
> On Sunday 22 March 2015 14:46:11 Pali Rohár wrote:
>> This patch adds detection of trackstick for v7 protocol devices. Code in this
>> patch is used in official Dell touchpad linux drivers for Dell models:
>> Dell Latitude E5250/5250, E5450/5450, E5550/5550
>>
>> Detection code and base reg for alps v3 rushmore and v7 devices is exacly same.
>>
>> Also user in bug https://bugzilla.kernel.org/show_bug.cgi?id=94801 reported
>> that Toshiba Sattellite Z30-A-1DG has only alps v7 touchpad device without
>> trackstick and kernel reports to userspace also redundant trackstick device.
>>
>> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
>> ---
>
> Hello!
>
> Alex now tested this patch on two Dell machines with ALPS: E5450 (with
> TrackStick) and E5250 (without TrackStick).
>
> With patch nothing was changed for E5450. And E5250 with patch does not
> show trackstick input device anymore.
>
> Tested-by: Alex Hung <alex.hung@canonical.com>

With that this patch looks good to me:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Pali, it is probably a good idea to send Dmitry a v2 of these 2
patches rebased on top of the latest next and with Alex' Tested-By
and my Reviewed-by-s added.

Regards,

Hans


>
>>   drivers/input/mouse/alps.c |   12 ++++++++----
>>   1 file changed, 8 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
>> index 33198b9..c9cd27a 100644
>> --- a/drivers/input/mouse/alps.c
>> +++ b/drivers/input/mouse/alps.c
>> @@ -30,6 +30,7 @@
>>   #define ALPS_CMD_NIBBLE_10	0x01f2
>>
>>   #define ALPS_REG_BASE_RUSHMORE	0xc2c0
>> +#define ALPS_REG_BASE_V7	0xc2c0
>>   #define ALPS_REG_BASE_PINNACLE	0x0000
>>
>>   static const struct alps_nibble_commands alps_v3_nibble_commands[] = {
>> @@ -1795,7 +1796,7 @@ static int alps_absolute_mode_v3(struct psmouse *psmouse)
>>   	return 0;
>>   }
>>
>> -static int alps_probe_trackstick_v3(struct psmouse *psmouse, int reg_base)
>> +static int alps_probe_trackstick_v3_v7(struct psmouse *psmouse, int reg_base)
>>   {
>>   	int ret = -EIO, reg_val;
>>
>> @@ -1880,7 +1881,7 @@ static int alps_hw_init_v3(struct psmouse *psmouse)
>>   	int reg_val;
>>   	unsigned char param[4];
>>
>> -	reg_val = alps_probe_trackstick_v3(psmouse, ALPS_REG_BASE_PINNACLE);
>> +	reg_val = alps_probe_trackstick_v3_v7(psmouse, ALPS_REG_BASE_PINNACLE);
>>   	if (reg_val == -EIO)
>>   		goto error;
>>
>> @@ -2260,8 +2261,8 @@ static int alps_set_protocol(struct psmouse *psmouse,
>>   		priv->x_bits = 16;
>>   		priv->y_bits = 12;
>>
>> -		if (alps_probe_trackstick_v3(psmouse,
>> -					     ALPS_REG_BASE_RUSHMORE) < 0)
>> +		if (alps_probe_trackstick_v3_v7(psmouse,
>> +						ALPS_REG_BASE_RUSHMORE) < 0)
>>   			priv->flags &= ~ALPS_DUALPOINT;
>>
>>   		break;
>> @@ -2311,6 +2312,9 @@ static int alps_set_protocol(struct psmouse *psmouse,
>>   		if (priv->fw_ver[1] != 0xba)
>>   			priv->flags |= ALPS_BUTTONPAD;
>>
>> +		if (alps_probe_trackstick_v3_v7(psmouse, ALPS_REG_BASE_V7) < 0)
>> +			priv->flags &= ~ALPS_DUALPOINT;
>> +
>>   		break;
>>   	}
>>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Dmitry Torokhov Jan. 6, 2016, 11:55 p.m. UTC | #14
On Wed, Jan 06, 2016 at 09:12:30AM +0100, Hans de Goede wrote:
> Hi,
> 
> On 05-01-16 17:44, Pali Rohár wrote:
> >On Sunday 22 March 2015 14:46:11 Pali Rohár wrote:
> >>This patch adds detection of trackstick for v7 protocol devices. Code in this
> >>patch is used in official Dell touchpad linux drivers for Dell models:
> >>Dell Latitude E5250/5250, E5450/5450, E5550/5550
> >>
> >>Detection code and base reg for alps v3 rushmore and v7 devices is exacly same.
> >>
> >>Also user in bug https://bugzilla.kernel.org/show_bug.cgi?id=94801 reported
> >>that Toshiba Sattellite Z30-A-1DG has only alps v7 touchpad device without
> >>trackstick and kernel reports to userspace also redundant trackstick device.
> >>
> >>Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> >>---
> >
> >Hello!
> >
> >Alex now tested this patch on two Dell machines with ALPS: E5450 (with
> >TrackStick) and E5250 (without TrackStick).
> >
> >With patch nothing was changed for E5450. And E5250 with patch does not
> >show trackstick input device anymore.
> >
> >Tested-by: Alex Hung <alex.hung@canonical.com>
> 
> With that this patch looks good to me:
> 
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> 
> Pali, it is probably a good idea to send Dmitry a v2 of these 2
> patches rebased on top of the latest next and with Alex' Tested-By
> and my Reviewed-by-s added.

It's alright, I added the tags and applied.

Patch
diff mbox

diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
index 33198b9..c9cd27a 100644
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -30,6 +30,7 @@ 
 #define ALPS_CMD_NIBBLE_10	0x01f2
 
 #define ALPS_REG_BASE_RUSHMORE	0xc2c0
+#define ALPS_REG_BASE_V7	0xc2c0
 #define ALPS_REG_BASE_PINNACLE	0x0000
 
 static const struct alps_nibble_commands alps_v3_nibble_commands[] = {
@@ -1795,7 +1796,7 @@  static int alps_absolute_mode_v3(struct psmouse *psmouse)
 	return 0;
 }
 
-static int alps_probe_trackstick_v3(struct psmouse *psmouse, int reg_base)
+static int alps_probe_trackstick_v3_v7(struct psmouse *psmouse, int reg_base)
 {
 	int ret = -EIO, reg_val;
 
@@ -1880,7 +1881,7 @@  static int alps_hw_init_v3(struct psmouse *psmouse)
 	int reg_val;
 	unsigned char param[4];
 
-	reg_val = alps_probe_trackstick_v3(psmouse, ALPS_REG_BASE_PINNACLE);
+	reg_val = alps_probe_trackstick_v3_v7(psmouse, ALPS_REG_BASE_PINNACLE);
 	if (reg_val == -EIO)
 		goto error;
 
@@ -2260,8 +2261,8 @@  static int alps_set_protocol(struct psmouse *psmouse,
 		priv->x_bits = 16;
 		priv->y_bits = 12;
 
-		if (alps_probe_trackstick_v3(psmouse,
-					     ALPS_REG_BASE_RUSHMORE) < 0)
+		if (alps_probe_trackstick_v3_v7(psmouse,
+						ALPS_REG_BASE_RUSHMORE) < 0)
 			priv->flags &= ~ALPS_DUALPOINT;
 
 		break;
@@ -2311,6 +2312,9 @@  static int alps_set_protocol(struct psmouse *psmouse,
 		if (priv->fw_ver[1] != 0xba)
 			priv->flags |= ALPS_BUTTONPAD;
 
+		if (alps_probe_trackstick_v3_v7(psmouse, ALPS_REG_BASE_V7) < 0)
+			priv->flags &= ~ALPS_DUALPOINT;
+
 		break;
 	}