linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali.rohar@gmail.com>
To: Masaki Ota <012nexus@gmail.com>, dmitry.torokhov@gmail.com
Cc: benjamin.tissoires@redhat.com, aaron.ma@canonical.com,
	jaak@ristioja.ee, masaki.ota@jp.alps.com,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Support TrackStick of Thinkpad L570
Date: Mon, 20 Nov 2017 09:29:42 +0100	[thread overview]
Message-ID: <20171120082942.hgvxguc6vjusi52k@pali> (raw)
In-Reply-To: <20171120075530.4880-1-masaki.ota@jp.alps.com>

On Monday 20 November 2017 16:55:30 Masaki Ota wrote:
> From: Masaki Ota <masaki.ota@jp.alps.com>
> - The issue is that Thinkpad L570 TrackStick does not work. Because the main interface of Thinkpad L570 device is SMBus, so ALPS overlooked PS2 interface Firmware setting of TrackStick. The detail is that TrackStick otp bit is disabled.
> - Add the code that checks 0xD7 address value. This value is device number information, so we can identify the device by checking this value.
> - If we check 0xD7 value, we need to enable Command mode and after check the value we need to disable Command mode, then we have to enable the device(0xF4 command).
> - Thinkpad L570 device number is 0x0C or 0x1D. If it is TRUE, enable ALPS_DUALPOINT flag.

So, the root of this problem is in ALPS firmware which provides wrong
information to kernel?

Masaki, I have two questions:

1) Can ALPS or Lenovo release a new firmware update for this Thinkpad to
   fix this issue?

2) Have all Thinkpad L570 machines trackpoint?

Dmitry, as a workaround for firmware bug on particular notebook, would
not be better to check DMI information and DMI based hook?

> Signed-off-by: Masaki Ota <masaki.ota@jp.alps.com>
> ---
>  drivers/input/mouse/alps.c | 21 ++++++++++++++++++---
>  1 file changed, 18 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
> index 850b00e3ad8e..cce52104ed5a 100644
> --- a/drivers/input/mouse/alps.c
> +++ b/drivers/input/mouse/alps.c
> @@ -2541,13 +2541,28 @@ static int alps_update_btn_info_ss4_v2(unsigned char otp[][4],
>  }
>  
>  static int alps_update_dual_info_ss4_v2(unsigned char otp[][4],
> -				       struct alps_data *priv)
> +				       struct alps_data *priv,
> +					struct psmouse *psmouse)
>  {
>  	bool is_dual = false;
> +	int reg_val = 0;
> +	struct ps2dev *ps2dev = &psmouse->ps2dev;
>  
> -	if (IS_SS4PLUS_DEV(priv->dev_id))
> +	if (IS_SS4PLUS_DEV(priv->dev_id)) {
>  		is_dual = (otp[0][0] >> 4) & 0x01;
>  
> +		/* For support TrackStick of Thinkpad L570 device */
> +		if (alps_exit_command_mode(psmouse) == 0 &&
> +			alps_enter_command_mode(psmouse) == 0) {
> +			reg_val = alps_command_mode_read_reg(psmouse, 0xD7);
> +		}
> +		alps_exit_command_mode(psmouse);
> +		ps2_command(ps2dev, NULL, PSMOUSE_CMD_ENABLE);
> +
> +		if (reg_val == 0x0C || reg_val == 0x1D)
> +			is_dual = true;
> +	}
> +
>  	if (is_dual)
>  		priv->flags |= ALPS_DUALPOINT |
>  					ALPS_DUALPOINT_WITH_PRESSURE;
> @@ -2570,7 +2585,7 @@ static int alps_set_defaults_ss4_v2(struct psmouse *psmouse,
>  
>  	alps_update_btn_info_ss4_v2(otp, priv);
>  
> -	alps_update_dual_info_ss4_v2(otp, priv);
> +	alps_update_dual_info_ss4_v2(otp, priv, psmouse);
>  
>  	return 0;
>  }

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

  reply	other threads:[~2017-11-20  8:29 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-20  7:55 [PATCH] Support TrackStick of Thinkpad L570 Masaki Ota
2017-11-20  8:29 ` Pali Rohár [this message]
2017-11-20  8:43   ` Masaki Ota
2018-02-12 22:25     ` Pali Rohár
2017-11-20 15:03 ` Aaron Ma
2017-11-23 10:06 ` Jonathan Liu
2017-11-26  0:15 ` [PATCH] " Dmitry Torokhov
2017-11-29  0:28   ` Masaki Ota
2017-11-26  0:20 ` Dmitry Torokhov
2017-11-29  7:01 Masaki Ota
2017-11-29  8:16 ` Pali Rohár
2017-11-29  8:33 Masaki Ota
2017-11-30  7:55 ` Aaron Ma
2017-12-01 21:07 ` Pali Rohár
2017-12-04  4:48   ` Masaki Ota
2017-12-04  9:11     ` Pali Rohár
2017-12-04  9:40       ` Masaki Ota
2017-12-04  9:50         ` Pali Rohár
2017-12-05  8:29           ` Masaki Ota

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=20171120082942.hgvxguc6vjusi52k@pali \
    --to=pali.rohar@gmail.com \
    --cc=012nexus@gmail.com \
    --cc=aaron.ma@canonical.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jaak@ristioja.ee \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masaki.ota@jp.alps.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).