diff options
author | Chase Douglas <chase.douglas@canonical.com> | 2012-06-08 13:53:37 -0700 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2012-06-12 14:42:19 +1000 |
commit | 4fa880d2b1e1805e90827af5bbb483e268ac68a3 (patch) | |
tree | f0a1d36374ef472ee1c8c761b1dd6ae40069b83e | |
parent | 43c9be99c1fd35c2974e0db41cad9f7b875fb6c9 (diff) |
Add MODEL_UNIBODY_MACBOOK touchpad model for bcm5974 devices
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@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | src/eventcomm.c | 20 | ||||
-rw-r--r-- | src/synaptics.c | 3 | ||||
-rw-r--r-- | 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 { |