aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/input/mouse/synaptics_i2c.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/input/mouse/synaptics_i2c.c b/drivers/input/mouse/synaptics_i2c.c
index 0ae62f0bcb32..f6aa26d305ed 100644
--- a/drivers/input/mouse/synaptics_i2c.c
+++ b/drivers/input/mouse/synaptics_i2c.c
@@ -18,6 +18,7 @@
18#include <linux/delay.h> 18#include <linux/delay.h>
19#include <linux/workqueue.h> 19#include <linux/workqueue.h>
20#include <linux/slab.h> 20#include <linux/slab.h>
21#include <linux/pm.h>
21 22
22#define DRIVER_NAME "synaptics_i2c" 23#define DRIVER_NAME "synaptics_i2c"
23/* maximum product id is 15 characters */ 24/* maximum product id is 15 characters */
@@ -619,8 +620,9 @@ static int __devexit synaptics_i2c_remove(struct i2c_client *client)
619} 620}
620 621
621#ifdef CONFIG_PM 622#ifdef CONFIG_PM
622static int synaptics_i2c_suspend(struct i2c_client *client, pm_message_t mesg) 623static int synaptics_i2c_suspend(struct device *dev)
623{ 624{
625 struct i2c_client *client = to_i2c_client(dev);
624 struct synaptics_i2c *touch = i2c_get_clientdata(client); 626 struct synaptics_i2c *touch = i2c_get_clientdata(client);
625 627
626 cancel_delayed_work_sync(&touch->dwork); 628 cancel_delayed_work_sync(&touch->dwork);
@@ -631,9 +633,10 @@ static int synaptics_i2c_suspend(struct i2c_client *client, pm_message_t mesg)
631 return 0; 633 return 0;
632} 634}
633 635
634static int synaptics_i2c_resume(struct i2c_client *client) 636static int synaptics_i2c_resume(struct device *dev)
635{ 637{
636 int ret; 638 int ret;
639 struct i2c_client *client = to_i2c_client(dev);
637 struct synaptics_i2c *touch = i2c_get_clientdata(client); 640 struct synaptics_i2c *touch = i2c_get_clientdata(client);
638 641
639 ret = synaptics_i2c_reset_config(client); 642 ret = synaptics_i2c_reset_config(client);
@@ -645,11 +648,11 @@ static int synaptics_i2c_resume(struct i2c_client *client)
645 648
646 return 0; 649 return 0;
647} 650}
648#else
649#define synaptics_i2c_suspend NULL
650#define synaptics_i2c_resume NULL
651#endif 651#endif
652 652
653static SIMPLE_DEV_PM_OPS(synaptics_i2c_pm, synaptics_i2c_suspend,
654 synaptics_i2c_resume);
655
653static const struct i2c_device_id synaptics_i2c_id_table[] = { 656static const struct i2c_device_id synaptics_i2c_id_table[] = {
654 { "synaptics_i2c", 0 }, 657 { "synaptics_i2c", 0 },
655 { }, 658 { },
@@ -660,13 +663,12 @@ static struct i2c_driver synaptics_i2c_driver = {
660 .driver = { 663 .driver = {
661 .name = DRIVER_NAME, 664 .name = DRIVER_NAME,
662 .owner = THIS_MODULE, 665 .owner = THIS_MODULE,
666 .pm = &synaptics_i2c_pm,
663 }, 667 },
664 668
665 .probe = synaptics_i2c_probe, 669 .probe = synaptics_i2c_probe,
666 .remove = __devexit_p(synaptics_i2c_remove), 670 .remove = __devexit_p(synaptics_i2c_remove),
667 671
668 .suspend = synaptics_i2c_suspend,
669 .resume = synaptics_i2c_resume,
670 .id_table = synaptics_i2c_id_table, 672 .id_table = synaptics_i2c_id_table,
671}; 673};
672 674