linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xiaoxiao Liu <xiaoxiao.liu-1@cn.alps.com>
To: "Pali Rohár" <pali.rohar@gmail.com>
Cc: Hui Wang <hui.wang@canonical.com>,
	XiaoXiao Liu <sliuuxiaonxiao@gmail.com>,
	"dmitry.torokhov@gmail.com" <dmitry.torokhov@gmail.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>
Subject: 答复: 答复: 答复: [PATCH] input: alps-fix the issue the special alps trackpoint do not work.
Date: Wed, 22 May 2019 07:30:43 +0000	[thread overview]
Message-ID: <OSBPR01MB48550B43F78BBFBDC20D414DDA000@OSBPR01MB4855.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <20190522063546.kb74mxeprkauicul@pali>

Hi Pali,

Ok, and cannot you set ALPS_DUALPOINT flag based on that
alps_check_is_trackpoint() result and then update
alps_process_packet_ss4_v3() code to supports also
V8 trackpoint packets?
--> Yes, we can do like so, when we use the v8 method to process the trackpoint , the mouse speed is not ideal.
      Then we choose the standard mouse driver.
      
XiaoXiao Liu
sliuuxiaonxiao@gmail.com
xiaoxiao.liu-1@cn.alps.com
> 
> -----邮件原件-----
发件人: Pali Rohár <pali.rohar@gmail.com> 
发送时间: Wednesday, May 22, 2019 2:36 PM
收件人: 劉 曉曉 Xiaoxiao Liu <xiaoxiao.liu-1@cn.alps.com>
抄送: Hui Wang <hui.wang@canonical.com>; XiaoXiao Liu <sliuuxiaonxiao@gmail.com>; dmitry.torokhov@gmail.com; linux-input@vger.kernel.org; linux-kernel@vger.kernel.org; 曹 曉建 Xiaojian Cao <xiaojian.cao@cn.alps.com>; zhangfp1@lenovo.com
主题: Re: 答复: 答复: [PATCH] input: alps-fix the issue the special alps trackpoint do not work.

Hi!

On Wednesday 22 May 2019 02:53:18 Xiaoxiao Liu wrote:
> Hi Pali,
> 
> Why it does not report input data?
> --> The alps devices which detected to use the ALPS_PROTO_V8  contains ALPS touchpad and ALPS track point. 
>      But the ALPS_PROTO_V8 do not support the track point device process. 
>      When the track point was detected to use ALPS_PROTO_V8 ,the v8 process_packet method  alps_process_packet_ss4_v2 will reject to report the data because the v8 device is      not set the ALPS_DUALPOINT flag. 
>      You can refer below code.

Ok, and cannot you set ALPS_DUALPOINT flag based on that
alps_check_is_trackpoint() result and then update
alps_process_packet_ss4_v3() code to supports also
V8 trackpoint packets?

> 	/* Report trackstick */
> 	if (alps_get_pkt_id_ss4_v2(packet) == SS4_PACKET_ID_STICK) {
> 		if (!(priv->flags & ALPS_DUALPOINT)) {
> 			psmouse_warn(psmouse,
> 				     "Rejected trackstick packet from non DualPoint device");
> 			return;
> 		}
> 		...
> 		return;
> 	}
> 
> why is for non-ALPS trackpoints used ALPS driver?
> --> the non-Alps track point is the ALPS touchpad, it is right to use the ALPS driver for ALPS touchpad.

Ok, now I got it.

> The v8 protocol condition may modified  as below, it will be more easier to understand.
> 
> 	 if (e7[0] == 0x73 && e7[1] == 0x03 && (e7[2] == 0x14 || e7[2] == 0x28) &&  (alps_check_is_trackpoint(psmouse) != 0)  ) {
>  		protocol = &alps_v8_protocol_data;
> 	}

Yes, this would be more easier to understand.

Anyway, more information should be in commit message.

> Best Regards
> XiaoXiao Liu
> sliuuxiaonxiao@gmail.com
> xiaoxiao.liu-1@cn.alps.com
> 
> -----邮件原件-----
> 发件人: Pali Rohár <pali.rohar@gmail.com>
> 发送时间: Tuesday, May 21, 2019 5:46 PM
> 收件人: Hui Wang <hui.wang@canonical.com>
> 抄送: 劉 曉曉 Xiaoxiao Liu <xiaoxiao.liu-1@cn.alps.com>; XiaoXiao Liu 
> <sliuuxiaonxiao@gmail.com>; dmitry.torokhov@gmail.com; 
> linux-input@vger.kernel.org; linux-kernel@vger.kernel.org; 曹 曉建 
> Xiaojian Cao <xiaojian.cao@cn.alps.com>; zhangfp1@lenovo.com
> 主题: Re: 答复: [PATCH] input: alps-fix the issue the special alps trackpoint do not work.
> 
> Hello!
> 
> On Tuesday 21 May 2019 10:26:47 Hui Wang wrote:
> > Tested-by: Hui Wang <hui.wang@canonical.com>
> > 
> > On 2019/5/21 上午9:07, Xiaoxiao Liu wrote:
> > > Add Pali Rohár.
> > > 
> > > -----邮件原件-----
> > > 发件人: XiaoXiao Liu <sliuuxiaonxiao@gmail.com>
> > > 发送时间: Monday, May 20, 2019 7:02 PM
> > > 收件人: dmitry.torokhov@gmail.com
> > > 抄送: linux-input@vger.kernel.org; linux-kernel@vger.kernel.org; 
> > > hui.wang@canonical.com; 曹 曉建 Xiaojian Cao 
> > > <xiaojian.cao@cn.alps.com>; zhangfp1@lenovo.com; 劉 曉曉 Xiaoxiao Liu 
> > > <xiaoxiao.liu-1@cn.alps.com>; XiaoXiao Liu 
> > > <sliuuxiaonxiao@gmail.com>
> > > 主题: [PATCH] input: alps-fix the issue the special alps trackpoint do not work.
> > > 
> > > when the alps trackpoint is detected and using the 
> > > alps_v8_protocol_data procotol, the alps driver will not report the input data.
> 
> Why it does not report input data?
> 
> > > solution: use standard mouse driver instead of alps driver when the specail trackpoint was detected.
> 
> This looks like an (undocumented) hack or workaround. Not a solution.
> 
> > > Signed-off-by: XiaoXiao Liu <sliuuxiaonxiao@gmail.com>
> > > ---
> > >   drivers/input/mouse/alps.c | 23 ++++++++++++++++++++++-
> > >   1 file changed, 22 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/input/mouse/alps.c 
> > > b/drivers/input/mouse/alps.c index 0a6f7ca883e7..516ae1d0eb17 
> > > 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
> > >    */
> > > @@ -2864,6 +2864,22 @@ static const struct alps_protocol_info *alps_match_table(unsigned char *e7,
> > >   	return NULL;
> > >   }
> > > +int alps_check_is_trackpoint(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)
> > > +		return 0;
> > > +	psmouse_warn(psmouse, "It is not alps trackpoint.\n");
> > > +	return -ENODEV;
> > > +}
> 
> So, this function returns 0 when detected ALPS trackpoint and -ENODEV when not.
> 
> > > +
> > >   static int alps_identify(struct psmouse *psmouse, struct alps_data *priv)  {
> > >   	const struct alps_protocol_info *protocol; @@ -2912,6 +2928,11 @@ static int alps_identify(struct psmouse *psmouse, struct alps_data *priv)
> > >   			protocol = &alps_v3_protocol_data;
> > >   		} else if (e7[0] == 0x73 && e7[1] == 0x03 &&
> > >   			   (e7[2] == 0x14 || e7[2] == 0x28)) {
> > > +				if (alps_check_is_trackpoint(psmouse) == 0) {
> > > +					psmouse_warn(psmouse,
> > > +					"It is alps trackpoint, use the standard mouse driver.\n");
> > > +					return -EINVAL;
> 
> And here I'm lost. If we have *not* detected ALPS trackpoint then if block is not called which means that ALPS driver is used.
> 
> So why is for non-ALPS trackpoints used ALPS driver? This does not seem like a correct...
> 
> And when we have detected ALPS trackpoint (return value 0) then standard mouse driver is used and returned -EINVAL. This seems strange too.
> 
> So either this code is wrong or there are missing more details for explaining this strange logic. But still this looks like a hack not a proper fix/solution.
> 
> > > +				}
> > >   			protocol = &alps_v8_protocol_data;
> > >   		} else if (e7[0] == 0x73 && e7[1] == 0x03 && e7[2] == 0xc8) {
> > >   			protocol = &alps_v9_protocol_data;
> > > --
> > > 2.20.1
> > > 
> 
> --
> Pali Rohár
> pali.rohar@gmail.com

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

  reply	other threads:[~2019-05-22  7:30 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-20 11:01 [PATCH] input: alps-fix the issue the special alps trackpoint do not work XiaoXiao Liu
2019-05-21  1:07 ` 答复: " Xiaoxiao Liu
2019-05-21  2:26   ` Hui Wang
2019-05-21  9:46     ` Pali Rohár
2019-05-22  2:53       ` 答复: " Xiaoxiao Liu
2019-05-22  6:35         ` Pali Rohár
2019-05-22  7:30           ` Xiaoxiao Liu [this message]
2019-05-22  7:40             ` 答复: " Pali Rohár
2019-05-23  6:01               ` Peter Hutterer
2019-05-24  5:25                 ` Hui Wang
2019-05-24  5:36                   ` Peter Hutterer
2019-05-24  5:50                     ` Hui Wang
2019-05-24  7:26                       ` Pali Rohár
2019-05-24  7:37                         ` Hui Wang
2019-05-24  9:37                           ` Peter Hutterer
     [not found]                             ` <f0c2dff9-519e-d54d-4cd0-2be666656dc2@canonical.com>
2019-05-24 10:58                               ` Peter Hutterer
2019-05-25  1:33                                 ` Hui Wang
2019-05-24  9:32                         ` Peter Hutterer
2019-05-24  9:52                           ` Pali Rohár

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=OSBPR01MB48550B43F78BBFBDC20D414DDA000@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=pali.rohar@gmail.com \
    --cc=sliuuxiaonxiao@gmail.com \
    --cc=xiaojian.cao@cn.alps.com \
    --cc=zhangfp1@lenovo.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).