diff mbox series

RMI4 for Thinkpad X1 Extreme Gen 2 / P1 Gen 2

Message ID CAHmME9ox9x67LsYV8-6NmSPWgGgPPAvDu1EPF5rE-ub+N5aPeg@mail.gmail.com (mailing list archive)
State New, archived
Headers show
Series RMI4 for Thinkpad X1 Extreme Gen 2 / P1 Gen 2 | expand

Commit Message

Jason A. Donenfeld Dec. 9, 2019, 7:23 p.m. UTC
Hey Lyude,

I see that you almost enabled RMI4 on the X1E Gen 2 recently, but
reverted after seeing the touchpad mouse buttons didn't work. I was
wondering if you had any more insight as to what's going on. I briefly
looked, and saw that the version the bootloader is returning is an 8
instead of a 7. I tried the below hack, to see if things would work
with the existing v7 driver, but no luck. Do you usually implement
these by reverse engineering the Windows driver, or does Synaptics
release specs, or something else? Currently, not having access to the
Trackpoint speed parameters in serio3 is quite a pain for me, so I'm
interested in fixing this.

Thanks,
Jason
diff mbox series

Patch

diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 1ae6f8bba9ae..b611cd8384a1 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -178,6 +178,7 @@  static const char * const smbus_pnp_ids[] = {
  "LEN0096", /* X280 */
  "LEN0097", /* X280 -> ALPS trackpoint */
  "LEN009b", /* T580 */
+ "LEN0402", /* X1 Extreme 2nd Generation */
  "LEN200f", /* T450s */
  "LEN2054", /* E480 */
  "LEN2055", /* E580 */
diff --git a/drivers/input/rmi4/rmi_f34.c b/drivers/input/rmi4/rmi_f34.c
index e5dca9868f87..4f258909cc1d 100644
--- a/drivers/input/rmi4/rmi_f34.c
+++ b/drivers/input/rmi4/rmi_f34.c
@@ -370,7 +370,7 @@  static int rmi_firmware_update(struct rmi_driver_data *data,

  f34 = dev_get_drvdata(&data->f34_container->dev);

- if (f34->bl_version == 7) {
+ if (f34->bl_version == 7 || f34->bl_version == 8) {
  if (data->pdt_props & HAS_BSR) {
  dev_err(dev, "%s: LTS not supported\n", __func__);
  return -ENODEV;
@@ -382,7 +382,7 @@  static int rmi_firmware_update(struct rmi_driver_data *data,
  }

  /* Enter flash mode */
- if (f34->bl_version == 7)
+ if (f34->bl_version == 7 || f34->bl_version == 8)
  ret = rmi_f34v7_start_reflash(f34, fw);
  else
  ret = rmi_f34_enable_flash(f34);
@@ -413,7 +413,7 @@  static int rmi_firmware_update(struct rmi_driver_data *data,
  f34 = dev_get_drvdata(&data->f34_container->dev);

  /* Perform firmware update */
- if (f34->bl_version == 7)
+ if (f34->bl_version == 7 || f34->bl_version == 8)
  ret = rmi_f34v7_do_reflash(f34, fw);
  else
  ret = rmi_f34_update_firmware(f34, fw);
diff --git a/drivers/input/rmi4/rmi_f34v7.c b/drivers/input/rmi4/rmi_f34v7.c
index 74f7c6f214ff..13b59fb9200e 100644
--- a/drivers/input/rmi4/rmi_f34v7.c
+++ b/drivers/input/rmi4/rmi_f34v7.c
@@ -1364,6 +1364,8 @@  int rmi_f34v7_probe(struct f34_data *f34)
  f34->bl_version = 6;
  } else if (f34->bootloader_id[1] == 7) {
  f34->bl_version = 7;
+ } else if (f34->bootloader_id[1] == 8) {
+ f34->bl_version = 8;
  } else {
  dev_err(&f34->fn->dev, "%s: Unrecognized bootloader version\n",
  __func__);