@@ -1006,6 +1006,9 @@ static void elantech_set_rate_restore_reg_07(struct psmouse *psmouse,
psmouse_err(psmouse, "restoring reg_07 failed\n");
}
+static int elantech_query_range_v3(struct psmouse *psmouse,
+ struct elantech_device_info *info);
+
/*
* Put the touchpad into absolute mode
*/
@@ -1047,6 +1050,14 @@ static int elantech_set_absolute_mode(struct psmouse *psmouse)
if (elantech_write_reg(psmouse, 0x10, etd->reg_10))
rc = -1;
+ /*
+ * If we boost hardware resolution, we have to re-query
+ * info->x_max and y_max.
+ */
+ if (etd->info.set_hw_resolution)
+ if (elantech_query_range_v3(psmouse, &etd->info))
+ rc = -1;
+
break;
case 4:
@@ -1671,6 +1682,20 @@ static int elantech_set_properties(struct elantech_device_info *info)
return 0;
}
+static int elantech_query_range_v3(struct psmouse *psmouse,
+ struct elantech_device_info *info)
+{
+ unsigned char param[3];
+
+ if (info->send_cmd(psmouse, ETP_FW_ID_QUERY, param))
+ return -EINVAL;
+
+ info->x_max = (0x0f & param[0]) << 8 | param[1];
+ info->y_max = (0xf0 & param[0]) << 4 | param[2];
+
+ return 0;
+}
+
static int elantech_query_info(struct psmouse *psmouse,
struct elantech_device_info *info)
{
@@ -1826,11 +1851,8 @@ static int elantech_query_info(struct psmouse *psmouse,
break;
case 3:
- if (info->send_cmd(psmouse, ETP_FW_ID_QUERY, param))
+ if (elantech_query_range_v3(psmouse, info))
return -EINVAL;
-
- info->x_max = (0x0f & param[0]) << 8 | param[1];
- info->y_max = (0xf0 & param[0]) << 4 | param[2];
break;
case 4: