[PATCH xf86-input-synaptics v3 1/2] Add MODEL_UNIBODY_MACBOOK touchpad model for bcm5974 devices

Chase Douglas chase.douglas at canonical.com
Fri Jun 8 13:53:37 PDT 2012


Initially, treat them the same as MODEL_APPLETOUCH devices, as that is
what they were recognized as before.

Signed-off-by: Chase Douglas <chase.douglas at canonical.com>
---
 src/eventcomm.c    |   20 ++++++++++++--------
 src/synaptics.c    |    3 ++-
 src/synapticsstr.h |    3 ++-
 3 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/src/eventcomm.c b/src/eventcomm.c
index f253205..f6c9070 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -279,17 +279,19 @@ event_query_is_touchpad(int fd, BOOL test_grab)
 
 struct model_lookup_t {
     short vendor;
-    short product;
+    short product_start;
+    short product_end;
     enum TouchpadModel model;
 };
 
 
 static struct model_lookup_t model_lookup_table[] = {
-    {0x0002, 0x0007, MODEL_SYNAPTICS},
-    {0x0002, 0x0008, MODEL_ALPS},
-    {0x05ac, PRODUCT_ANY, MODEL_APPLETOUCH},
-    {0x0002, 0x000e, MODEL_ELANTECH},
-    {0x0, 0x0, 0x0}
+    {0x0002, 0x0007, 0x0007, MODEL_SYNAPTICS},
+    {0x0002, 0x0008, 0x0008, MODEL_ALPS},
+    {0x05ac, PRODUCT_ANY, 0x222, MODEL_APPLETOUCH},
+    {0x05ac, 0x223, PRODUCT_ANY, MODEL_UNIBODY_MACBOOK},
+    {0x0002, 0x000e, 0x000e, MODEL_ELANTECH},
+    {0x0, 0x0, 0x0, 0x0}
 };
 
 /**
@@ -317,8 +319,10 @@ event_query_model(int fd, enum TouchpadModel *model_out,
     for (model_lookup = model_lookup_table; model_lookup->vendor;
          model_lookup++) {
         if (model_lookup->vendor == id.vendor &&
-            (model_lookup->product == id.product ||
-             model_lookup->product == PRODUCT_ANY))
+            (model_lookup->product_start == PRODUCT_ANY ||
+             model_lookup->product_start <= id.product) &&
+            (model_lookup->product_end == PRODUCT_ANY ||
+             model_lookup->product_end >= id.product))
             *model_out = model_lookup->model;
     }
 
diff --git a/src/synaptics.c b/src/synaptics.c
index b7d23b7..68d35e8 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -299,7 +299,8 @@ calculate_edge_widths(SynapticsPrivate * priv, int *l, int *r, int *t, int *b)
         ewidth = width * .15;
         eheight = height * .15;
     }
-    else if (priv->model == MODEL_APPLETOUCH) {
+    else if (priv->model == MODEL_APPLETOUCH ||
+             priv->model == MODEL_UNIBODY_MACBOOK) {
         ewidth = width * .085;
         eheight = height * .085;
     }
diff --git a/src/synapticsstr.h b/src/synapticsstr.h
index ef7b4f4..0acb2ec 100644
--- a/src/synapticsstr.h
+++ b/src/synapticsstr.h
@@ -123,7 +123,8 @@ enum TouchpadModel {
     MODEL_SYNAPTICS,
     MODEL_ALPS,
     MODEL_APPLETOUCH,
-    MODEL_ELANTECH
+    MODEL_ELANTECH,
+    MODEL_UNIBODY_MACBOOK
 };
 
 typedef struct _SynapticsParameters {
-- 
1.7.9.5



More information about the xorg-devel mailing list