diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2012-07-04 16:02:56 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-07-04 16:12:19 -0400 |
commit | 9b7e31bbf4bb58b12e11a7f24b7c3e48bbd2f4da (patch) | |
tree | ca55c470f22dbccb53f3c3ed4683342cbd92c515 /drivers/input | |
parent | 1cecc5cc0658e128bcad0b29edb96f286066571d (diff) |
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.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/joystick/as5011.c | 5 | ||||
-rw-r--r-- | drivers/input/keyboard/mcs_touchkey.c | 3 | ||||
-rw-r--r-- | drivers/input/keyboard/mpr121_touchkey.c | 2 | ||||
-rw-r--r-- | drivers/input/keyboard/qt1070.c | 3 | ||||
-rw-r--r-- | drivers/input/keyboard/tca6416-keypad.c | 3 | ||||
-rw-r--r-- | drivers/input/keyboard/tca8418_keypad.c | 2 | ||||
-rw-r--r-- | drivers/input/keyboard/tnetv107x-keypad.c | 8 | ||||
-rw-r--r-- | drivers/input/misc/ad714x.c | 8 | ||||
-rw-r--r-- | drivers/input/misc/dm355evm_keys.c | 3 | ||||
-rw-r--r-- | drivers/input/touchscreen/ad7879.c | 2 | ||||
-rw-r--r-- | drivers/input/touchscreen/atmel_mxt_ts.c | 3 | ||||
-rw-r--r-- | drivers/input/touchscreen/bu21013_ts.c | 3 | ||||
-rw-r--r-- | drivers/input/touchscreen/cy8ctmg110_ts.c | 3 | ||||
-rw-r--r-- | drivers/input/touchscreen/intel-mid-touch.c | 2 | ||||
-rw-r--r-- | drivers/input/touchscreen/pixcir_i2c_ts.c | 2 | ||||
-rw-r--r-- | drivers/input/touchscreen/tnetv107x-ts.c | 2 | ||||
-rw-r--r-- | drivers/input/touchscreen/tsc2005.c | 3 |
17 files changed, 34 insertions, 23 deletions
diff --git a/drivers/input/joystick/as5011.c b/drivers/input/joystick/as5011.c index 3063464474bf..feeefcb09e78 100644 --- a/drivers/input/joystick/as5011.c +++ b/drivers/input/joystick/as5011.c | |||
@@ -281,7 +281,8 @@ static int __devinit as5011_probe(struct i2c_client *client, | |||
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, | |||
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, |
diff --git a/drivers/input/keyboard/mcs_touchkey.c b/drivers/input/keyboard/mcs_touchkey.c index 64a0ca4c92f3..0d77f6c84950 100644 --- a/drivers/input/keyboard/mcs_touchkey.c +++ b/drivers/input/keyboard/mcs_touchkey.c | |||
@@ -178,7 +178,8 @@ static int __devinit mcs_touchkey_probe(struct i2c_client *client, | |||
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; |
diff --git a/drivers/input/keyboard/mpr121_touchkey.c b/drivers/input/keyboard/mpr121_touchkey.c index caa218a51b5a..7613f1cac951 100644 --- a/drivers/input/keyboard/mpr121_touchkey.c +++ b/drivers/input/keyboard/mpr121_touchkey.c | |||
@@ -248,7 +248,7 @@ static int __devinit mpr_touchkey_probe(struct i2c_client *client, | |||
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"); |
diff --git a/drivers/input/keyboard/qt1070.c b/drivers/input/keyboard/qt1070.c index 0b7b2f891752..ca68f2992d72 100644 --- a/drivers/input/keyboard/qt1070.c +++ b/drivers/input/keyboard/qt1070.c | |||
@@ -201,7 +201,8 @@ static int __devinit qt1070_probe(struct i2c_client *client, | |||
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; |
diff --git a/drivers/input/keyboard/tca6416-keypad.c b/drivers/input/keyboard/tca6416-keypad.c index 3afea3f89718..c355cdde8d22 100644 --- a/drivers/input/keyboard/tca6416-keypad.c +++ b/drivers/input/keyboard/tca6416-keypad.c | |||
@@ -278,7 +278,8 @@ static int __devinit tca6416_keypad_probe(struct i2c_client *client, | |||
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, |
diff --git a/drivers/input/keyboard/tca8418_keypad.c b/drivers/input/keyboard/tca8418_keypad.c index 5f87b28b3192..893869b29ed9 100644 --- a/drivers/input/keyboard/tca8418_keypad.c +++ b/drivers/input/keyboard/tca8418_keypad.c | |||
@@ -360,7 +360,7 @@ static int __devinit tca8418_keypad_probe(struct i2c_client *client, | |||
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, |
diff --git a/drivers/input/keyboard/tnetv107x-keypad.c b/drivers/input/keyboard/tnetv107x-keypad.c index a4a445fb7020..4c34f21fbe2d 100644 --- a/drivers/input/keyboard/tnetv107x-keypad.c +++ b/drivers/input/keyboard/tnetv107x-keypad.c | |||
@@ -227,15 +227,15 @@ static int __devinit keypad_probe(struct platform_device *pdev) | |||
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; |
diff --git a/drivers/input/misc/ad714x.c b/drivers/input/misc/ad714x.c index 0ac75bbad4d6..2e5d5e1de647 100644 --- a/drivers/input/misc/ad714x.c +++ b/drivers/input/misc/ad714x.c | |||
@@ -972,6 +972,7 @@ struct ad714x_chip *ad714x_probe(struct device *dev, u16 bus_type, int irq, | |||
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, | |||
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; |
diff --git a/drivers/input/misc/dm355evm_keys.c b/drivers/input/misc/dm355evm_keys.c index 35083c6836c3..c1313d8535c3 100644 --- a/drivers/input/misc/dm355evm_keys.c +++ b/drivers/input/misc/dm355evm_keys.c | |||
@@ -213,7 +213,8 @@ static int __devinit dm355evm_keys_probe(struct platform_device *pdev) | |||
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 | ||
diff --git a/drivers/input/touchscreen/ad7879.c b/drivers/input/touchscreen/ad7879.c index e2482b40da51..bd4eb4277697 100644 --- a/drivers/input/touchscreen/ad7879.c +++ b/drivers/input/touchscreen/ad7879.c | |||
@@ -597,7 +597,7 @@ struct ad7879 *ad7879_probe(struct device *dev, u8 devid, unsigned int irq, | |||
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); |
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index 42e645062c20..25fd0561a17d 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c | |||
@@ -1149,7 +1149,8 @@ static int __devinit mxt_probe(struct i2c_client *client, | |||
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; |
diff --git a/drivers/input/touchscreen/bu21013_ts.c b/drivers/input/touchscreen/bu21013_ts.c index f2d03c06c2da..5c487d23f11c 100644 --- a/drivers/input/touchscreen/bu21013_ts.c +++ b/drivers/input/touchscreen/bu21013_ts.c | |||
@@ -509,7 +509,8 @@ static int __devinit bu21013_probe(struct i2c_client *client, | |||
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); |
diff --git a/drivers/input/touchscreen/cy8ctmg110_ts.c b/drivers/input/touchscreen/cy8ctmg110_ts.c index 237753ad1031..464f1bf4b61d 100644 --- a/drivers/input/touchscreen/cy8ctmg110_ts.c +++ b/drivers/input/touchscreen/cy8ctmg110_ts.c | |||
@@ -251,7 +251,8 @@ static int __devinit cy8ctmg110_probe(struct i2c_client *client, | |||
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); |
diff --git a/drivers/input/touchscreen/intel-mid-touch.c b/drivers/input/touchscreen/intel-mid-touch.c index 3cd7a837f82b..cf299377fc49 100644 --- a/drivers/input/touchscreen/intel-mid-touch.c +++ b/drivers/input/touchscreen/intel-mid-touch.c | |||
@@ -620,7 +620,7 @@ static int __devinit mrstouch_probe(struct platform_device *pdev) | |||
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; |
diff --git a/drivers/input/touchscreen/pixcir_i2c_ts.c b/drivers/input/touchscreen/pixcir_i2c_ts.c index 72f6ba3a4709..953b4c105cad 100644 --- a/drivers/input/touchscreen/pixcir_i2c_ts.c +++ b/drivers/input/touchscreen/pixcir_i2c_ts.c | |||
@@ -165,7 +165,7 @@ static int __devinit pixcir_i2c_ts_probe(struct i2c_client *client, | |||
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"); |
diff --git a/drivers/input/touchscreen/tnetv107x-ts.c b/drivers/input/touchscreen/tnetv107x-ts.c index 7e7488097359..368d2c6cf780 100644 --- a/drivers/input/touchscreen/tnetv107x-ts.c +++ b/drivers/input/touchscreen/tnetv107x-ts.c | |||
@@ -297,7 +297,7 @@ static int __devinit tsc_probe(struct platform_device *pdev) | |||
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"); |
diff --git a/drivers/input/touchscreen/tsc2005.c b/drivers/input/touchscreen/tsc2005.c index b6adeaee9cc5..5ce3fa8ce646 100644 --- a/drivers/input/touchscreen/tsc2005.c +++ b/drivers/input/touchscreen/tsc2005.c | |||
@@ -650,7 +650,8 @@ static int __devinit tsc2005_probe(struct spi_device *spi) | |||
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; |