History

Input: request threaded-only IRQs with IRQF_ONESHOT

Since commit 1c6c69525b ("genirq: Reject bogus threaded irq requests") threaded IRQs without a primary handler need to be requested with IRQF_ONESHOT, otherwise the request will fail. This patch adds the IRQF_ONESHOT to input drivers where it is missing. Not modified by this patch are those drivers where the requested IRQ will always be a nested IRQ (e.g. because it's part of an MFD), since for this special case IRQF_ONESHOT is not required to be specified when requesting the IRQ.

Lars-Peter Clausen committed 14 years ago

Commit 9b7e31b1 parent 1cecc5c17 files · +34 −23Browse files

Unified · Split

17 files
  1. drivers/input/joystick/as5011.c +3 −2
  2. drivers/input/keyboard/mcs_touchkey.c +2 −1
  3. drivers/input/keyboard/mpr121_touchkey.c +1 −1
  4. drivers/input/keyboard/qt1070.c +2 −1
  5. drivers/input/keyboard/tca6416-keypad.c +2 −1
  6. drivers/input/keyboard/tca8418_keypad.c +1 −1
  7. drivers/input/keyboard/tnetv107x-keypad.c +4 −4
  8. drivers/input/misc/ad714x.c +5 −3
  9. drivers/input/misc/dm355evm_keys.c +2 −1
  10. drivers/input/touchscreen/ad7879.c +1 −1
  11. drivers/input/touchscreen/atmel_mxt_ts.c +2 −1
  12. drivers/input/touchscreen/bu21013_ts.c +2 −1
  13. drivers/input/touchscreen/cy8ctmg110_ts.c +2 −1
  14. drivers/input/touchscreen/intel-mid-touch.c +1 −1
  15. drivers/input/touchscreen/pixcir_i2c_ts.c +1 −1
  16. drivers/input/touchscreen/tnetv107x-ts.c +1 −1
  17. drivers/input/touchscreen/tsc2005.c +2 −1
drivers/input/joystick/as5011.c+3−2
@@ -281,7 +281,8 @@ static int __devinit as5011_probe(struct i2c_client *client, · 280 unmodified lines
281281
282282 error = request_threaded_irq(as5011->button_irq,
283283 NULL, as5011_button_interrupt,
284− IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
284+ IRQF_TRIGGER_RISING |
285+ IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
285286 "as5011_button", as5011);
286287 if (error < 0) {
287288 dev_err(&client->dev,
@@ -295,7 +296,7 @@ static int __devinit as5011_probe(struct i2c_client *client, · 7 unmodified lines
295296
296297 error = request_threaded_irq(as5011->axis_irq, NULL,
297298 as5011_axis_interrupt,
298− plat_data->axis_irqflags,
299+ plat_data->axis_irqflags | IRQF_ONESHOT,
299300 "as5011_joystick", as5011);
300301 if (error) {
301302 dev_err(&client->dev,
drivers/input/keyboard/mcs_touchkey.c+2−1
@@ -178,7 +178,8 @@ static int __devinit mcs_touchkey_probe(struct i2c_client *client, · 177 unmodified lines
178178 }
179179
180180 error = request_threaded_irq(client->irq, NULL, mcs_touchkey_interrupt,
181− IRQF_TRIGGER_FALLING, client->dev.driver->name, data);
181+ IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
182+ client->dev.driver->name, data);
182183 if (error) {
183184 dev_err(&client->dev, "Failed to register interrupt\n");
184185 goto err_free_mem;
drivers/input/keyboard/mpr121_touchkey.c+1−1
@@ -248,7 +248,7 @@ static int __devinit mpr_touchkey_probe(struct i2c_client *client, · 247 unmodified lines
248248
249249 error = request_threaded_irq(client->irq, NULL,
250250 mpr_touchkey_interrupt,
251− IRQF_TRIGGER_FALLING,
251+ IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
252252 client->dev.driver->name, mpr121);
253253 if (error) {
254254 dev_err(&client->dev, "Failed to register interrupt\n");
drivers/input/keyboard/qt1070.c+2−1
@@ -201,7 +201,8 @@ static int __devinit qt1070_probe(struct i2c_client *client, · 200 unmodified lines
201201 msleep(QT1070_RESET_TIME);
202202
203203 err = request_threaded_irq(client->irq, NULL, qt1070_interrupt,
204− IRQF_TRIGGER_NONE, client->dev.driver->name, data);
204+ IRQF_TRIGGER_NONE | IRQF_ONESHOT,
205+ client->dev.driver->name, data);
205206 if (err) {
206207 dev_err(&client->dev, "fail to request irq\n");
207208 goto err_free_mem;
drivers/input/keyboard/tca6416-keypad.c+2−1
@@ -278,7 +278,8 @@ static int __devinit tca6416_keypad_probe(struct i2c_client *client, · 277 unmodified lines
278278
279279 error = request_threaded_irq(chip->irqnum, NULL,
280280 tca6416_keys_isr,
281− IRQF_TRIGGER_FALLING,
281+ IRQF_TRIGGER_FALLING |
282+ IRQF_ONESHOT,
282283 "tca6416-keypad", chip);
283284 if (error) {
284285 dev_dbg(&client->dev,
drivers/input/keyboard/tca8418_keypad.c+1−1
@@ -360,7 +360,7 @@ static int __devinit tca8418_keypad_probe(struct i2c_client *client, · 359 unmodified lines
360360 client->irq = gpio_to_irq(client->irq);
361361
362362 error = request_threaded_irq(client->irq, NULL, tca8418_irq_handler,
363− IRQF_TRIGGER_FALLING,
363+ IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
364364 client->name, keypad_data);
365365 if (error) {
366366 dev_dbg(&client->dev,
drivers/input/keyboard/tnetv107x-keypad.c+4−4
@@ -227,15 +227,15 @@ static int __devinit keypad_probe(struct platform_device *pdev) · 226 unmodified lines
227227 goto error_clk;
228228 }
229229
230− error = request_threaded_irq(kp->irq_press, NULL, keypad_irq, 0,
231− dev_name(dev), kp);
230+ error = request_threaded_irq(kp->irq_press, NULL, keypad_irq,
231+ IRQF_ONESHOT, dev_name(dev), kp);
232232 if (error < 0) {
233233 dev_err(kp->dev, "Could not allocate keypad press key irq\n");
234234 goto error_irq_press;
235235 }
236236
237− error = request_threaded_irq(kp->irq_release, NULL, keypad_irq, 0,
238− dev_name(dev), kp);
237+ error = request_threaded_irq(kp->irq_release, NULL, keypad_irq,
238+ IRQF_ONESHOT, dev_name(dev), kp);
239239 if (error < 0) {
240240 dev_err(kp->dev, "Could not allocate keypad release key irq\n");
241241 goto error_irq_release;
drivers/input/misc/ad714x.c+5−3
@@ -972,6 +972,7 @@ struct ad714x_chip *ad714x_probe(struct device *dev, u16 bus_type, int irq, · 971 unmodified lines
972972 struct ad714x_platform_data *plat_data = dev->platform_data;
973973 struct ad714x_chip *ad714x;
974974 void *drv_mem;
975+ unsigned long irqflags;
975976
976977 struct ad714x_button_drv *bt_drv;
977978 struct ad714x_slider_drv *sd_drv;
@@ -1162,10 +1163,11 @@ struct ad714x_chip *ad714x_probe(struct device *dev, u16 bus_type, int irq, · 184 unmodified lines
11621163 alloc_idx++;
11631164 }
11641165
1166+ irqflags = plat_data->irqflags ?: IRQF_TRIGGER_FALLING;
1167+ irqflags |= IRQF_ONESHOT;
1168+
11651169 error = request_threaded_irq(ad714x->irq, NULL, ad714x_interrupt_thread,
1166− plat_data->irqflags ?
1167− plat_data->irqflags : IRQF_TRIGGER_FALLING,
1168− "ad714x_captouch", ad714x);
1170+ irqflags, "ad714x_captouch", ad714x);
11691171 if (error) {
11701172 dev_err(dev, "can't allocate irq %d\n", ad714x->irq);
11711173 goto err_unreg_dev;
drivers/input/misc/dm355evm_keys.c+2−1
@@ -213,7 +213,8 @@ static int __devinit dm355evm_keys_probe(struct platform_device *pdev) · 212 unmodified lines
213213 /* REVISIT: flush the event queue? */
214214
215215 status = request_threaded_irq(keys->irq, NULL, dm355evm_keys_irq,
216− IRQF_TRIGGER_FALLING, dev_name(&pdev->dev), keys);
216+ IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
217+ dev_name(&pdev->dev), keys);
217218 if (status < 0)
218219 goto fail2;
219220
drivers/input/touchscreen/ad7879.c+1−1
@@ -597,7 +597,7 @@ struct ad7879 *ad7879_probe(struct device *dev, u8 devid, unsigned int irq, · 596 unmodified lines
597597 AD7879_TMR(ts->pen_down_acc_interval);
598598
599599 err = request_threaded_irq(ts->irq, NULL, ad7879_irq,
600− IRQF_TRIGGER_FALLING,
600+ IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
601601 dev_name(dev), ts);
602602 if (err) {
603603 dev_err(dev, "irq %d busy?\n", ts->irq);
drivers/input/touchscreen/atmel_mxt_ts.c+2−1
@@ -1149,7 +1149,8 @@ static int __devinit mxt_probe(struct i2c_client *client, · 1148 unmodified lines
11491149 goto err_free_object;
11501150
11511151 error = request_threaded_irq(client->irq, NULL, mxt_interrupt,
1152− pdata->irqflags, client->dev.driver->name, data);
1152+ pdata->irqflags | IRQF_ONESHOT,
1153+ client->dev.driver->name, data);
11531154 if (error) {
11541155 dev_err(&client->dev, "Failed to register interrupt\n");
11551156 goto err_free_object;
drivers/input/touchscreen/bu21013_ts.c+2−1
@@ -509,7 +509,8 @@ static int __devinit bu21013_probe(struct i2c_client *client, · 508 unmodified lines
509509 input_set_drvdata(in_dev, bu21013_data);
510510
511511 error = request_threaded_irq(pdata->irq, NULL, bu21013_gpio_irq,
512− IRQF_TRIGGER_FALLING | IRQF_SHARED,
512+ IRQF_TRIGGER_FALLING | IRQF_SHARED |
513+ IRQF_ONESHOT,
513514 DRIVER_TP, bu21013_data);
514515 if (error) {
515516 dev_err(&client->dev, "request irq %d failed\n", pdata->irq);
drivers/input/touchscreen/cy8ctmg110_ts.c+2−1
@@ -251,7 +251,8 @@ static int __devinit cy8ctmg110_probe(struct i2c_client *client, · 250 unmodified lines
251251 }
252252
253253 err = request_threaded_irq(client->irq, NULL, cy8ctmg110_irq_thread,
254− IRQF_TRIGGER_RISING, "touch_reset_key", ts);
254+ IRQF_TRIGGER_RISING | IRQF_ONESHOT,
255+ "touch_reset_key", ts);
255256 if (err < 0) {
256257 dev_err(&client->dev,
257258 "irq %d busy? error %d\n", client->irq, err);
drivers/input/touchscreen/intel-mid-touch.c+1−1
@@ -620,7 +620,7 @@ static int __devinit mrstouch_probe(struct platform_device *pdev) · 619 unmodified lines
620620 MRST_PRESSURE_MIN, MRST_PRESSURE_MAX, 0, 0);
621621
622622 err = request_threaded_irq(tsdev->irq, NULL, mrstouch_pendet_irq,
623− 0, "mrstouch", tsdev);
623+ IRQF_ONESHOT, "mrstouch", tsdev);
624624 if (err) {
625625 dev_err(tsdev->dev, "unable to allocate irq\n");
626626 goto err_free_mem;
drivers/input/touchscreen/pixcir_i2c_ts.c+1−1
@@ -165,7 +165,7 @@ static int __devinit pixcir_i2c_ts_probe(struct i2c_client *client, · 164 unmodified lines
165165 input_set_drvdata(input, tsdata);
166166
167167 error = request_threaded_irq(client->irq, NULL, pixcir_ts_isr,
168− IRQF_TRIGGER_FALLING,
168+ IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
169169 client->name, tsdata);
170170 if (error) {
171171 dev_err(&client->dev, "Unable to request touchscreen IRQ.\n");
drivers/input/touchscreen/tnetv107x-ts.c+1−1
@@ -297,7 +297,7 @@ static int __devinit tsc_probe(struct platform_device *pdev) · 296 unmodified lines
297297 goto error_clk;
298298 }
299299
300− error = request_threaded_irq(ts->tsc_irq, NULL, tsc_irq, 0,
300+ error = request_threaded_irq(ts->tsc_irq, NULL, tsc_irq, IRQF_ONESHOT,
301301 dev_name(dev), ts);
302302 if (error < 0) {
303303 dev_err(ts->dev, "Could not allocate ts irq\n");
drivers/input/touchscreen/tsc2005.c+2−1
@@ -650,7 +650,8 @@ static int __devinit tsc2005_probe(struct spi_device *spi) · 649 unmodified lines
650650 tsc2005_stop_scan(ts);
651651
652652 error = request_threaded_irq(spi->irq, NULL, tsc2005_irq_thread,
653− IRQF_TRIGGER_RISING, "tsc2005", ts);
653+ IRQF_TRIGGER_RISING | IRQF_ONESHOT,
654+ "tsc2005", ts);
654655 if (error) {
655656 dev_err(&spi->dev, "Failed to request irq, err: %d\n", error);
656657 goto err_free_mem;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t