Patchwork [Maverick,SRU] Revert "UBUNTU: (pre-stable): input: Support Clickpad devices in ClickZone mode"

login
register
mail settings
Submitter Robert Hooker
Date Dec. 14, 2010, 9:48 p.m.
Message ID <1292363299-5647-1-git-send-email-sarvatt@ubuntu.com>
Download mbox | patch
Permalink /patch/75571/
State Accepted
Headers show

Comments

Robert Hooker - Dec. 14, 2010, 9:48 p.m.
From: Robert Hooker <robert.hooker@canonical.com>

BugLink: http://bugs.launchpad.net/bugs/669399

This reverts commit da04c34f6499177fb0cdafafa04af38c36b11639. 

This patch was never adopted by upstream and is non-functional on
maverick in it's current incarnation (LP: #582809). The improper checks
for SYN_CAP_CLICKPAD(priv->ext_cap) instead of 
SYN_CAP_CLICKPAD(priv->ext_cap_0c) in the maverick version of this patch
are also causing incorrect detection of a non-clickpad touchpad as a
clickpad one and applying the filters which remove the bottom area of
the touchpad. This revert only applies to maverick, lucid works properly
due to not having 5f57d67da87332a9a1ba8fa7a33bf0680e1c76e7 and this
commit was already dropped in natty.

Signed-off-by: Robert Hooker <robert.hooker@canonical.com>
---
 drivers/input/mouse/synaptics.c |   48 ---------------------------------------
 drivers/input/mouse/synaptics.h |    1 -
 2 files changed, 0 insertions(+), 49 deletions(-)
Robert Hooker - Dec. 14, 2010, 10:04 p.m.
The alternative is fixing the patch itself which fixes both problems
without any loss of functionality from lucid->maverick but the
functionality will be gone in natty. I was advised that reverting
would be prefered, but in case its not a refreshed patch follows.
Brad Figg - Dec. 16, 2010, 5:31 a.m.
On 12/14/2010 01:48 PM, Robert Hooker wrote:
> From: Robert Hooker<robert.hooker@canonical.com>
>
> BugLink: http://bugs.launchpad.net/bugs/669399
>
> This reverts commit da04c34f6499177fb0cdafafa04af38c36b11639.
>
> This patch was never adopted by upstream and is non-functional on
> maverick in it's current incarnation (LP: #582809). The improper checks
> for SYN_CAP_CLICKPAD(priv->ext_cap) instead of
> SYN_CAP_CLICKPAD(priv->ext_cap_0c) in the maverick version of this patch
> are also causing incorrect detection of a non-clickpad touchpad as a
> clickpad one and applying the filters which remove the bottom area of
> the touchpad. This revert only applies to maverick, lucid works properly
> due to not having 5f57d67da87332a9a1ba8fa7a33bf0680e1c76e7 and this
> commit was already dropped in natty.
>
> Signed-off-by: Robert Hooker<robert.hooker@canonical.com>
> ---
>   drivers/input/mouse/synaptics.c |   48 ---------------------------------------
>   drivers/input/mouse/synaptics.h |    1 -
>   2 files changed, 0 insertions(+), 49 deletions(-)
>
> diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
> index ae9891c..705589d 100644
> --- a/drivers/input/mouse/synaptics.c
> +++ b/drivers/input/mouse/synaptics.c
> @@ -357,45 +357,6 @@ static void synaptics_pt_create(struct psmouse *psmouse)
>    *	Functions to interpret the absolute mode packets
>    ****************************************************************************/
>
> -/* left and right clickpad button ranges;
> - * the gap between them is interpreted as a middle-button click
> - */
> -#define CLICKPAD_LEFT_BTN_X \
> -	((XMAX_NOMINAL - XMIN_NOMINAL) * 2 / 5 + XMIN_NOMINAL)
> -#define CLICKPAD_RIGHT_BTN_X \
> -	((XMAX_NOMINAL - XMIN_NOMINAL) * 3 / 5 + XMIN_NOMINAL)
> -
> -/* handle clickpad events */
> -static void clickpad_process_packet(struct synaptics_data *priv,
> -				    struct synaptics_hw_state *hw)
> -{
> -	/* clickpad mode reports Y range from 0 to YMAX_NOMINAL,
> -	 * where the area Y<  YMIN_NOMINAL is used as click buttons
> -	 */
> -	if (hw->y<  YMIN_NOMINAL) {
> -		/* button area */
> -		hw->z = 0; /* don't move pointer */
> -		/* clickpad reports only the middle button, and we need
> -		 * to fake left/right buttons depending on the touch position
> -		 */
> -		if (hw->middle) { /* clicked? */
> -			hw->middle = 0;
> -			if (hw->x<  CLICKPAD_LEFT_BTN_X)
> -				hw->left = 1;
> -			else if (hw->x>  CLICKPAD_RIGHT_BTN_X)
> -				hw->right = 1;
> -			else
> -				hw->middle = 1;
> -		}
> -	} else if (hw->middle) {
> -		/* dragging */
> -		hw->left = priv->prev_hw.left;
> -		hw->right = priv->prev_hw.right;
> -		hw->middle = priv->prev_hw.middle;
> -	}
> -	priv->prev_hw = *hw;
> -}
> -
>   static void synaptics_parse_hw_state(unsigned char buf[], struct synaptics_data *priv, struct synaptics_hw_state *hw)
>   {
>   	memset(hw, 0, sizeof(struct synaptics_hw_state));
> @@ -484,9 +445,6 @@ static void synaptics_process_packet(struct psmouse *psmouse)
>
>   	synaptics_parse_hw_state(psmouse->packet, priv,&hw);
>
> -	if (SYN_CAP_CLICKPAD(priv->ext_cap))
> -		clickpad_process_packet(priv,&hw);
> -
>   	if (hw.scroll) {
>   		priv->scroll += hw.scroll;
>
> @@ -790,12 +748,6 @@ int synaptics_init(struct psmouse *psmouse)
>   		SYN_ID_MAJOR(priv->identity), SYN_ID_MINOR(priv->identity),
>   		priv->model_id, priv->capabilities, priv->ext_cap, priv->ext_cap_0c);
>
> -	if (SYN_CAP_CLICKPAD(priv->ext_cap)) {
> -		printk(KERN_INFO "Synaptics: Clickpad mode enabled\n");
> -		/* force to enable the middle button */
> -		priv->capabilities |= (1<<  18);
> -	}
> -
>   	set_input_params(psmouse->dev, priv);
>
>   	/*
> diff --git a/drivers/input/mouse/synaptics.h b/drivers/input/mouse/synaptics.h
> index 80907d0..b6aa7d2 100644
> --- a/drivers/input/mouse/synaptics.h
> +++ b/drivers/input/mouse/synaptics.h
> @@ -110,7 +110,6 @@ struct synaptics_data {
>   	unsigned char pkt_type;			/* packet type - old, new, etc */
>   	unsigned char mode;			/* current mode byte */
>   	int scroll;
> -	struct synaptics_hw_state prev_hw;
>   };
>
>   void synaptics_module_init(void);

Applied and pushed to Maverick master-next

Patch

diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index ae9891c..705589d 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -357,45 +357,6 @@  static void synaptics_pt_create(struct psmouse *psmouse)
  *	Functions to interpret the absolute mode packets
  ****************************************************************************/
 
-/* left and right clickpad button ranges;
- * the gap between them is interpreted as a middle-button click
- */
-#define CLICKPAD_LEFT_BTN_X \
-	((XMAX_NOMINAL - XMIN_NOMINAL) * 2 / 5 + XMIN_NOMINAL)
-#define CLICKPAD_RIGHT_BTN_X \
-	((XMAX_NOMINAL - XMIN_NOMINAL) * 3 / 5 + XMIN_NOMINAL)
-
-/* handle clickpad events */
-static void clickpad_process_packet(struct synaptics_data *priv,
-				    struct synaptics_hw_state *hw)
-{
-	/* clickpad mode reports Y range from 0 to YMAX_NOMINAL,
-	 * where the area Y < YMIN_NOMINAL is used as click buttons
-	 */
-	if (hw->y < YMIN_NOMINAL) {
-		/* button area */
-		hw->z = 0; /* don't move pointer */
-		/* clickpad reports only the middle button, and we need
-		 * to fake left/right buttons depending on the touch position
-		 */
-		if (hw->middle) { /* clicked? */
-			hw->middle = 0;
-			if (hw->x < CLICKPAD_LEFT_BTN_X)
-				hw->left = 1;
-			else if (hw->x > CLICKPAD_RIGHT_BTN_X)
-				hw->right = 1;
-			else
-				hw->middle = 1;
-		}
-	} else if (hw->middle) {
-		/* dragging */
-		hw->left = priv->prev_hw.left;
-		hw->right = priv->prev_hw.right;
-		hw->middle = priv->prev_hw.middle;
-	}
-	priv->prev_hw = *hw;
-}
-
 static void synaptics_parse_hw_state(unsigned char buf[], struct synaptics_data *priv, struct synaptics_hw_state *hw)
 {
 	memset(hw, 0, sizeof(struct synaptics_hw_state));
@@ -484,9 +445,6 @@  static void synaptics_process_packet(struct psmouse *psmouse)
 
 	synaptics_parse_hw_state(psmouse->packet, priv, &hw);
 
-	if (SYN_CAP_CLICKPAD(priv->ext_cap))
-		clickpad_process_packet(priv, &hw);
-
 	if (hw.scroll) {
 		priv->scroll += hw.scroll;
 
@@ -790,12 +748,6 @@  int synaptics_init(struct psmouse *psmouse)
 		SYN_ID_MAJOR(priv->identity), SYN_ID_MINOR(priv->identity),
 		priv->model_id, priv->capabilities, priv->ext_cap, priv->ext_cap_0c);
 
-	if (SYN_CAP_CLICKPAD(priv->ext_cap)) {
-		printk(KERN_INFO "Synaptics: Clickpad mode enabled\n");
-		/* force to enable the middle button */
-		priv->capabilities |= (1 << 18);
-	}
-
 	set_input_params(psmouse->dev, priv);
 
 	/*
diff --git a/drivers/input/mouse/synaptics.h b/drivers/input/mouse/synaptics.h
index 80907d0..b6aa7d2 100644
--- a/drivers/input/mouse/synaptics.h
+++ b/drivers/input/mouse/synaptics.h
@@ -110,7 +110,6 @@  struct synaptics_data {
 	unsigned char pkt_type;			/* packet type - old, new, etc */
 	unsigned char mode;			/* current mode byte */
 	int scroll;
-	struct synaptics_hw_state prev_hw;
 };
 
 void synaptics_module_init(void);