All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Input: elantech - reset touchpad before configuration
@ 2012-04-05  7:46 JJ Ding
  2012-04-05  7:46 ` [PATCH 2/2] Input: elantech - v4 is clickpad, with only one button JJ Ding
  0 siblings, 1 reply; 5+ messages in thread
From: JJ Ding @ 2012-04-05  7:46 UTC (permalink / raw)
  To: Dmitry Torokhov, Chase Douglas, linux-input; +Cc: JJ Ding

I got a bug report saying for Acer VH40, there is a Fn key to toggle touchpad
on and off, but it's implemented in system firmware, and the EC chip has to
recieve reset command to activate this function. Also for this machine, when
it wakes up after resume, psmouse_reset is nesassary to bring the touchpad
back on.

With my testing this behavior should be OK on all machines, and synaptics.c
does the same thing.

Signed-off-by: JJ Ding <jj_ding@emc.com.tw>
---
 drivers/input/mouse/elantech.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index d2c0db1..21c68a8 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -1245,6 +1245,8 @@ static void elantech_disconnect(struct psmouse *psmouse)
  */
 static int elantech_reconnect(struct psmouse *psmouse)
 {
+	psmouse_reset(psmouse);
+
 	if (elantech_detect(psmouse, 0))
 		return -1;
 
@@ -1324,6 +1326,8 @@ int elantech_init(struct psmouse *psmouse)
 	if (!etd)
 		return -ENOMEM;
 
+	psmouse_reset(psmouse);
+
 	etd->parity[0] = 1;
 	for (i = 1; i < 256; i++)
 		etd->parity[i] = etd->parity[i & (i - 1)] ^ 1;
-- 
1.7.10.rc1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] Input: elantech - v4 is clickpad, with only one button
  2012-04-05  7:46 [PATCH 1/2] Input: elantech - reset touchpad before configuration JJ Ding
@ 2012-04-05  7:46 ` JJ Ding
  2012-04-06 14:13   ` Chase Douglas
  0 siblings, 1 reply; 5+ messages in thread
From: JJ Ding @ 2012-04-05  7:46 UTC (permalink / raw)
  To: Dmitry Torokhov, Chase Douglas, linux-input; +Cc: JJ Ding

Add pointer and buttonpad properties for v4 hardware.

Also, Jachiet reported that on Asus UX31, right button has no effect. It
turns out v4 has only one button, the right-button effect is implemented
with software when Windows driver is installed, or in firmware when touchpad
is in relative mode. So remove BTN_RIGHT while at it.

Reported-by: Jachiet Louis <louis@jachiet.com>
Signed-off-by: JJ Ding <jj_ding@emc.com.tw>
---
 drivers/input/mouse/elantech.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index 21c68a8..4790110 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -486,7 +486,6 @@ static void elantech_input_sync_v4(struct psmouse *psmouse)
 	unsigned char *packet = psmouse->packet;
 
 	input_report_key(dev, BTN_LEFT, packet[0] & 0x01);
-	input_report_key(dev, BTN_RIGHT, packet[0] & 0x02);
 	input_mt_report_pointer_emulation(dev, true);
 	input_sync(dev);
 }
@@ -967,6 +966,7 @@ static int elantech_set_input_params(struct psmouse *psmouse)
 	if (elantech_set_range(psmouse, &x_min, &y_min, &x_max, &y_max, &width))
 		return -1;
 
+	__set_bit(INPUT_PROP_POINTER, dev->propbit);
 	__set_bit(EV_KEY, dev->evbit);
 	__set_bit(EV_ABS, dev->evbit);
 	__clear_bit(EV_REL, dev->evbit);
@@ -1017,7 +1017,9 @@ static int elantech_set_input_params(struct psmouse *psmouse)
 			 */
 			psmouse_warn(psmouse, "couldn't query resolution data.\n");
 		}
-
+		/* v4 is clickpad, with only one button. */
+		__set_bit(INPUT_PROP_BUTTONPAD, dev->propbit);
+		__clear_bit(BTN_RIGHT, dev->keybit);
 		__set_bit(BTN_TOOL_QUADTAP, dev->keybit);
 		/* For X to recognize me as touchpad. */
 		input_set_abs_params(dev, ABS_X, x_min, x_max, 0, 0);
-- 
1.7.10.rc1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] Input: elantech - v4 is clickpad, with only one button
  2012-04-05  7:46 ` [PATCH 2/2] Input: elantech - v4 is clickpad, with only one button JJ Ding
@ 2012-04-06 14:13   ` Chase Douglas
  2012-04-09  3:49     ` JJ Ding
  0 siblings, 1 reply; 5+ messages in thread
From: Chase Douglas @ 2012-04-06 14:13 UTC (permalink / raw)
  To: JJ Ding; +Cc: Dmitry Torokhov, linux-input

On 04/05/2012 12:46 AM, JJ Ding wrote:
> Add pointer and buttonpad properties for v4 hardware.
> 
> Also, Jachiet reported that on Asus UX31, right button has no effect. It
> turns out v4 has only one button, the right-button effect is implemented
> with software when Windows driver is installed, or in firmware when touchpad
> is in relative mode. So remove BTN_RIGHT while at it.
> 
> Reported-by: Jachiet Louis <louis@jachiet.com>
> Signed-off-by: JJ Ding <jj_ding@emc.com.tw>
> ---
>  drivers/input/mouse/elantech.c |    6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
> index 21c68a8..4790110 100644
> --- a/drivers/input/mouse/elantech.c
> +++ b/drivers/input/mouse/elantech.c
> @@ -486,7 +486,6 @@ static void elantech_input_sync_v4(struct psmouse *psmouse)
>  	unsigned char *packet = psmouse->packet;
>  
>  	input_report_key(dev, BTN_LEFT, packet[0] & 0x01);
> -	input_report_key(dev, BTN_RIGHT, packet[0] & 0x02);
>  	input_mt_report_pointer_emulation(dev, true);
>  	input_sync(dev);
>  }
> @@ -967,6 +966,7 @@ static int elantech_set_input_params(struct psmouse *psmouse)
>  	if (elantech_set_range(psmouse, &x_min, &y_min, &x_max, &y_max, &width))
>  		return -1;
>  
> +	__set_bit(INPUT_PROP_POINTER, dev->propbit);
>  	__set_bit(EV_KEY, dev->evbit);
>  	__set_bit(EV_ABS, dev->evbit);
>  	__clear_bit(EV_REL, dev->evbit);
> @@ -1017,7 +1017,9 @@ static int elantech_set_input_params(struct psmouse *psmouse)
>  			 */
>  			psmouse_warn(psmouse, "couldn't query resolution data.\n");
>  		}
> -
> +		/* v4 is clickpad, with only one button. */
> +		__set_bit(INPUT_PROP_BUTTONPAD, dev->propbit);
> +		__clear_bit(BTN_RIGHT, dev->keybit);
>  		__set_bit(BTN_TOOL_QUADTAP, dev->keybit);
>  		/* For X to recognize me as touchpad. */
>  		input_set_abs_params(dev, ABS_X, x_min, x_max, 0, 0);

Looks good to me :).

Reviewed-by: Chase Douglas <chase.douglas@canonical.com>

Thanks JJ!

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] Input: elantech - v4 is clickpad, with only one button
  2012-04-06 14:13   ` Chase Douglas
@ 2012-04-09  3:49     ` JJ Ding
  2012-04-10  7:41       ` Dmitry Torokhov
  0 siblings, 1 reply; 5+ messages in thread
From: JJ Ding @ 2012-04-09  3:49 UTC (permalink / raw)
  To: Chase Douglas; +Cc: Dmitry Torokhov, linux-input


On Fri, 06 Apr 2012 07:13:26 -0700, Chase Douglas <chase.douglas@canonical.com> wrote:
> 
> Looks good to me :).
> 
> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
> 
> Thanks JJ!

Thanks for your review, Chase!

Dmitry, are these two patches look OK to you?

Thank you.

-JJ

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] Input: elantech - v4 is clickpad, with only one button
  2012-04-09  3:49     ` JJ Ding
@ 2012-04-10  7:41       ` Dmitry Torokhov
  0 siblings, 0 replies; 5+ messages in thread
From: Dmitry Torokhov @ 2012-04-10  7:41 UTC (permalink / raw)
  To: JJ Ding; +Cc: Chase Douglas, linux-input

On Mon, Apr 09, 2012 at 11:49:55AM +0800, JJ Ding wrote:
> 
> On Fri, 06 Apr 2012 07:13:26 -0700, Chase Douglas <chase.douglas@canonical.com> wrote:
> > 
> > Looks good to me :).
> > 
> > Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
> > 
> > Thanks JJ!
> 
> Thanks for your review, Chase!
> 
> Dmitry, are these two patches look OK to you?

Applied both, thanks JJ.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-04-10  7:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-05  7:46 [PATCH 1/2] Input: elantech - reset touchpad before configuration JJ Ding
2012-04-05  7:46 ` [PATCH 2/2] Input: elantech - v4 is clickpad, with only one button JJ Ding
2012-04-06 14:13   ` Chase Douglas
2012-04-09  3:49     ` JJ Ding
2012-04-10  7:41       ` Dmitry Torokhov

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.