@@ -338,12 +338,16 @@ static void synaptics_parse_new_hw(unsigned char buf[],
((buf[0] & 0x04) >> 1) |
((buf[3] & 0x04) >> 2);
- hw->left = buf[0] & 0x01;
- hw->right = buf[0] & 0x02;
+ if (SYN_CAP_CLICKPAD(priv->ext_cap)) {
+ hw->left = (buf[0] ^ buf[3]) & 0x01;
+ } else {
+ hw->left = buf[0] & 0x01;
+ hw->right = buf[0] & 0x02;
- if (SYN_CAP_MIDDLE_BUTTON(priv->capabilities)) {
- hw->middle = (buf[0] ^ buf[3]) & 0x01;
- hw->scroll = hw->w == 2 ? (signed char)buf[1] : 0;
+ if (SYN_CAP_MIDDLE_BUTTON(priv->capabilities)) {
+ hw->middle = (buf[0] ^ buf[3]) & 0x01;
+ hw->scroll = hw->w == 2 ? (signed char)buf[1] : 0;
+ }
}
if (SYN_CAP_FOUR_BUTTON(priv->capabilities)) {
@@ -592,6 +596,13 @@ static void set_input_params(struct input_dev *dev, struct synaptics_data *priv)
__clear_bit(REL_X, dev->relbit);
__clear_bit(REL_Y, dev->relbit);
+ /*
+ * ClickPads are buttonless devices. We report the touchpad clicks
+ * as BTN_LEFT but there is no BTN_RIGHT or BTN_MIDDLE.
+ */
+ if (SYN_CAP_CLICKPAD(priv->ext_cap))
+ __clear_bit(BTN_RIGHT, dev->keybit);
+
dev->absres[ABS_X] = priv->x_res;
dev->absres[ABS_Y] = priv->y_res;
}
@@ -48,6 +48,8 @@
#define SYN_CAP_VALID(c) ((((c) & 0x00ff00) >> 8) == 0x47)
#define SYN_EXT_CAP_REQUESTS(c) (((c) & 0x700000) >> 20)
#define SYN_CAP_MULTI_BUTTON_NO(ec) (((ec) & 0x00f000) >> 12)
+#define SYN_CAP_PRODUCT_ID(ec) (((ec) & 0xff0000) >> 16)
+#define SYN_CAP_CLICKPAD(ec) (SYN_CAP_PRODUCT_ID(ec) == 0xe4)
/* synaptics modes query bits */
#define SYN_MODE_ABSOLUTE(m) ((m) & (1 << 7))