History

Merge tag 'input-for-v6.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input

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

Linus Torvalds committed 2 years ago

Commit fa655ab2 parents 5254c0c ea371597 files · +62 −7Browse files

Unified · Split

7 files
  1. drivers/input/joystick/xpad.c +1 −0
  2. drivers/input/keyboard/atkbd.c +42 −4
  3. drivers/input/keyboard/ipaq-micro-keys.c +3 −0
  4. drivers/input/misc/soc_button_array.c +5 −0
  5. drivers/input/mouse/amimouse.c +2 −3
  6. drivers/input/mouse/synaptics.c +1 −0
  7. drivers/input/serio/i8042-acpipnpio.h +8 −0
drivers/input/joystick/xpad.c+1−0
@@ -286,6 +286,7 @@ static const struct xpad_device { · 285 unmodified lines
286286 { 0x146b, 0x0604, "Bigben Interactive DAIJA Arcade Stick", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
287287 { 0x1532, 0x0a00, "Razer Atrox Arcade Stick", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE },
288288 { 0x1532, 0x0a03, "Razer Wildcat", 0, XTYPE_XBOXONE },
289+ { 0x1532, 0x0a29, "Razer Wolverine V2", 0, XTYPE_XBOXONE },
289290 { 0x15e4, 0x3f00, "Power A Mini Pro Elite", 0, XTYPE_XBOX360 },
290291 { 0x15e4, 0x3f0a, "Xbox Airflo wired controller", 0, XTYPE_XBOX360 },
291292 { 0x15e4, 0x3f10, "Batarang Xbox 360 controller", 0, XTYPE_XBOX360 },
drivers/input/keyboard/atkbd.c+42−4
@@ -765,6 +765,44 @@ static void atkbd_deactivate(struct atkbd *atkbd) · 764 unmodified lines
765765 ps2dev->serio->phys);
766766 }
767767
768+#ifdef CONFIG_X86
769+static bool atkbd_is_portable_device(void)
770+{
771+ static const char * const chassis_types[] = {
772+ "8", /* Portable */
773+ "9", /* Laptop */
774+ "10", /* Notebook */
775+ "14", /* Sub-Notebook */
776+ "31", /* Convertible */
777+ "32", /* Detachable */
778+ };
779+ int i;
780+
781+ for (i = 0; i < ARRAY_SIZE(chassis_types); i++)
782+ if (dmi_match(DMI_CHASSIS_TYPE, chassis_types[i]))
783+ return true;
784+
785+ return false;
786+}
787+
788+/*
789+ * On many modern laptops ATKBD_CMD_GETID may cause problems, on these laptops
790+ * the controller is always in translated mode. In this mode mice/touchpads will
791+ * not work. So in this case simply assume a keyboard is connected to avoid
792+ * confusing some laptop keyboards.
793+ *
794+ * Skipping ATKBD_CMD_GETID ends up using a fake keyboard id. Using a fake id is
795+ * ok in translated mode, only atkbd_select_set() checks atkbd->id and in
796+ * translated mode that is a no-op.
797+ */
798+static bool atkbd_skip_getid(struct atkbd *atkbd)
799+{
800+ return atkbd->translated && atkbd_is_portable_device();
801+}
802+#else
803+static inline bool atkbd_skip_getid(struct atkbd *atkbd) { return false; }
804+#endif
805+
768806 /*
769807 * atkbd_probe() probes for an AT keyboard on a serio port.
770808 */
@@ -794,12 +832,12 @@ static int atkbd_probe(struct atkbd *atkbd) · 23 unmodified lines
794832 */
795833
796834 param[0] = param[1] = 0xa5; /* initialize with invalid values */
797− if (ps2_command(ps2dev, param, ATKBD_CMD_GETID)) {
835+ if (atkbd_skip_getid(atkbd) || ps2_command(ps2dev, param, ATKBD_CMD_GETID)) {
798836
799837 /*
800− * If the get ID command failed, we check if we can at least set the LEDs on
801− * the keyboard. This should work on every keyboard out there. It also turns
802− * the LEDs off, which we want anyway.
838+ * If the get ID command was skipped or failed, we check if we can at least set
839+ * the LEDs on the keyboard. This should work on every keyboard out there.
840+ * It also turns the LEDs off, which we want anyway.
803841 */
804842 param[0] = 0;
805843 if (ps2_command(ps2dev, param, ATKBD_CMD_SETLEDS))
drivers/input/keyboard/ipaq-micro-keys.c+3−0
@@ -105,6 +105,9 @@ static int micro_key_probe(struct platform_device *pdev) · 104 unmodified lines
105105 keys->codes = devm_kmemdup(&pdev->dev, micro_keycodes,
106106 keys->input->keycodesize * keys->input->keycodemax,
107107 GFP_KERNEL);
108+ if (!keys->codes)
109+ return -ENOMEM;
110+
108111 keys->input->keycode = keys->codes;
109112
110113 __set_bit(EV_KEY, keys->input->evbit);
drivers/input/misc/soc_button_array.c+5−0
@@ -299,6 +299,11 @@ static int soc_button_parse_btn_desc(struct device *dev, · 298 unmodified lines
299299 info->name = "power";
300300 info->event_code = KEY_POWER;
301301 info->wakeup = true;
302+ } else if (upage == 0x01 && usage == 0xc6) {
303+ info->name = "airplane mode switch";
304+ info->event_type = EV_SW;
305+ info->event_code = SW_RFKILL_ALL;
306+ info->active_low = false;
302307 } else if (upage == 0x01 && usage == 0xca) {
303308 info->name = "rotation lock switch";
304309 info->event_type = EV_SW;
drivers/input/mouse/amimouse.c+2−3
@@ -125,16 +125,15 @@ static int __init amimouse_probe(struct platform_device *pdev) · 124 unmodified lines
125125 return 0;
126126 }
127127
128−static int __exit amimouse_remove(struct platform_device *pdev)
128+static void __exit amimouse_remove(struct platform_device *pdev)
129129 {
130130 struct input_dev *dev = platform_get_drvdata(pdev);
131131
132132 input_unregister_device(dev);
133− return 0;
134133 }
135134
136135 static struct platform_driver amimouse_driver = {
137− .remove = __exit_p(amimouse_remove),
136+ .remove_new = __exit_p(amimouse_remove),
138137 .driver = {
139138 .name = "amiga-mouse",
140139 },
drivers/input/mouse/synaptics.c+1−0
@@ -183,6 +183,7 @@ static const char * const smbus_pnp_ids[] = { · 182 unmodified lines
183183 "LEN009b", /* T580 */
184184 "LEN0402", /* X1 Extreme Gen 2 / P1 Gen 2 */
185185 "LEN040f", /* P1 Gen 3 */
186+ "LEN0411", /* L14 Gen 1 */
186187 "LEN200f", /* T450s */
187188 "LEN2044", /* L470 */
188189 "LEN2054", /* E480 */
drivers/input/serio/i8042-acpipnpio.h+8−0
@@ -360,6 +360,14 @@ static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = { · 359 unmodified lines
360360 },
361361 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
362362 },
363+ {
364+ /* Acer TravelMate P459-G2-M */
365+ .matches = {
366+ DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
367+ DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate P459-G2-M"),
368+ },
369+ .driver_data = (void *)(SERIO_QUIRK_NOMUX)
370+ },
363371 {
364372 /* Amoi M636/A737 */
365373 .matches = {