Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: stmfts - set IRQ_NOAUTOEN to the irq flag

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>

authored by

Andi Shyti and committed by
Dmitry Torokhov
cba04cdf 2cdc8749

+8 -3
+8 -3
drivers/input/touchscreen/stmfts.c
··· 682 682 683 683 input_set_drvdata(sdata->input, sdata); 684 684 685 + /* 686 + * stmfts_power_on expects interrupt to be disabled, but 687 + * at this point the device is still off and I do not trust 688 + * the status of the irq line that can generate some spurious 689 + * interrupts. To be on the safe side it's better to not enable 690 + * the interrupts during their request. 691 + */ 692 + irq_set_status_flags(client->irq, IRQ_NOAUTOEN); 685 693 err = devm_request_threaded_irq(&client->dev, client->irq, 686 694 NULL, stmfts_irq_handler, 687 695 IRQF_ONESHOT, 688 696 "stmfts_irq", sdata); 689 697 if (err) 690 698 return err; 691 - 692 - /* stmfts_power_on expects interrupt to be disabled */ 693 - disable_irq(client->irq); 694 699 695 700 dev_dbg(&client->dev, "initializing ST-Microelectronics FTS...\n"); 696 701