LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Xiaoxiao Liu <xiaoxiao.liu-1@cn.alps.com>
To: "Pali Rohár" <pali.rohar@gmail.com>,
	"XiaoXiao Liu" <sliuuxiaonxiao@gmail.com>
Cc: "dmitry.torokhov@gmail.com" <dmitry.torokhov@gmail.com>,
	"peter.hutterer@who-t.net" <peter.hutterer@who-t.net>,
	"hui.wang@canonical.com" <hui.wang@canonical.com>,
	"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Xiaojian Cao <xiaojian.cao@cn.alps.com>,
	"zhangfp1@lenovo.com" <zhangfp1@lenovo.com>,
	Naoki Saito <naoki.saito@alpsalpine.com>
Subject: 答复: [PATCH] input: alps-fix the issue alps cs19 trackstick do not work.
Date: Tue, 28 May 2019 01:37:14 +0000	[thread overview]
Message-ID: <OSBPR01MB4855F61AE28B883CDD87F781DA1E0@OSBPR01MB4855.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <20190527100913.sgxrjrmphsjfmcdb@pali>

Add Saito-san.

Hi Hui,
Does it mean that your device (reported to kernel) sends only trackstick packets and not touchpad?
   	-> Yes.
I guess that you want parenthesis around (param[1] & 0x20). And also describe what that 0x20 constant means.
It is not a warning.
	-> Yes, it should be (param[1] & 0x20). 
	-> 0x20 is used for detect which type device is. I will correct it.

Hm... why your device does not match these constants?
	->I am not clear what the alps_command_mode_read_reg(psmouse, 0xD7) used for.
              -> But I know our device did not meet the condition if (reg_val == 0x0C || reg_val == 0x1D) from the                running result.

Xiaoxiao Liu
xiaoxiao.liu-1@cn.alps.com
sliuuxiaonxiao@gmail.com
-----邮件原件-----
发件人: Pali Rohár <pali.rohar@gmail.com> 
发送时间: Monday, May 27, 2019 6:09 PM
收件人: XiaoXiao Liu <sliuuxiaonxiao@gmail.com>
抄送: dmitry.torokhov@gmail.com; peter.hutterer@who-t.net; hui.wang@canonical.com; linux-input@vger.kernel.org; linux-kernel@vger.kernel.org; 曹 曉建 Xiaojian Cao <xiaojian.cao@cn.alps.com>; zhangfp1@lenovo.com; 劉 曉曉 Xiaoxiao Liu <xiaoxiao.liu-1@cn.alps.com>
主题: Re: [PATCH] input: alps-fix the issue alps cs19 trackstick do not work.

Hi!

On Monday 27 May 2019 05:44:22 XiaoXiao Liu wrote:
> The alps devices which detected to use the ALPS_PROTO_V8 procotol 
> contains ALPS touchpad and ALPS trackstick.The ALPS_PROTO_V8 procotol 
> do not support the trackstick device process by default.

Normally PS/2 device handled by alps.c is touchpad and in some cases touchpad sends also trackstick data in that one PS/2 channel.

Does it mean that your device (reported to kernel) sends only trackstick packets and not touchpad?

> When the trackstick was detected to use ALPS_PROTO_V8 procotol, the v8 
> process_packet method alps_process_packet_ss4_v2 will reject to report 
> the data when the device using ALPS_PROTO_V8 procotol is not set the 
> ALPS_DUALPOINT flag.
> 
> The alps cs19 trackstick is detected to use the ALPS_PROTO_V8 procotol 
> but without ALPS_DUALPOINT flag, the alps driver will not report the 
> input data. so the trackstick will not work.
> 
> solution: when the alps cs19 device detected, set the device 
> ALPS_DUALPOINT flag,then the input data will be processed.
> 
> Signed-off-by: XiaoXiao Liu <sliuuxiaonxiao@gmail.com>
> ---
>  drivers/input/mouse/alps.c | 25 +++++++++++++++++++++++--
>  1 file changed, 23 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c 
> index 0a6f7ca883e7..a54677cf7474 100644
> --- a/drivers/input/mouse/alps.c
> +++ b/drivers/input/mouse/alps.c
> @@ -24,7 +24,7 @@
>  
>  #include "psmouse.h"
>  #include "alps.h"
> -
> +#include "trackpoint.h"
>  /*
>   * Definitions for ALPS version 3 and 4 command mode protocol
>   */
> @@ -220,6 +220,23 @@ static bool alps_is_valid_first_byte(struct alps_data *priv,
>  	return (data & priv->mask0) == priv->byte0;  }
>  
> +static int alps_check_cs19_trackstick(struct psmouse *psmouse) {
> +	u8 param[2] = { 0 };
> +	int error;
> +
> +	error = ps2_command(&psmouse->ps2dev,
> +			    param, MAKE_PS2_CMD(0, 2, TP_READ_ID));
> +	if (error)
> +		return error;
> +
> +	if (param[0] == TP_VARIANT_ALPS && param[1] & 0x20) {

I guess that you want parenthesis around (param[1] & 0x20). And also describe what that 0x20 constant means.

> +		psmouse_warn(psmouse, "It is alps cs19 trackstick");

It is not a warning.

> +		return 0;
> +	}
> +	return -1;
> +}
> +
>  static void alps_report_buttons(struct input_dev *dev1, struct input_dev *dev2,
>  				int left, int right, int middle)
>  {
> @@ -2568,8 +2585,12 @@ static int alps_update_dual_info_ss4_v2(unsigned char otp[][4],
>  			alps_exit_command_mode(psmouse);
>  			ps2_command(ps2dev, NULL, PSMOUSE_CMD_ENABLE);
>  
> -			if (reg_val == 0x0C || reg_val == 0x1D)
> +			if (reg_val == 0x0C || reg_val == 0x1D) {

Hm... why your device does not match these constants?

> +				is_dual = true;
> +			} else if (alps_check_cs19_trackstick(psmouse) == 0) {
> +				//For support Thinkpad CS19 TrackStick
>  				is_dual = true;
> +			}
>  		}
>  	}
>  

--
Pali Rohár
pali.rohar@gmail.com

  reply	other threads:[~2019-05-28  1:37 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-27  9:44 XiaoXiao Liu
2019-05-27 10:09 ` Pali Rohár
2019-05-28  1:37   ` Xiaoxiao Liu [this message]
2019-05-28  7:18     ` 答复: " Pali Rohár
2019-05-28  7:55       ` 答复: " Xiaoxiao Liu
2019-06-10  9:20         ` Xiaoxiao Liu
2019-06-10 10:03           ` Xiaoxiao Liu
2019-06-10 10:43             ` Pali Rohár
2019-06-11  3:05               ` 答复: " Xiaoxiao Liu
2019-06-11  3:23                 ` Hui Wang
2019-06-11  4:32                   ` Hui Wang
2019-06-11  7:23                     ` Pali Rohár
2019-06-11 17:07                       ` dmitry.torokhov
2019-06-11 17:17                         ` Pali Rohár
2019-06-11 17:32                           ` dmitry.torokhov
2019-06-11 17:38                             ` Pali Rohár
2019-06-11 17:45                               ` dmitry.torokhov
2019-06-17  1:29                               ` 答复: " Xiaoxiao Liu
2019-06-17  7:49                                 ` Pali Rohár
2019-06-18  8:19                                   ` Hui Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=OSBPR01MB4855F61AE28B883CDD87F781DA1E0@OSBPR01MB4855.jpnprd01.prod.outlook.com \
    --to=xiaoxiao.liu-1@cn.alps.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=hui.wang@canonical.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=naoki.saito@alpsalpine.com \
    --cc=pali.rohar@gmail.com \
    --cc=peter.hutterer@who-t.net \
    --cc=sliuuxiaonxiao@gmail.com \
    --cc=xiaojian.cao@cn.alps.com \
    --cc=zhangfp1@lenovo.com \
    --subject='Re: 答复: [PATCH] input: alps-fix the issue alps cs19 trackstick do not work.' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).