Commit fa655abe authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull input updates from Dmitry Torokhov:

 - a quirk to AT keyboard driver to skip issuing "GET ID" command when
   8042 is in translated mode and the device is a laptop/portable,
   because the "GET ID" command makes a bunch of recent laptops unhappy

 - a quirk to i8042 to disable multiplexed mode on Acer P459-G2-M which
   causes issues on resume

 - psmouse will activate native RMI4 protocol support for touchpad on
   ThinkPad L14 G1

 - addition of Razer Wolverine V2 ID to xpad gamepad driver

 - mapping for airplane mode button in soc_button_array driver for
   TUXEDO laptops

 - improved error handling in ipaq-micro-keys driver

 - amimouse being prepared for platform remove callback returning void

* tag 'input-for-v6.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: soc_button_array - add mapping for airplane mode button
  Input: xpad - add Razer Wolverine V2 support
  Input: ipaq-micro-keys - add error handling for devm_kmemdup
  Input: amimouse - convert to platform remove callback returning void
  Input: i8042 - add nomux quirk for Acer P459-G2-M
  Input: atkbd - skip ATKBD_CMD_GETID in translated mode
  Input: psmouse - enable Synaptics InterTouch for ThinkPad L14 G1
parents 5254c0cb ea371594
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -286,6 +286,7 @@ static const struct xpad_device {
	{ 0x146b, 0x0604, "Bigben Interactive DAIJA Arcade Stick", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
	{ 0x1532, 0x0a00, "Razer Atrox Arcade Stick", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE },
	{ 0x1532, 0x0a03, "Razer Wildcat", 0, XTYPE_XBOXONE },
	{ 0x1532, 0x0a29, "Razer Wolverine V2", 0, XTYPE_XBOXONE },
	{ 0x15e4, 0x3f00, "Power A Mini Pro Elite", 0, XTYPE_XBOX360 },
	{ 0x15e4, 0x3f0a, "Xbox Airflo wired controller", 0, XTYPE_XBOX360 },
	{ 0x15e4, 0x3f10, "Batarang Xbox 360 controller", 0, XTYPE_XBOX360 },
+42 −4
Original line number Diff line number Diff line
@@ -765,6 +765,44 @@ static void atkbd_deactivate(struct atkbd *atkbd)
			ps2dev->serio->phys);
}

#ifdef CONFIG_X86
static bool atkbd_is_portable_device(void)
{
	static const char * const chassis_types[] = {
		"8",	/* Portable */
		"9",	/* Laptop */
		"10",	/* Notebook */
		"14",	/* Sub-Notebook */
		"31",	/* Convertible */
		"32",	/* Detachable */
	};
	int i;

	for (i = 0; i < ARRAY_SIZE(chassis_types); i++)
		if (dmi_match(DMI_CHASSIS_TYPE, chassis_types[i]))
			return true;

	return false;
}

/*
 * On many modern laptops ATKBD_CMD_GETID may cause problems, on these laptops
 * the controller is always in translated mode. In this mode mice/touchpads will
 * not work. So in this case simply assume a keyboard is connected to avoid
 * confusing some laptop keyboards.
 *
 * Skipping ATKBD_CMD_GETID ends up using a fake keyboard id. Using a fake id is
 * ok in translated mode, only atkbd_select_set() checks atkbd->id and in
 * translated mode that is a no-op.
 */
static bool atkbd_skip_getid(struct atkbd *atkbd)
{
	return atkbd->translated && atkbd_is_portable_device();
}
#else
static inline bool atkbd_skip_getid(struct atkbd *atkbd) { return false; }
#endif

/*
 * atkbd_probe() probes for an AT keyboard on a serio port.
 */
@@ -794,12 +832,12 @@ static int atkbd_probe(struct atkbd *atkbd)
 */

	param[0] = param[1] = 0xa5;	/* initialize with invalid values */
	if (ps2_command(ps2dev, param, ATKBD_CMD_GETID)) {
	if (atkbd_skip_getid(atkbd) || ps2_command(ps2dev, param, ATKBD_CMD_GETID)) {

/*
 * If the get ID command failed, we check if we can at least set the LEDs on
 * the keyboard. This should work on every keyboard out there. It also turns
 * the LEDs off, which we want anyway.
 * If the get ID command was skipped or failed, we check if we can at least set
 * the LEDs on the keyboard. This should work on every keyboard out there.
 * It also turns the LEDs off, which we want anyway.
 */
		param[0] = 0;
		if (ps2_command(ps2dev, param, ATKBD_CMD_SETLEDS))
+3 −0
Original line number Diff line number Diff line
@@ -105,6 +105,9 @@ static int micro_key_probe(struct platform_device *pdev)
	keys->codes = devm_kmemdup(&pdev->dev, micro_keycodes,
			   keys->input->keycodesize * keys->input->keycodemax,
			   GFP_KERNEL);
	if (!keys->codes)
		return -ENOMEM;

	keys->input->keycode = keys->codes;

	__set_bit(EV_KEY, keys->input->evbit);
+5 −0
Original line number Diff line number Diff line
@@ -299,6 +299,11 @@ static int soc_button_parse_btn_desc(struct device *dev,
		info->name = "power";
		info->event_code = KEY_POWER;
		info->wakeup = true;
	} else if (upage == 0x01 && usage == 0xc6) {
		info->name = "airplane mode switch";
		info->event_type = EV_SW;
		info->event_code = SW_RFKILL_ALL;
		info->active_low = false;
	} else if (upage == 0x01 && usage == 0xca) {
		info->name = "rotation lock switch";
		info->event_type = EV_SW;
+2 −3
Original line number Diff line number Diff line
@@ -125,16 +125,15 @@ static int __init amimouse_probe(struct platform_device *pdev)
	return 0;
}

static int __exit amimouse_remove(struct platform_device *pdev)
static void __exit amimouse_remove(struct platform_device *pdev)
{
	struct input_dev *dev = platform_get_drvdata(pdev);

	input_unregister_device(dev);
	return 0;
}

static struct platform_driver amimouse_driver = {
	.remove = __exit_p(amimouse_remove),
	.remove_new = __exit_p(amimouse_remove),
	.driver   = {
		.name	= "amiga-mouse",
	},
Loading