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
281 281
282 error = request_threaded_irq(as5011->button_irq,282 error = request_threaded_irq(as5011->button_irq,
283 NULL, as5011_button_interrupt,283 NULL, as5011_button_interrupt,
284 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,284 IRQF_TRIGGER_RISING |
285 IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
285 "as5011_button", as5011);286 "as5011_button", as5011);
286 if (error < 0) {287 if (error < 0) {
287 dev_err(&client->dev,288 dev_err(&client->dev,
@@ -295,7 +296,7 @@ static int __devinit as5011_probe(struct i2c_client *client, · 7 unmodified lines
295 296
296 error = request_threaded_irq(as5011->axis_irq, NULL,297 error = request_threaded_irq(as5011->axis_irq, NULL,
297 as5011_axis_interrupt,298 as5011_axis_interrupt,
298 plat_data->axis_irqflags,299 plat_data->axis_irqflags | IRQF_ONESHOT,
299 "as5011_joystick", as5011);300 "as5011_joystick", as5011);
300 if (error) {301 if (error) {
301 dev_err(&client->dev,302 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
178 }178 }
179 179
180 error = request_threaded_irq(client->irq, NULL, mcs_touchkey_interrupt,180 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);
182 if (error) {183 if (error) {
183 dev_err(&client->dev, "Failed to register interrupt\n");184 dev_err(&client->dev, "Failed to register interrupt\n");
184 goto err_free_mem;185 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
248 248
249 error = request_threaded_irq(client->irq, NULL,249 error = request_threaded_irq(client->irq, NULL,
250 mpr_touchkey_interrupt,250 mpr_touchkey_interrupt,
251 IRQF_TRIGGER_FALLING,251 IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
252 client->dev.driver->name, mpr121);252 client->dev.driver->name, mpr121);
253 if (error) {253 if (error) {
254 dev_err(&client->dev, "Failed to register interrupt\n");254 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
201 msleep(QT1070_RESET_TIME);201 msleep(QT1070_RESET_TIME);
202 202
203 err = request_threaded_irq(client->irq, NULL, qt1070_interrupt,203 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);
205 if (err) {206 if (err) {
206 dev_err(&client->dev, "fail to request irq\n");207 dev_err(&client->dev, "fail to request irq\n");
207 goto err_free_mem;208 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
278 278
279 error = request_threaded_irq(chip->irqnum, NULL,279 error = request_threaded_irq(chip->irqnum, NULL,
280 tca6416_keys_isr,280 tca6416_keys_isr,
281 IRQF_TRIGGER_FALLING,281 IRQF_TRIGGER_FALLING |
282 IRQF_ONESHOT,
282 "tca6416-keypad", chip);283 "tca6416-keypad", chip);
283 if (error) {284 if (error) {
284 dev_dbg(&client->dev,285 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
360 client->irq = gpio_to_irq(client->irq);360 client->irq = gpio_to_irq(client->irq);
361 361
362 error = request_threaded_irq(client->irq, NULL, tca8418_irq_handler,362 error = request_threaded_irq(client->irq, NULL, tca8418_irq_handler,
363 IRQF_TRIGGER_FALLING,363 IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
364 client->name, keypad_data);364 client->name, keypad_data);
365 if (error) {365 if (error) {
366 dev_dbg(&client->dev,366 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
227 goto error_clk;227 goto error_clk;
228 }228 }
229 229
230 error = request_threaded_irq(kp->irq_press, NULL, keypad_irq, 0,230 error = request_threaded_irq(kp->irq_press, NULL, keypad_irq,
231 dev_name(dev), kp);231 IRQF_ONESHOT, dev_name(dev), kp);
232 if (error < 0) {232 if (error < 0) {
233 dev_err(kp->dev, "Could not allocate keypad press key irq\n");233 dev_err(kp->dev, "Could not allocate keypad press key irq\n");
234 goto error_irq_press;234 goto error_irq_press;
235 }235 }
236 236
237 error = request_threaded_irq(kp->irq_release, NULL, keypad_irq, 0,237 error = request_threaded_irq(kp->irq_release, NULL, keypad_irq,
238 dev_name(dev), kp);238 IRQF_ONESHOT, dev_name(dev), kp);
239 if (error < 0) {239 if (error < 0) {
240 dev_err(kp->dev, "Could not allocate keypad release key irq\n");240 dev_err(kp->dev, "Could not allocate keypad release key irq\n");
241 goto error_irq_release;241 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
972 struct ad714x_platform_data *plat_data = dev->platform_data;972 struct ad714x_platform_data *plat_data = dev->platform_data;
973 struct ad714x_chip *ad714x;973 struct ad714x_chip *ad714x;
974 void *drv_mem;974 void *drv_mem;
975 unsigned long irqflags;
975 976
976 struct ad714x_button_drv *bt_drv;977 struct ad714x_button_drv *bt_drv;
977 struct ad714x_slider_drv *sd_drv;978 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
1162 alloc_idx++;1163 alloc_idx++;
1163 }1164 }
1164 1165
1166 irqflags = plat_data->irqflags ?: IRQF_TRIGGER_FALLING;
1167 irqflags |= IRQF_ONESHOT;
1168
1165 error = request_threaded_irq(ad714x->irq, NULL, ad714x_interrupt_thread,1169 error = request_threaded_irq(ad714x->irq, NULL, ad714x_interrupt_thread,
1166 plat_data->irqflags ?1170 irqflags, "ad714x_captouch", ad714x);
1167 plat_data->irqflags : IRQF_TRIGGER_FALLING,
1168 "ad714x_captouch", ad714x);
1169 if (error) {1171 if (error) {
1170 dev_err(dev, "can't allocate irq %d\n", ad714x->irq);1172 dev_err(dev, "can't allocate irq %d\n", ad714x->irq);
1171 goto err_unreg_dev;1173 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
213 /* REVISIT: flush the event queue? */213 /* REVISIT: flush the event queue? */
214 214
215 status = request_threaded_irq(keys->irq, NULL, dm355evm_keys_irq,215 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);
217 if (status < 0)218 if (status < 0)
218 goto fail2;219 goto fail2;
219 220
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
597 AD7879_TMR(ts->pen_down_acc_interval);597 AD7879_TMR(ts->pen_down_acc_interval);
598 598
599 err = request_threaded_irq(ts->irq, NULL, ad7879_irq,599 err = request_threaded_irq(ts->irq, NULL, ad7879_irq,
600 IRQF_TRIGGER_FALLING,600 IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
601 dev_name(dev), ts);601 dev_name(dev), ts);
602 if (err) {602 if (err) {
603 dev_err(dev, "irq %d busy?\n", ts->irq);603 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
1149 goto err_free_object;1149 goto err_free_object;
1150 1150
1151 error = request_threaded_irq(client->irq, NULL, mxt_interrupt,1151 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);
1153 if (error) {1154 if (error) {
1154 dev_err(&client->dev, "Failed to register interrupt\n");1155 dev_err(&client->dev, "Failed to register interrupt\n");
1155 goto err_free_object;1156 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
509 input_set_drvdata(in_dev, bu21013_data);509 input_set_drvdata(in_dev, bu21013_data);
510 510
511 error = request_threaded_irq(pdata->irq, NULL, bu21013_gpio_irq,511 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,
513 DRIVER_TP, bu21013_data);514 DRIVER_TP, bu21013_data);
514 if (error) {515 if (error) {
515 dev_err(&client->dev, "request irq %d failed\n", pdata->irq);516 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
251 }251 }
252 252
253 err = request_threaded_irq(client->irq, NULL, cy8ctmg110_irq_thread,253 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);
255 if (err < 0) {256 if (err < 0) {
256 dev_err(&client->dev,257 dev_err(&client->dev,
257 "irq %d busy? error %d\n", client->irq, err);258 "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
620 MRST_PRESSURE_MIN, MRST_PRESSURE_MAX, 0, 0);620 MRST_PRESSURE_MIN, MRST_PRESSURE_MAX, 0, 0);
621 621
622 err = request_threaded_irq(tsdev->irq, NULL, mrstouch_pendet_irq,622 err = request_threaded_irq(tsdev->irq, NULL, mrstouch_pendet_irq,
623 0, "mrstouch", tsdev);623 IRQF_ONESHOT, "mrstouch", tsdev);
624 if (err) {624 if (err) {
625 dev_err(tsdev->dev, "unable to allocate irq\n");625 dev_err(tsdev->dev, "unable to allocate irq\n");
626 goto err_free_mem;626 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
165 input_set_drvdata(input, tsdata);165 input_set_drvdata(input, tsdata);
166 166
167 error = request_threaded_irq(client->irq, NULL, pixcir_ts_isr,167 error = request_threaded_irq(client->irq, NULL, pixcir_ts_isr,
168 IRQF_TRIGGER_FALLING,168 IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
169 client->name, tsdata);169 client->name, tsdata);
170 if (error) {170 if (error) {
171 dev_err(&client->dev, "Unable to request touchscreen IRQ.\n");171 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
297 goto error_clk;297 goto error_clk;
298 }298 }
299 299
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,
301 dev_name(dev), ts);301 dev_name(dev), ts);
302 if (error < 0) {302 if (error < 0) {
303 dev_err(ts->dev, "Could not allocate ts irq\n");303 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
650 tsc2005_stop_scan(ts);650 tsc2005_stop_scan(ts);
651 651
652 error = request_threaded_irq(spi->irq, NULL, tsc2005_irq_thread,652 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);
654 if (error) {655 if (error) {
655 dev_err(&spi->dev, "Failed to request irq, err: %d\n", error);656 dev_err(&spi->dev, "Failed to request irq, err: %d\n", error);
656 goto err_free_mem;657 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