All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Ulrik De Bie <ulrik.debie-os@e2big.org>
Cc: linux-input@vger.kernel.org, Hans de Goede <hdegoede@redhat.com>,
	George Moutsopoulos <gmoutso@yahoo.co.uk>
Subject: Re: [PATCH v1  1/1] Input: elantech - fix absolute mode setting on some Asus touchpads
Date: Wed, 25 Mar 2015 15:52:22 -0700	[thread overview]
Message-ID: <20150325225222.GA17427@dtor-ws> (raw)
In-Reply-To: <1427318875-12142-2-git-send-email-ulrik.debie-os@e2big.org>

Hi Ulrik,

On Wed, Mar 25, 2015 at 10:27:55PM +0100, Ulrik De Bie wrote:
> On Asus TP500LN and X750JN, the touchpad absolute mode is reset each
> time set_rate is done.
> 
> In order to fix this, we will verify the firmware version, and if it
> matches the one in those laptops, the set_rate function is overloaded
> with a function elantech_set_rate_restore_reg_07 that perfoms the
> set_rate with the original function, followed by a restore of reg_07
> (the register that sets the absolute mode on elantech v4 hardware).
> 
> Also the asus TP500LN and X750JN firmware version, capabilities, and
> button constellation is added to elantech.c
> 
> Reported-and-tested-by: George Moutsopoulos <gmoutso@yahoo.co.uk>
> Signed-off-by: Ulrik De Bie <ulrik.debie-os@e2big.org>
> ---
>  drivers/input/mouse/elantech.c | 22 ++++++++++++++++++++++
>  drivers/input/mouse/elantech.h |  1 +
>  2 files changed, 23 insertions(+)
> 
> diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
> index 6e22682..991dc6b 100644
> --- a/drivers/input/mouse/elantech.c
> +++ b/drivers/input/mouse/elantech.c
> @@ -893,6 +893,21 @@ static psmouse_ret_t elantech_process_byte(struct psmouse *psmouse)
>  }
>  
>  /*
> + * This writes the reg_07 value again to the hardware at the end of every
> + * set_rate call because the register loses its value. reg_07 allows setting
> + * absolute mode on v4 hardware
> + */
> +static void elantech_set_rate_restore_reg_07(struct psmouse *psmouse,
> +		unsigned int rate)
> +{
> +	struct elantech_data *etd = psmouse->private;
> +
> +	etd->original_set_rate(psmouse, rate);
> +	if (elantech_write_reg(psmouse, 0x07, etd->reg_07))
> +		psmouse_err(psmouse, "restoring reg_07 failed\n");

I wonder if set rate is useful for Elantech and if it would not be
simpler to just have an empty stub for set_rate, maybe even for all
Elantech devices?

Thanks.

-- 
Dmitry

  reply	other threads:[~2015-03-25 22:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19 22:05 Elantech touchpad does not work on Asus ulrik.debie-os
2015-03-20 16:39 ` Dmitry Torokhov
2015-03-25 20:34   ` ulrik.debie-os
2015-03-25 21:27     ` [PATCH v1 0/1] Input: elantech - fix absolute mode setting on some Asus touchpads cover Ulrik De Bie
2015-03-25 21:27       ` [PATCH v1 1/1] Input: elantech - fix absolute mode setting on some Asus touchpads Ulrik De Bie
2015-03-25 22:52         ` Dmitry Torokhov [this message]
2015-03-26 17:37           ` ulrik.debie-os
2015-04-06 22:38             ` Dmitry Torokhov

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=20150325225222.GA17427@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=gmoutso@yahoo.co.uk \
    --cc=hdegoede@redhat.com \
    --cc=linux-input@vger.kernel.org \
    --cc=ulrik.debie-os@e2big.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.