Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1aae31c8 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull input updates from Dmitry Torokhov:
 "The main change is that we now publish "firmware ID" for the serio
  devices to help userspace figure out the kind of touchpads it is
  dealing with: i8042 will export PS/2 port's PNP IDs as firmware IDs.

  You will also get more quirks for Synaptics touchpads in various
  Lenovo laptops, a change to elantech driver to recognize even more
  models, and fixups to wacom and couple other drivers"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: elantech - add support for newer elantech touchpads
  Input: soc_button_array - fix a crash during rmmod
  Input: synaptics - add min/max quirk for ThinkPad T431s, L440, L540, S1 Yoga and X1
  Input: synaptics - report INPUT_PROP_TOPBUTTONPAD property
  Input: Add INPUT_PROP_TOPBUTTONPAD device property
  Input: i8042 - add firmware_id support
  Input: serio - add firmware_id sysfs attribute
  Input: wacom - handle 1024 pressure levels in wacom_tpc_pen
  Input: wacom - references to 'wacom->data' should use 'unsigned char*'
  Input: wacom - override 'pressure_max' with value from HID_USAGE_PRESSURE
  Input: wacom - use full 32-bit HID Usage value in switch statement
  Input: wacom - missed the last bit of expresskey for DTU-1031
  Input: ads7846 - fix device usage within attribute show
  Input: da9055_onkey - remove use of regmap_irq_get_virq()
parents 6db8148c ae4bedf0
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -109,7 +109,6 @@ static int da9055_onkey_probe(struct platform_device *pdev)

	INIT_DELAYED_WORK(&onkey->work, da9055_onkey_work);

	irq = regmap_irq_get_virq(da9055->irq_data, irq);
	err = request_threaded_irq(irq, NULL, da9055_onkey_irq,
				   IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
				   "ONKEY", onkey);
+1 −0
Original line number Diff line number Diff line
@@ -169,6 +169,7 @@ static int soc_button_pnp_probe(struct pnp_dev *pdev,
				soc_button_remove(pdev);
				return error;
			}
			continue;
		}

		priv->children[i] = pd;
+1 −0
Original line number Diff line number Diff line
@@ -1353,6 +1353,7 @@ static int elantech_set_properties(struct elantech_data *etd)
		case 6:
		case 7:
		case 8:
		case 9:
			etd->hw_version = 4;
			break;
		default:
+95 −2
Original line number Diff line number Diff line
@@ -117,6 +117,44 @@ void synaptics_reset(struct psmouse *psmouse)
}

#ifdef CONFIG_MOUSE_PS2_SYNAPTICS
/* This list has been kindly provided by Synaptics. */
static const char * const topbuttonpad_pnp_ids[] = {
	"LEN0017",
	"LEN0018",
	"LEN0019",
	"LEN0023",
	"LEN002A",
	"LEN002B",
	"LEN002C",
	"LEN002D",
	"LEN002E",
	"LEN0033", /* Helix */
	"LEN0034", /* T431s, T540, X1 Carbon 2nd */
	"LEN0035", /* X240 */
	"LEN0036", /* T440 */
	"LEN0037",
	"LEN0038",
	"LEN0041",
	"LEN0042", /* Yoga */
	"LEN0045",
	"LEN0046",
	"LEN0047",
	"LEN0048",
	"LEN0049",
	"LEN2000",
	"LEN2001",
	"LEN2002",
	"LEN2003",
	"LEN2004", /* L440 */
	"LEN2005",
	"LEN2006",
	"LEN2007",
	"LEN2008",
	"LEN2009",
	"LEN200A",
	"LEN200B",
	NULL
};

/*****************************************************************************
 *	Synaptics communications functions
@@ -1255,8 +1293,10 @@ static void set_abs_position_params(struct input_dev *dev,
	input_abs_set_res(dev, y_code, priv->y_res);
}

static void set_input_params(struct input_dev *dev, struct synaptics_data *priv)
static void set_input_params(struct psmouse *psmouse,
			     struct synaptics_data *priv)
{
	struct input_dev *dev = psmouse->dev;
	int i;

	/* Things that apply to both modes */
@@ -1325,6 +1365,17 @@ static void set_input_params(struct input_dev *dev, struct synaptics_data *priv)

	if (SYN_CAP_CLICKPAD(priv->ext_cap_0c)) {
		__set_bit(INPUT_PROP_BUTTONPAD, dev->propbit);
		/* See if this buttonpad has a top button area */
		if (!strncmp(psmouse->ps2dev.serio->firmware_id, "PNP:", 4)) {
			for (i = 0; topbuttonpad_pnp_ids[i]; i++) {
				if (strstr(psmouse->ps2dev.serio->firmware_id,
					   topbuttonpad_pnp_ids[i])) {
					__set_bit(INPUT_PROP_TOPBUTTONPAD,
						  dev->propbit);
					break;
				}
			}
		}
		/* Clickpads report only left button */
		__clear_bit(BTN_RIGHT, dev->keybit);
		__clear_bit(BTN_MIDDLE, dev->keybit);
@@ -1514,6 +1565,14 @@ static const struct dmi_system_id min_max_dmi_table[] __initconst = {
		},
		.driver_data = (int []){1232, 5710, 1156, 4696},
	},
	{
		/* Lenovo ThinkPad T431s */
		.matches = {
			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
			DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T431"),
		},
		.driver_data = (int []){1024, 5112, 2024, 4832},
	},
	{
		/* Lenovo ThinkPad T440s */
		.matches = {
@@ -1522,6 +1581,14 @@ static const struct dmi_system_id min_max_dmi_table[] __initconst = {
		},
		.driver_data = (int []){1024, 5112, 2024, 4832},
	},
	{
		/* Lenovo ThinkPad L440 */
		.matches = {
			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
			DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad L440"),
		},
		.driver_data = (int []){1024, 5112, 2024, 4832},
	},
	{
		/* Lenovo ThinkPad T540p */
		.matches = {
@@ -1530,6 +1597,32 @@ static const struct dmi_system_id min_max_dmi_table[] __initconst = {
		},
		.driver_data = (int []){1024, 5056, 2058, 4832},
	},
	{
		/* Lenovo ThinkPad L540 */
		.matches = {
			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
			DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad L540"),
		},
		.driver_data = (int []){1024, 5112, 2024, 4832},
	},
	{
		/* Lenovo Yoga S1 */
		.matches = {
			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
			DMI_EXACT_MATCH(DMI_PRODUCT_VERSION,
					"ThinkPad S1 Yoga"),
		},
		.driver_data = (int []){1232, 5710, 1156, 4696},
	},
	{
		/* Lenovo ThinkPad X1 Carbon Haswell (3rd generation) */
		.matches = {
			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
			DMI_MATCH(DMI_PRODUCT_VERSION,
					"ThinkPad X1 Carbon 2nd"),
		},
		.driver_data = (int []){1024, 5112, 2024, 4832},
	},
#endif
	{ }
};
@@ -1593,7 +1686,7 @@ static int __synaptics_init(struct psmouse *psmouse, bool absolute_mode)
		     priv->capabilities, priv->ext_cap, priv->ext_cap_0c,
		     priv->board_id, priv->firmware_id);

	set_input_params(psmouse->dev, priv);
	set_input_params(psmouse, priv);

	/*
	 * Encode touchpad model so that it can be used to set
+15 −0
Original line number Diff line number Diff line
@@ -702,6 +702,17 @@ static int i8042_pnp_aux_irq;
static char i8042_pnp_kbd_name[32];
static char i8042_pnp_aux_name[32];

static void i8042_pnp_id_to_string(struct pnp_id *id, char *dst, int dst_size)
{
	strlcpy(dst, "PNP:", dst_size);

	while (id) {
		strlcat(dst, " ", dst_size);
		strlcat(dst, id->id, dst_size);
		id = id->next;
	}
}

static int i8042_pnp_kbd_probe(struct pnp_dev *dev, const struct pnp_device_id *did)
{
	if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
@@ -718,6 +729,8 @@ static int i8042_pnp_kbd_probe(struct pnp_dev *dev, const struct pnp_device_id *
		strlcat(i8042_pnp_kbd_name, ":", sizeof(i8042_pnp_kbd_name));
		strlcat(i8042_pnp_kbd_name, pnp_dev_name(dev), sizeof(i8042_pnp_kbd_name));
	}
	i8042_pnp_id_to_string(dev->id, i8042_kbd_firmware_id,
			       sizeof(i8042_kbd_firmware_id));

	/* Keyboard ports are always supposed to be wakeup-enabled */
	device_set_wakeup_enable(&dev->dev, true);
@@ -742,6 +755,8 @@ static int i8042_pnp_aux_probe(struct pnp_dev *dev, const struct pnp_device_id *
		strlcat(i8042_pnp_aux_name, ":", sizeof(i8042_pnp_aux_name));
		strlcat(i8042_pnp_aux_name, pnp_dev_name(dev), sizeof(i8042_pnp_aux_name));
	}
	i8042_pnp_id_to_string(dev->id, i8042_aux_firmware_id,
			       sizeof(i8042_aux_firmware_id));

	i8042_pnp_aux_devices++;
	return 0;
Loading