diff mbox series

Input: elantech - fix touchpad state on resume for Lenovo N24

Message ID 20240501140231.1.Ifa0e25ebf968d8f307f58d678036944141ab17e6@changeid (mailing list archive)
State Superseded
Headers show
Series Input: elantech - fix touchpad state on resume for Lenovo N24 | expand

Commit Message

Jonathan Denose May 1, 2024, 2:02 p.m. UTC
The Lenovo N24 on resume becomes stuck in a state where it
sends incorrect packets, causing elantech_packet_check_v4 to fail.
The only way for the device to resume sending the correct packets is for
it to be disabled and then re-enabled.

This change adds a dmi check to trigger this behavior on resume.
Signed-off-by: Jonathan Denose <jdenose@google.com>
---

 drivers/input/mouse/elantech.c | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

Comments

Dmitry Torokhov May 1, 2024, 7:20 p.m. UTC | #1
On Wed, May 01, 2024 at 02:02:32PM +0000, Jonathan Denose wrote:
> The Lenovo N24 on resume becomes stuck in a state where it
> sends incorrect packets, causing elantech_packet_check_v4 to fail.
> The only way for the device to resume sending the correct packets is for
> it to be disabled and then re-enabled.
> 
> This change adds a dmi check to trigger this behavior on resume.
> Signed-off-by: Jonathan Denose <jdenose@google.com>

Adding a couple more folks to take a look at this...

> ---
> 
>  drivers/input/mouse/elantech.c | 33 +++++++++++++++++++++++++++++++++
>  1 file changed, 33 insertions(+)
> 
> diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
> index 4e38229404b4b..e0f3095b4227e 100644
> --- a/drivers/input/mouse/elantech.c
> +++ b/drivers/input/mouse/elantech.c
> @@ -1476,6 +1476,23 @@ static void elantech_disconnect(struct psmouse *psmouse)
>  	psmouse->private = NULL;
>  }
>  
> +/*
> + * Some hw_version 4 models fail to properly activate absolute mode on
> + * resume without going through disable/enable cycle.
> + */
> +static const struct dmi_system_id elantech_needs_reenable[] = {
> +#if defined(CONFIG_DMI) && defined(CONFIG_X86)
> +	{
> +		/* Lenovo N24 */
> +		.matches = {
> +			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
> +			DMI_MATCH(DMI_PRODUCT_NAME, "81AF"),
> +		},
> +	},
> +#endif
> +	{ }
> +};
> +
>  /*
>   * Put the touchpad back into absolute mode when reconnecting
>   */
> @@ -1486,6 +1503,22 @@ static int elantech_reconnect(struct psmouse *psmouse)
>  	if (elantech_detect(psmouse, 0))
>  		return -1;
>  
> +	if (dmi_check_system(elantech_needs_reenable)) {
> +		int err;
> +
> +		err = ps2_sendbyte(&psmouse->ps2dev, PSMOUSE_CMD_DISABLE, NULL);
> +
> +		if (err)
> +			psmouse_warn(psmouse, "Failed to deactivate mouse on %s: %d\n",
> +					psmouse->ps2dev.serio->phys, err);
> +
> +		err = ps2_sendbyte(&psmouse->ps2dev, PSMOUSE_CMD_ENABLE, NULL);
> +
> +		if (err)
> +			psmouse_warn(psmouse, "Failed to reactivate mouse on %s: %d\n",
> +					psmouse->ps2dev.serio->phys, err);
> +	}
> +
>  	if (elantech_set_absolute_mode(psmouse)) {
>  		psmouse_err(psmouse,
>  			    "failed to put touchpad back into absolute mode.\n");
> -- 
> 2.45.0.rc0.197.gbae5840b3b-goog
>
Phoenix May 2, 2024, 10:52 a.m. UTC | #2
Loop Josh, Jingle

-----Original Message-----
From: Dmitry Torokhov <dmitry.torokhov@gmail.com> 
Sent: Thursday, May 2, 2024 3:20 AM
To: Jonathan Denose <jdenose@google.com>
Cc: LKML <linux-kernel@vger.kernel.org>; linux-input@vger.kernel.org; Greg
Kroah-Hartman <gregkh@linuxfoundation.org>; Jeffery Miller
<jefferymiller@google.com>; Phoenix Huang <phoenix@emc.com.tw>; Hans de
Goede <hdegoede@redhat.com>
Subject: Re: [PATCH] Input: elantech - fix touchpad state on resume for
Lenovo N24

On Wed, May 01, 2024 at 02:02:32PM +0000, Jonathan Denose wrote:
> The Lenovo N24 on resume becomes stuck in a state where it sends 
> incorrect packets, causing elantech_packet_check_v4 to fail.
> The only way for the device to resume sending the correct packets is 
> for it to be disabled and then re-enabled.
> 
> This change adds a dmi check to trigger this behavior on resume.
> Signed-off-by: Jonathan Denose <jdenose@google.com>

Adding a couple more folks to take a look at this...

> ---
> 
>  drivers/input/mouse/elantech.c | 33 +++++++++++++++++++++++++++++++++
>  1 file changed, 33 insertions(+)
> 
> diff --git a/drivers/input/mouse/elantech.c 
> b/drivers/input/mouse/elantech.c index 4e38229404b4b..e0f3095b4227e 
> 100644
> --- a/drivers/input/mouse/elantech.c
> +++ b/drivers/input/mouse/elantech.c
> @@ -1476,6 +1476,23 @@ static void elantech_disconnect(struct psmouse
*psmouse)
>  	psmouse->private = NULL;
>  }
>  
> +/*
> + * Some hw_version 4 models fail to properly activate absolute mode 
> +on
> + * resume without going through disable/enable cycle.
> + */
> +static const struct dmi_system_id elantech_needs_reenable[] = { #if 
> +defined(CONFIG_DMI) && defined(CONFIG_X86)
> +	{
> +		/* Lenovo N24 */
> +		.matches = {
> +			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
> +			DMI_MATCH(DMI_PRODUCT_NAME, "81AF"),
> +		},
> +	},
> +#endif
> +	{ }
> +};
> +
>  /*
>   * Put the touchpad back into absolute mode when reconnecting
>   */
> @@ -1486,6 +1503,22 @@ static int elantech_reconnect(struct psmouse
*psmouse)
>  	if (elantech_detect(psmouse, 0))
>  		return -1;
>  
> +	if (dmi_check_system(elantech_needs_reenable)) {
> +		int err;
> +
> +		err = ps2_sendbyte(&psmouse->ps2dev, PSMOUSE_CMD_DISABLE,
NULL);
> +
> +		if (err)
> +			psmouse_warn(psmouse, "Failed to deactivate mouse on
%s: %d\n",
> +					psmouse->ps2dev.serio->phys, err);
> +
> +		err = ps2_sendbyte(&psmouse->ps2dev, PSMOUSE_CMD_ENABLE,
NULL);
> +
> +		if (err)
> +			psmouse_warn(psmouse, "Failed to reactivate mouse on
%s: %d\n",
> +					psmouse->ps2dev.serio->phys, err);
> +	}
> +
>  	if (elantech_set_absolute_mode(psmouse)) {
>  		psmouse_err(psmouse,
>  			    "failed to put touchpad back into absolute
mode.\n");
> --
> 2.45.0.rc0.197.gbae5840b3b-goog
>
kernel test robot May 2, 2024, 5:29 p.m. UTC | #3
Hi Jonathan,

kernel test robot noticed the following build warnings:

[auto build test WARNING on dtor-input/next]
[also build test WARNING on dtor-input/for-linus hid/for-next linus/master v6.9-rc6 next-20240502]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Jonathan-Denose/Input-elantech-fix-touchpad-state-on-resume-for-Lenovo-N24/20240501-220739
base:   https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
patch link:    https://lore.kernel.org/r/20240501140231.1.Ifa0e25ebf968d8f307f58d678036944141ab17e6%40changeid
patch subject: [PATCH] Input: elantech - fix touchpad state on resume for Lenovo N24
config: arm-defconfig (https://download.01.org/0day-ci/archive/20240503/202405030159.u9nJS35h-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project.git f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240503/202405030159.u9nJS35h-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202405030159.u9nJS35h-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/input/mouse/elantech.c:1509:61: warning: incompatible pointer to integer conversion passing 'void *' to parameter of type 'unsigned int' [-Wint-conversion]
                   err = ps2_sendbyte(&psmouse->ps2dev, PSMOUSE_CMD_DISABLE, NULL);
                                                                             ^~~~
   include/linux/stddef.h:8:14: note: expanded from macro 'NULL'
   #define NULL ((void *)0)
                ^~~~~~~~~~~
   include/linux/libps2.h:64:63: note: passing argument to parameter 'timeout' here
   int ps2_sendbyte(struct ps2dev *ps2dev, u8 byte, unsigned int timeout);
                                                                 ^
   drivers/input/mouse/elantech.c:1515:60: warning: incompatible pointer to integer conversion passing 'void *' to parameter of type 'unsigned int' [-Wint-conversion]
                   err = ps2_sendbyte(&psmouse->ps2dev, PSMOUSE_CMD_ENABLE, NULL);
                                                                            ^~~~
   include/linux/stddef.h:8:14: note: expanded from macro 'NULL'
   #define NULL ((void *)0)
                ^~~~~~~~~~~
   include/linux/libps2.h:64:63: note: passing argument to parameter 'timeout' here
   int ps2_sendbyte(struct ps2dev *ps2dev, u8 byte, unsigned int timeout);
                                                                 ^
   2 warnings generated.


vim +1509 drivers/input/mouse/elantech.c

  1495	
  1496	/*
  1497	 * Put the touchpad back into absolute mode when reconnecting
  1498	 */
  1499	static int elantech_reconnect(struct psmouse *psmouse)
  1500	{
  1501		psmouse_reset(psmouse);
  1502	
  1503		if (elantech_detect(psmouse, 0))
  1504			return -1;
  1505	
  1506		if (dmi_check_system(elantech_needs_reenable)) {
  1507			int err;
  1508	
> 1509			err = ps2_sendbyte(&psmouse->ps2dev, PSMOUSE_CMD_DISABLE, NULL);
  1510	
  1511			if (err)
  1512				psmouse_warn(psmouse, "Failed to deactivate mouse on %s: %d\n",
  1513						psmouse->ps2dev.serio->phys, err);
  1514	
  1515			err = ps2_sendbyte(&psmouse->ps2dev, PSMOUSE_CMD_ENABLE, NULL);
  1516	
  1517			if (err)
  1518				psmouse_warn(psmouse, "Failed to reactivate mouse on %s: %d\n",
  1519						psmouse->ps2dev.serio->phys, err);
  1520		}
  1521	
  1522		if (elantech_set_absolute_mode(psmouse)) {
  1523			psmouse_err(psmouse,
  1524				    "failed to put touchpad back into absolute mode.\n");
  1525			return -1;
  1526		}
  1527	
  1528		return 0;
  1529	}
  1530
kernel test robot May 2, 2024, 7:03 p.m. UTC | #4
Hi Jonathan,

kernel test robot noticed the following build warnings:

[auto build test WARNING on dtor-input/next]
[also build test WARNING on dtor-input/for-linus hid/for-next linus/master v6.9-rc6 next-20240502]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Jonathan-Denose/Input-elantech-fix-touchpad-state-on-resume-for-Lenovo-N24/20240501-220739
base:   https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
patch link:    https://lore.kernel.org/r/20240501140231.1.Ifa0e25ebf968d8f307f58d678036944141ab17e6%40changeid
patch subject: [PATCH] Input: elantech - fix touchpad state on resume for Lenovo N24
config: x86_64-rhel-8.3 (https://download.01.org/0day-ci/archive/20240503/202405030210.izdCj8wZ-lkp@intel.com/config)
compiler: gcc-13 (Ubuntu 13.2.0-4ubuntu3) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240503/202405030210.izdCj8wZ-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202405030210.izdCj8wZ-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from include/uapi/linux/posix_types.h:5,
                    from include/uapi/linux/types.h:14,
                    from include/linux/types.h:6,
                    from include/linux/math.h:5,
                    from include/linux/delay.h:22,
                    from drivers/input/mouse/elantech.c:10:
   drivers/input/mouse/elantech.c: In function 'elantech_reconnect':
>> include/linux/stddef.h:8:14: warning: passing argument 3 of 'ps2_sendbyte' makes integer from pointer without a cast [-Wint-conversion]
       8 | #define NULL ((void *)0)
         |              ^~~~~~~~~~~
         |              |
         |              void *
   drivers/input/mouse/elantech.c:1509:75: note: in expansion of macro 'NULL'
    1509 |                 err = ps2_sendbyte(&psmouse->ps2dev, PSMOUSE_CMD_DISABLE, NULL);
         |                                                                           ^~~~
   In file included from drivers/input/mouse/elantech.c:19:
   include/linux/libps2.h:64:63: note: expected 'unsigned int' but argument is of type 'void *'
      64 | int ps2_sendbyte(struct ps2dev *ps2dev, u8 byte, unsigned int timeout);
         |                                                  ~~~~~~~~~~~~~^~~~~~~
>> include/linux/stddef.h:8:14: warning: passing argument 3 of 'ps2_sendbyte' makes integer from pointer without a cast [-Wint-conversion]
       8 | #define NULL ((void *)0)
         |              ^~~~~~~~~~~
         |              |
         |              void *
   drivers/input/mouse/elantech.c:1515:74: note: in expansion of macro 'NULL'
    1515 |                 err = ps2_sendbyte(&psmouse->ps2dev, PSMOUSE_CMD_ENABLE, NULL);
         |                                                                          ^~~~
   include/linux/libps2.h:64:63: note: expected 'unsigned int' but argument is of type 'void *'
      64 | int ps2_sendbyte(struct ps2dev *ps2dev, u8 byte, unsigned int timeout);
         |                                                  ~~~~~~~~~~~~~^~~~~~~
   drivers/input/mouse/elantech.c: In function 'elantech_setup_ps2':
   drivers/input/mouse/elantech.c:2123:65: warning: '/input1' directive output may be truncated writing 7 bytes into a region of size between 1 and 32 [-Wformat-truncation=]
    2123 |                 snprintf(etd->tp_phys, sizeof(etd->tp_phys), "%s/input1",
         |                                                                 ^~~~~~~
   drivers/input/mouse/elantech.c:2123:17: note: 'snprintf' output between 8 and 39 bytes into a destination of size 32
    2123 |                 snprintf(etd->tp_phys, sizeof(etd->tp_phys), "%s/input1",
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    2124 |                         psmouse->ps2dev.serio->phys);
         |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/ps2_sendbyte +8 include/linux/stddef.h

^1da177e4c3f41 Linus Torvalds   2005-04-16  6  
^1da177e4c3f41 Linus Torvalds   2005-04-16  7  #undef NULL
^1da177e4c3f41 Linus Torvalds   2005-04-16 @8  #define NULL ((void *)0)
6e218287432472 Richard Knutsson 2006-09-30  9
kernel test robot May 2, 2024, 7:57 p.m. UTC | #5
Hi Jonathan,

kernel test robot noticed the following build warnings:

[auto build test WARNING on dtor-input/next]
[also build test WARNING on dtor-input/for-linus hid/for-next linus/master v6.9-rc6 next-20240502]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Jonathan-Denose/Input-elantech-fix-touchpad-state-on-resume-for-Lenovo-N24/20240501-220739
base:   https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
patch link:    https://lore.kernel.org/r/20240501140231.1.Ifa0e25ebf968d8f307f58d678036944141ab17e6%40changeid
patch subject: [PATCH] Input: elantech - fix touchpad state on resume for Lenovo N24
config: powerpc64-randconfig-r122-20240502 (https://download.01.org/0day-ci/archive/20240503/202405030346.3Q7ixiBD-lkp@intel.com/config)
compiler: powerpc64-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20240503/202405030346.3Q7ixiBD-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202405030346.3Q7ixiBD-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/input/mouse/elantech.c:1509:75: sparse: sparse: incorrect type in argument 3 (different base types) @@     expected unsigned int timeout @@     got void * @@
   drivers/input/mouse/elantech.c:1509:75: sparse:     expected unsigned int timeout
   drivers/input/mouse/elantech.c:1509:75: sparse:     got void *
   drivers/input/mouse/elantech.c:1515:74: sparse: sparse: incorrect type in argument 3 (different base types) @@     expected unsigned int timeout @@     got void * @@
   drivers/input/mouse/elantech.c:1515:74: sparse:     expected unsigned int timeout
   drivers/input/mouse/elantech.c:1515:74: sparse:     got void *

vim +1509 drivers/input/mouse/elantech.c

  1495	
  1496	/*
  1497	 * Put the touchpad back into absolute mode when reconnecting
  1498	 */
  1499	static int elantech_reconnect(struct psmouse *psmouse)
  1500	{
  1501		psmouse_reset(psmouse);
  1502	
  1503		if (elantech_detect(psmouse, 0))
  1504			return -1;
  1505	
  1506		if (dmi_check_system(elantech_needs_reenable)) {
  1507			int err;
  1508	
> 1509			err = ps2_sendbyte(&psmouse->ps2dev, PSMOUSE_CMD_DISABLE, NULL);
  1510	
  1511			if (err)
  1512				psmouse_warn(psmouse, "Failed to deactivate mouse on %s: %d\n",
  1513						psmouse->ps2dev.serio->phys, err);
  1514	
  1515			err = ps2_sendbyte(&psmouse->ps2dev, PSMOUSE_CMD_ENABLE, NULL);
  1516	
  1517			if (err)
  1518				psmouse_warn(psmouse, "Failed to reactivate mouse on %s: %d\n",
  1519						psmouse->ps2dev.serio->phys, err);
  1520		}
  1521	
  1522		if (elantech_set_absolute_mode(psmouse)) {
  1523			psmouse_err(psmouse,
  1524				    "failed to put touchpad back into absolute mode.\n");
  1525			return -1;
  1526		}
  1527	
  1528		return 0;
  1529	}
  1530
Dmitry Torokhov May 2, 2024, 11:13 p.m. UTC | #6
On Wed, May 01, 2024 at 02:02:32PM +0000, Jonathan Denose wrote:
> The Lenovo N24 on resume becomes stuck in a state where it
> sends incorrect packets, causing elantech_packet_check_v4 to fail.
> The only way for the device to resume sending the correct packets is for
> it to be disabled and then re-enabled.
> 
> This change adds a dmi check to trigger this behavior on resume.
> Signed-off-by: Jonathan Denose <jdenose@google.com>
> ---
> 
>  drivers/input/mouse/elantech.c | 33 +++++++++++++++++++++++++++++++++
>  1 file changed, 33 insertions(+)
> 
> diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
> index 4e38229404b4b..e0f3095b4227e 100644
> --- a/drivers/input/mouse/elantech.c
> +++ b/drivers/input/mouse/elantech.c
> @@ -1476,6 +1476,23 @@ static void elantech_disconnect(struct psmouse *psmouse)
>  	psmouse->private = NULL;
>  }
>  
> +/*
> + * Some hw_version 4 models fail to properly activate absolute mode on
> + * resume without going through disable/enable cycle.
> + */
> +static const struct dmi_system_id elantech_needs_reenable[] = {
> +#if defined(CONFIG_DMI) && defined(CONFIG_X86)
> +	{
> +		/* Lenovo N24 */
> +		.matches = {
> +			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
> +			DMI_MATCH(DMI_PRODUCT_NAME, "81AF"),
> +		},
> +	},
> +#endif
> +	{ }
> +};
> +
>  /*
>   * Put the touchpad back into absolute mode when reconnecting
>   */
> @@ -1486,6 +1503,22 @@ static int elantech_reconnect(struct psmouse *psmouse)
>  	if (elantech_detect(psmouse, 0))
>  		return -1;
>  
> +	if (dmi_check_system(elantech_needs_reenable)) {
> +		int err;
> +
> +		err = ps2_sendbyte(&psmouse->ps2dev, PSMOUSE_CMD_DISABLE, NULL);

This and below should be ps2_command().

> +
> +		if (err)
> +			psmouse_warn(psmouse, "Failed to deactivate mouse on %s: %d\n",
> +					psmouse->ps2dev.serio->phys, err);
> +
> +		err = ps2_sendbyte(&psmouse->ps2dev, PSMOUSE_CMD_ENABLE, NULL);
> +
> +		if (err)
> +			psmouse_warn(psmouse, "Failed to reactivate mouse on %s: %d\n",
> +					psmouse->ps2dev.serio->phys, err);
> +	}
> +
>  	if (elantech_set_absolute_mode(psmouse)) {
>  		psmouse_err(psmouse,
>  			    "failed to put touchpad back into absolute mode.\n");
> -- 
> 2.45.0.rc0.197.gbae5840b3b-goog
> 

Thanks.
diff mbox series

Patch

diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index 4e38229404b4b..e0f3095b4227e 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -1476,6 +1476,23 @@  static void elantech_disconnect(struct psmouse *psmouse)
 	psmouse->private = NULL;
 }
 
+/*
+ * Some hw_version 4 models fail to properly activate absolute mode on
+ * resume without going through disable/enable cycle.
+ */
+static const struct dmi_system_id elantech_needs_reenable[] = {
+#if defined(CONFIG_DMI) && defined(CONFIG_X86)
+	{
+		/* Lenovo N24 */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "81AF"),
+		},
+	},
+#endif
+	{ }
+};
+
 /*
  * Put the touchpad back into absolute mode when reconnecting
  */
@@ -1486,6 +1503,22 @@  static int elantech_reconnect(struct psmouse *psmouse)
 	if (elantech_detect(psmouse, 0))
 		return -1;
 
+	if (dmi_check_system(elantech_needs_reenable)) {
+		int err;
+
+		err = ps2_sendbyte(&psmouse->ps2dev, PSMOUSE_CMD_DISABLE, NULL);
+
+		if (err)
+			psmouse_warn(psmouse, "Failed to deactivate mouse on %s: %d\n",
+					psmouse->ps2dev.serio->phys, err);
+
+		err = ps2_sendbyte(&psmouse->ps2dev, PSMOUSE_CMD_ENABLE, NULL);
+
+		if (err)
+			psmouse_warn(psmouse, "Failed to reactivate mouse on %s: %d\n",
+					psmouse->ps2dev.serio->phys, err);
+	}
+
 	if (elantech_set_absolute_mode(psmouse)) {
 		psmouse_err(psmouse,
 			    "failed to put touchpad back into absolute mode.\n");