Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 20 Feb 2022 19:15:46 +0000 (11:15 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 20 Feb 2022 19:15:46 +0000 (11:15 -0800)
Pull input fixes from Dmitry Torokhov:

 - a fix for Synaptics touchpads in RMI4 mode failing to suspend/resume
   properly because I2C client devices are now being suspended and
   resumed asynchronously which changed the ordering

 - a change to make sure we do not set right and middle buttons
   capabilities on touchpads that are "buttonpads" (i.e. do not have
   separate physical buttons)

 - a change to zinitix touchscreen driver adding more compatible
   strings/IDs

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: psmouse - set up dependency between PS/2 and SMBus companions
  Input: zinitix - add new compatible strings
  Input: clear BTN_RIGHT/MIDDLE on buttonpads

drivers/input/input.c
drivers/input/mouse/psmouse-smbus.c
drivers/input/touchscreen/zinitix.c

index ccaeb24263854d0c44de206de54f2741a9abd586..c3139bc2aa0db106f8a63cced11051a98c0ecbc5 100644 (file)
@@ -2285,6 +2285,12 @@ int input_register_device(struct input_dev *dev)
        /* KEY_RESERVED is not supposed to be transmitted to userspace. */
        __clear_bit(KEY_RESERVED, dev->keybit);
 
+       /* Buttonpads should not map BTN_RIGHT and/or BTN_MIDDLE. */
+       if (test_bit(INPUT_PROP_BUTTONPAD, dev->propbit)) {
+               __clear_bit(BTN_RIGHT, dev->keybit);
+               __clear_bit(BTN_MIDDLE, dev->keybit);
+       }
+
        /* Make sure that bitmasks not mentioned in dev->evbit are clean. */
        input_cleanse_bitmasks(dev);
 
index a472489ccbad6895524ecf5b701f47c819f9e20e..164f6c757f6bed637b9e04c0ce8677888b93c33a 100644 (file)
@@ -75,6 +75,8 @@ static void psmouse_smbus_detach_i2c_client(struct i2c_client *client)
                                    "Marking SMBus companion %s as gone\n",
                                    dev_name(&smbdev->client->dev));
                        smbdev->dead = true;
+                       device_link_remove(&smbdev->client->dev,
+                                          &smbdev->psmouse->ps2dev.serio->dev);
                        serio_rescan(smbdev->psmouse->ps2dev.serio);
                } else {
                        list_del(&smbdev->node);
@@ -174,6 +176,8 @@ static void psmouse_smbus_disconnect(struct psmouse *psmouse)
                kfree(smbdev);
        } else {
                smbdev->dead = true;
+               device_link_remove(&smbdev->client->dev,
+                                  &psmouse->ps2dev.serio->dev);
                psmouse_dbg(smbdev->psmouse,
                            "posting removal request for SMBus companion %s\n",
                            dev_name(&smbdev->client->dev));
@@ -270,6 +274,12 @@ int psmouse_smbus_init(struct psmouse *psmouse,
 
        if (smbdev->client) {
                /* We have our companion device */
+               if (!device_link_add(&smbdev->client->dev,
+                                    &psmouse->ps2dev.serio->dev,
+                                    DL_FLAG_STATELESS))
+                       psmouse_warn(psmouse,
+                                    "failed to set up link with iSMBus companion %s\n",
+                                    dev_name(&smbdev->client->dev));
                return 0;
        }
 
index 7c82c4f5fa6b331f2bf532c63c19a860ac13616e..129ebc810de87c11a1b62ab55b1b27b6af318734 100644 (file)
@@ -571,8 +571,20 @@ static SIMPLE_DEV_PM_OPS(zinitix_pm_ops, zinitix_suspend, zinitix_resume);
 
 #ifdef CONFIG_OF
 static const struct of_device_id zinitix_of_match[] = {
+       { .compatible = "zinitix,bt402" },
+       { .compatible = "zinitix,bt403" },
+       { .compatible = "zinitix,bt404" },
+       { .compatible = "zinitix,bt412" },
+       { .compatible = "zinitix,bt413" },
+       { .compatible = "zinitix,bt431" },
+       { .compatible = "zinitix,bt432" },
+       { .compatible = "zinitix,bt531" },
        { .compatible = "zinitix,bt532" },
+       { .compatible = "zinitix,bt538" },
        { .compatible = "zinitix,bt541" },
+       { .compatible = "zinitix,bt548" },
+       { .compatible = "zinitix,bt554" },
+       { .compatible = "zinitix,at100" },
        { }
 };
 MODULE_DEVICE_TABLE(of, zinitix_of_match);