.. | .. |
---|
219 | 219 | struct i2c_client *client; |
---|
220 | 220 | struct input_dev *input; |
---|
221 | 221 | struct delayed_work dwork; |
---|
222 | | - spinlock_t lock; |
---|
223 | 222 | int no_data_count; |
---|
224 | 223 | int no_decel_param; |
---|
225 | 224 | int reduce_report_param; |
---|
.. | .. |
---|
369 | 368 | return xy_delta || gesture; |
---|
370 | 369 | } |
---|
371 | 370 | |
---|
372 | | -static void synaptics_i2c_reschedule_work(struct synaptics_i2c *touch, |
---|
373 | | - unsigned long delay) |
---|
374 | | -{ |
---|
375 | | - unsigned long flags; |
---|
376 | | - |
---|
377 | | - spin_lock_irqsave(&touch->lock, flags); |
---|
378 | | - |
---|
379 | | - mod_delayed_work(system_wq, &touch->dwork, delay); |
---|
380 | | - |
---|
381 | | - spin_unlock_irqrestore(&touch->lock, flags); |
---|
382 | | -} |
---|
383 | | - |
---|
384 | 371 | static irqreturn_t synaptics_i2c_irq(int irq, void *dev_id) |
---|
385 | 372 | { |
---|
386 | 373 | struct synaptics_i2c *touch = dev_id; |
---|
387 | 374 | |
---|
388 | | - synaptics_i2c_reschedule_work(touch, 0); |
---|
| 375 | + mod_delayed_work(system_wq, &touch->dwork, 0); |
---|
389 | 376 | |
---|
390 | 377 | return IRQ_HANDLED; |
---|
391 | 378 | } |
---|
.. | .. |
---|
461 | 448 | * We poll the device once in THREAD_IRQ_SLEEP_SECS and |
---|
462 | 449 | * if error is detected, we try to reset and reconfigure the touchpad. |
---|
463 | 450 | */ |
---|
464 | | - synaptics_i2c_reschedule_work(touch, delay); |
---|
| 451 | + mod_delayed_work(system_wq, &touch->dwork, delay); |
---|
465 | 452 | } |
---|
466 | 453 | |
---|
467 | 454 | static int synaptics_i2c_open(struct input_dev *input) |
---|
.. | .. |
---|
474 | 461 | return ret; |
---|
475 | 462 | |
---|
476 | 463 | if (polling_req) |
---|
477 | | - synaptics_i2c_reschedule_work(touch, |
---|
| 464 | + mod_delayed_work(system_wq, &touch->dwork, |
---|
478 | 465 | msecs_to_jiffies(NO_DATA_SLEEP_MSECS)); |
---|
479 | 466 | |
---|
480 | 467 | return 0; |
---|
.. | .. |
---|
530 | 517 | touch->scan_rate_param = scan_rate; |
---|
531 | 518 | set_scan_rate(touch, scan_rate); |
---|
532 | 519 | INIT_DELAYED_WORK(&touch->dwork, synaptics_i2c_work_handler); |
---|
533 | | - spin_lock_init(&touch->lock); |
---|
534 | 520 | |
---|
535 | 521 | return touch; |
---|
536 | 522 | } |
---|
.. | .. |
---|
637 | 623 | if (ret) |
---|
638 | 624 | return ret; |
---|
639 | 625 | |
---|
640 | | - synaptics_i2c_reschedule_work(touch, |
---|
| 626 | + mod_delayed_work(system_wq, &touch->dwork, |
---|
641 | 627 | msecs_to_jiffies(NO_DATA_SLEEP_MSECS)); |
---|
642 | 628 | |
---|
643 | 629 | return 0; |
---|