[PATCH 1/1] input: update max sizes after setting to absolute mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



x_max/y_max values change after we populate info struct. Using old
values causes y scroll to be half of the size of pad area. Updating these
values fixes that problem. This problem affects firmware 0x450f00 at least.

Signed-off-by: Kutay Uner <husnukutay@xxxxxxxxx>
---
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -1944,6 +1944,22 @@ static int elantech_setup_ps2(struct psmouse *psmouse,
 		goto init_fail;
 	}
 
+	/* elantech_set_absolute_mode(?) causes x_max/y_max to change
+	 * at least on models using this fw. Workaround that by requerying
+	 * and setting those values at both info struct to be safe.
+	 */
+	if (info->fw_version == 0x450f00) {
+		unsigned char param[3];
+
+		if (info->send_cmd(psmouse, ETP_FW_ID_QUERY, param))
+			goto init_fail;
+
+		info->x_max = (0x0f & param[0]) << 8 | param[1];
+		info->y_max = (0xf0 & param[0]) << 4 | param[2];
+		etd->info.x_max = info->x_max;
+		etd->info.y_max = info->y_max;
+	}
+
 	if (info->fw_version == 0x381f17) {
 		etd->original_set_rate = psmouse->set_rate;
 		psmouse->set_rate = elantech_set_rate_restore_reg_07;



[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux