linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Chris Chiu <chiu@endlessm.com>, kt.liao@emc.com.tw
Cc: Charlie Mooney <charliemooney@chromium.org>,
	Michele Curti <michele.curti@gmail.com>,
	Krzysztof Kozlowski <k.kozlowski@samsung.com>,
	Benson Leung <bleung@chromium.org>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux@endlessm.com
Subject: Re: [PATCH] Input: elan_i2c - +200 ms delay before setting to ABS mode
Date: Mon, 20 Jun 2016 10:42:51 -0700	[thread overview]
Message-ID: <20160620174251.GC22426@dtor-ws> (raw)
In-Reply-To: <1465306449-28256-1-git-send-email-chiu@endlessm.com>

On Tue, Jun 07, 2016 at 09:34:09PM +0800, Chris Chiu wrote:
> When performing a warm reboot from a system which does not correctly
> support ELAN I2C touchpads, the touchpad will sometimes enter standard
> mouse mode, cursor then never respond to touchpad event, and making the
> driver discard the HID reports and flood dmesg with following error
> messages.
> "elan_i2c i2c-ELAN1000:00: invalid report id data (1)"
> 
> This change is from ELAN's correction. It needs 200ms delay before
> set_mode() so that the mode setting will correctly take effect.

KT, is this feasible?

> 
> Signed-off-by: Chris Chiu <chiu@endlessm.com>
> ---
>  drivers/input/mouse/elan_i2c_core.c | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c
> index 2f58985..95080f9 100644
> --- a/drivers/input/mouse/elan_i2c_core.c
> +++ b/drivers/input/mouse/elan_i2c_core.c
> @@ -210,18 +210,20 @@ static int __elan_initialize(struct elan_tp_data *data)
>  		return error;
>  	}
>  
> -	data->mode |= ETP_ENABLE_ABS;
> -	error = data->ops->set_mode(client, data->mode);
> +	error = data->ops->sleep_control(client, false);
>  	if (error) {
>  		dev_err(&client->dev,
> -			"failed to switch to absolute mode: %d\n", error);
> +			"failed to wake device up: %d\n", error);
>  		return error;
>  	}
>  
> -	error = data->ops->sleep_control(client, false);
> +	msleep(200);
> +
> +	data->mode |= ETP_ENABLE_ABS;
> +	error = data->ops->set_mode(client, data->mode);
>  	if (error) {
>  		dev_err(&client->dev,
> -			"failed to wake device up: %d\n", error);
> +			"failed to switch to absolute mode: %d\n", error);
>  		return error;
>  	}
>  
> -- 
> 2.1.4
> 

Thanks.

-- 
Dmitry

  reply	other threads:[~2016-06-20 17:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-07 13:34 [PATCH] Input: elan_i2c - +200 ms delay before setting to ABS mode Chris Chiu
2016-06-20 17:42 ` Dmitry Torokhov [this message]
2016-06-21  1:31   ` 廖崇榮
2016-06-21 12:40   ` 廖崇榮
2016-06-21 14:42     ` Daniel Drake
2016-06-22 12:00       ` 廖崇榮
2016-06-28  1:41       ` 廖崇榮

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=20160620174251.GC22426@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=bleung@chromium.org \
    --cc=charliemooney@chromium.org \
    --cc=chiu@endlessm.com \
    --cc=k.kozlowski@samsung.com \
    --cc=kt.liao@emc.com.tw \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@endlessm.com \
    --cc=michele.curti@gmail.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).