diff mbox

[3/5] Input: elantech - report the middle button of the touchpad

Message ID 1409407846-15449-4-git-send-email-ulrik.debie-os@e2big.org (mailing list archive)
State New, archived
Headers show

Commit Message

Ulrik De Bie Aug. 30, 2014, 2:10 p.m. UTC
In the past, no elantech was known with 3 touchpad mouse buttons.
Fujitsu H730 is the first known elantech with a middle button. This commit
enables this middle button.

Reported-by: Stefan Valouch <stefan@valouch.com>
Tested-by: Stefan Valouch <stefan@valouch.com>
Tested-by: Alfredo Gemma <alfredo.gemma@gmail.com>
Signed-off-by: Ulrik De Bie <ulrik.debie-os@e2big.org>
---
 drivers/input/mouse/elantech.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Dmitry Torokhov Nov. 8, 2014, 8:23 a.m. UTC | #1
On Sat, Aug 30, 2014 at 04:10:44PM +0200, Ulrik De Bie wrote:
> In the past, no elantech was known with 3 touchpad mouse buttons.
> Fujitsu H730 is the first known elantech with a middle button. This commit
> enables this middle button.
> 
> Reported-by: Stefan Valouch <stefan@valouch.com>
> Tested-by: Stefan Valouch <stefan@valouch.com>
> Tested-by: Alfredo Gemma <alfredo.gemma@gmail.com>
> Signed-off-by: Ulrik De Bie <ulrik.debie-os@e2big.org>
> ---
>  drivers/input/mouse/elantech.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
> index 67d56c0..e86bbd7 100644
> --- a/drivers/input/mouse/elantech.c
> +++ b/drivers/input/mouse/elantech.c
> @@ -563,6 +563,7 @@ static void elantech_input_sync_v4(struct psmouse *psmouse)
>  	} else {
>  		input_report_key(dev, BTN_LEFT, packet[0] & 0x01);
>  		input_report_key(dev, BTN_RIGHT, packet[0] & 0x02);
> +		input_report_key(dev, BTN_MIDDLE, packet[0] & 0x04);
>  	}
>  
>  	input_mt_report_pointer_emulation(dev, true);
> @@ -1150,6 +1151,7 @@ static int elantech_set_input_params(struct psmouse *psmouse)
>  	__clear_bit(EV_REL, dev->evbit);
>  
>  	__set_bit(BTN_LEFT, dev->keybit);
> +	__set_bit(BTN_MIDDLE, dev->keybit);

No, we should not advertise presence of middle button unconditionally. I
guess we need another DMI, at least for now.

>  	__set_bit(BTN_RIGHT, dev->keybit);
>  
>  	__set_bit(BTN_TOUCH, dev->keybit);
> -- 
> 2.1.0
> 

Thanks.
Ulrik De Bie Nov. 9, 2014, 9:38 p.m. UTC | #2
This is an update of patch 3/5,4/5,5/5 of my previous submission.
If content looks good, I'll ask the testers to retest this modification.

The patch "report the middle button of the touchpad" is now made conditional
on the dmi check for the announcement of the middle button.

The patch "provide a sysfs knob for crc_enabled" is now simply 0/1, the autodetect is removed.

The patch "Update the documentation: trackpoint,v3/v4,crc_enabled" is now
updated according to those changes


Ulrik De Bie (3):
  Input: elantech - report the middle button of the touchpad
  Input: elantech - provide a sysfs knob for crc_enabled
  Input: elantech - Update the documentation:
    trackpoint,v3/v4,crc_enabled

 Documentation/input/elantech.txt | 82 +++++++++++++++++++++++++++++++++++++---
 drivers/input/mouse/elantech.c   | 21 ++++++++++
 2 files changed, 97 insertions(+), 6 deletions(-)
diff mbox

Patch

diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index 67d56c0..e86bbd7 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -563,6 +563,7 @@  static void elantech_input_sync_v4(struct psmouse *psmouse)
 	} else {
 		input_report_key(dev, BTN_LEFT, packet[0] & 0x01);
 		input_report_key(dev, BTN_RIGHT, packet[0] & 0x02);
+		input_report_key(dev, BTN_MIDDLE, packet[0] & 0x04);
 	}
 
 	input_mt_report_pointer_emulation(dev, true);
@@ -1150,6 +1151,7 @@  static int elantech_set_input_params(struct psmouse *psmouse)
 	__clear_bit(EV_REL, dev->evbit);
 
 	__set_bit(BTN_LEFT, dev->keybit);
+	__set_bit(BTN_MIDDLE, dev->keybit);
 	__set_bit(BTN_RIGHT, dev->keybit);
 
 	__set_bit(BTN_TOUCH, dev->keybit);