]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
Input: stmfts - set IRQ_NOAUTOEN to the irq flag
authorAndi Shyti <andi.shyti@samsung.com>
Tue, 23 Jan 2018 01:32:46 +0000 (17:32 -0800)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 6 Jun 2018 17:44:25 +0000 (13:44 -0400)
BugLink: http://bugs.launchpad.net/bugs/1774063
[ Upstream commit cba04cdf437d745fac85220d1d692a9ae23d7004 ]

The interrupt is requested before the device is powered on and
it's value in some cases cannot be reliable. It happens on some
devices that an interrupt is generated as soon as requested
before having the chance to disable the irq.

Set the irq flag as IRQ_NOAUTOEN before requesting it.

This patch mutes the error:

  stmfts 2-0049: failed to read events: -11

received sometimes during boot time.

Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/input/touchscreen/stmfts.c

index 2a123e20a42e39ce4262b8a7a06e3c57aa9b3080..efdb1a75a163d02c2dfc7bbf14de04569c29f419 100644 (file)
@@ -682,6 +682,14 @@ static int stmfts_probe(struct i2c_client *client,
 
        input_set_drvdata(sdata->input, sdata);
 
+       /*
+        * stmfts_power_on expects interrupt to be disabled, but
+        * at this point the device is still off and I do not trust
+        * the status of the irq line that can generate some spurious
+        * interrupts. To be on the safe side it's better to not enable
+        * the interrupts during their request.
+        */
+       irq_set_status_flags(client->irq, IRQ_NOAUTOEN);
        err = devm_request_threaded_irq(&client->dev, client->irq,
                                        NULL, stmfts_irq_handler,
                                        IRQF_ONESHOT,
@@ -689,9 +697,6 @@ static int stmfts_probe(struct i2c_client *client,
        if (err)
                return err;
 
-       /* stmfts_power_on expects interrupt to be disabled */
-       disable_irq(client->irq);
-
        dev_dbg(&client->dev, "initializing ST-Microelectronics FTS...\n");
 
        err = stmfts_power_on(sdata);