Skip to content

Commit bcd9730

Browse files
Barry Songdtor
authored andcommitted
Input: move to use request_irq by IRQF_NO_AUTOEN flag
disable_irq() after request_irq() still has a time gap in which interrupts can come. request_irq() with IRQF_NO_AUTOEN flag will disable IRQ auto-enable because of requesting. On the other hand, request_irq() after setting IRQ_NOAUTOEN as below irq_set_status_flags(irq, IRQ_NOAUTOEN); request_irq(dev, irq...); can also be replaced by request_irq() with IRQF_NO_AUTOEN flag. Signed-off-by: Barry Song <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 73cdf82 commit bcd9730

File tree

11 files changed

+18
-28
lines changed

11 files changed

+18
-28
lines changed

drivers/input/keyboard/tca6416-keypad.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,15 +274,14 @@ static int tca6416_keypad_probe(struct i2c_client *client,
274274
error = request_threaded_irq(chip->irqnum, NULL,
275275
tca6416_keys_isr,
276276
IRQF_TRIGGER_FALLING |
277-
IRQF_ONESHOT,
277+
IRQF_ONESHOT | IRQF_NO_AUTOEN,
278278
"tca6416-keypad", chip);
279279
if (error) {
280280
dev_dbg(&client->dev,
281281
"Unable to claim irq %d; error %d\n",
282282
chip->irqnum, error);
283283
goto fail1;
284284
}
285-
disable_irq(chip->irqnum);
286285
}
287286

288287
error = input_register_device(input);

drivers/input/keyboard/tegra-kbc.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -694,14 +694,13 @@ static int tegra_kbc_probe(struct platform_device *pdev)
694694
input_set_drvdata(kbc->idev, kbc);
695695

696696
err = devm_request_irq(&pdev->dev, kbc->irq, tegra_kbc_isr,
697-
IRQF_TRIGGER_HIGH, pdev->name, kbc);
697+
IRQF_TRIGGER_HIGH | IRQF_NO_AUTOEN,
698+
pdev->name, kbc);
698699
if (err) {
699700
dev_err(&pdev->dev, "failed to request keyboard IRQ\n");
700701
return err;
701702
}
702703

703-
disable_irq(kbc->irq);
704-
705704
err = input_register_device(kbc->idev);
706705
if (err) {
707706
dev_err(&pdev->dev, "failed to register input device\n");

drivers/input/touchscreen/ar1021_i2c.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,17 +125,14 @@ static int ar1021_i2c_probe(struct i2c_client *client,
125125

126126
error = devm_request_threaded_irq(&client->dev, client->irq,
127127
NULL, ar1021_i2c_irq,
128-
IRQF_ONESHOT,
128+
IRQF_ONESHOT | IRQF_NO_AUTOEN,
129129
"ar1021_i2c", ar1021);
130130
if (error) {
131131
dev_err(&client->dev,
132132
"Failed to enable IRQ, error: %d\n", error);
133133
return error;
134134
}
135135

136-
/* Disable the IRQ, we'll enable it in ar1021_i2c_open() */
137-
disable_irq(client->irq);
138-
139136
error = input_register_device(ar1021->input);
140137
if (error) {
141138
dev_err(&client->dev,

drivers/input/touchscreen/atmel_mxt_ts.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3215,15 +3215,14 @@ static int mxt_probe(struct i2c_client *client, const struct i2c_device_id *id)
32153215
}
32163216

32173217
error = devm_request_threaded_irq(&client->dev, client->irq,
3218-
NULL, mxt_interrupt, IRQF_ONESHOT,
3218+
NULL, mxt_interrupt,
3219+
IRQF_ONESHOT | IRQF_NO_AUTOEN,
32193220
client->name, data);
32203221
if (error) {
32213222
dev_err(&client->dev, "Failed to register interrupt\n");
32223223
return error;
32233224
}
32243225

3225-
disable_irq(client->irq);
3226-
32273226
error = regulator_bulk_enable(ARRAY_SIZE(data->regulators),
32283227
data->regulators);
32293228
if (error) {

drivers/input/touchscreen/bu21029_ts.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,10 +401,10 @@ static int bu21029_probe(struct i2c_client *client,
401401

402402
input_set_drvdata(in_dev, bu21029);
403403

404-
irq_set_status_flags(client->irq, IRQ_NOAUTOEN);
405404
error = devm_request_threaded_irq(&client->dev, client->irq,
406405
NULL, bu21029_touch_soft_irq,
407-
IRQF_ONESHOT, DRIVER_NAME, bu21029);
406+
IRQF_ONESHOT | IRQF_NO_AUTOEN,
407+
DRIVER_NAME, bu21029);
408408
if (error) {
409409
dev_err(&client->dev,
410410
"unable to request touch irq: %d\n", error);

drivers/input/touchscreen/cyttsp_core.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -655,16 +655,15 @@ struct cyttsp *cyttsp_probe(const struct cyttsp_bus_ops *bus_ops,
655655
}
656656

657657
error = devm_request_threaded_irq(dev, ts->irq, NULL, cyttsp_irq,
658-
IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
658+
IRQF_TRIGGER_FALLING | IRQF_ONESHOT |
659+
IRQF_NO_AUTOEN,
659660
"cyttsp", ts);
660661
if (error) {
661662
dev_err(ts->dev, "failed to request IRQ %d, err: %d\n",
662663
ts->irq, error);
663664
return ERR_PTR(error);
664665
}
665666

666-
disable_irq(ts->irq);
667-
668667
cyttsp_hard_reset(ts);
669668

670669
error = cyttsp_power_on(ts);

drivers/input/touchscreen/melfas_mip4.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,16 +1502,15 @@ static int mip4_probe(struct i2c_client *client, const struct i2c_device_id *id)
15021502

15031503
error = devm_request_threaded_irq(&client->dev, client->irq,
15041504
NULL, mip4_interrupt,
1505-
IRQF_ONESHOT, MIP4_DEVICE_NAME, ts);
1505+
IRQF_ONESHOT | IRQF_NO_AUTOEN,
1506+
MIP4_DEVICE_NAME, ts);
15061507
if (error) {
15071508
dev_err(&client->dev,
15081509
"Failed to request interrupt %d: %d\n",
15091510
client->irq, error);
15101511
return error;
15111512
}
15121513

1513-
disable_irq(client->irq);
1514-
15151514
error = input_register_device(input);
15161515
if (error) {
15171516
dev_err(&client->dev,

drivers/input/touchscreen/mms114.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,13 +530,13 @@ static int mms114_probe(struct i2c_client *client,
530530
}
531531

532532
error = devm_request_threaded_irq(&client->dev, client->irq,
533-
NULL, mms114_interrupt, IRQF_ONESHOT,
533+
NULL, mms114_interrupt,
534+
IRQF_ONESHOT | IRQF_NO_AUTOEN,
534535
dev_name(&client->dev), data);
535536
if (error) {
536537
dev_err(&client->dev, "Failed to register interrupt\n");
537538
return error;
538539
}
539-
disable_irq(client->irq);
540540

541541
error = input_register_device(data->input_dev);
542542
if (error) {

drivers/input/touchscreen/stmfts.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -691,10 +691,9 @@ static int stmfts_probe(struct i2c_client *client,
691691
* interrupts. To be on the safe side it's better to not enable
692692
* the interrupts during their request.
693693
*/
694-
irq_set_status_flags(client->irq, IRQ_NOAUTOEN);
695694
err = devm_request_threaded_irq(&client->dev, client->irq,
696695
NULL, stmfts_irq_handler,
697-
IRQF_ONESHOT,
696+
IRQF_ONESHOT | IRQF_NO_AUTOEN,
698697
"stmfts_irq", sdata);
699698
if (err)
700699
return err;

drivers/input/touchscreen/wm831x-ts.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,14 +317,13 @@ static int wm831x_ts_probe(struct platform_device *pdev)
317317

318318
error = request_threaded_irq(wm831x_ts->data_irq,
319319
NULL, wm831x_ts_data_irq,
320-
irqf | IRQF_ONESHOT,
320+
irqf | IRQF_ONESHOT | IRQF_NO_AUTOEN,
321321
"Touchscreen data", wm831x_ts);
322322
if (error) {
323323
dev_err(&pdev->dev, "Failed to request data IRQ %d: %d\n",
324324
wm831x_ts->data_irq, error);
325325
goto err_alloc;
326326
}
327-
disable_irq(wm831x_ts->data_irq);
328327

329328
if (pdata && pdata->pd_irqf)
330329
irqf = pdata->pd_irqf;

0 commit comments

Comments
 (0)