diff options
Diffstat (limited to 'drivers/media/video/msp3400-driver.c')
-rw-r--r-- | drivers/media/video/msp3400-driver.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/media/video/msp3400-driver.c b/drivers/media/video/msp3400-driver.c index 82ce50721de3..aeb22be7dcbd 100644 --- a/drivers/media/video/msp3400-driver.c +++ b/drivers/media/video/msp3400-driver.c | |||
@@ -597,19 +597,23 @@ static int msp_log_status(struct v4l2_subdev *sd) | |||
597 | return 0; | 597 | return 0; |
598 | } | 598 | } |
599 | 599 | ||
600 | static int msp_suspend(struct i2c_client *client, pm_message_t state) | 600 | #ifdef CONFIG_PM_SLEEP |
601 | static int msp_suspend(struct device *dev) | ||
601 | { | 602 | { |
603 | struct i2c_client *client = to_i2c_client(dev); | ||
602 | v4l_dbg(1, msp_debug, client, "suspend\n"); | 604 | v4l_dbg(1, msp_debug, client, "suspend\n"); |
603 | msp_reset(client); | 605 | msp_reset(client); |
604 | return 0; | 606 | return 0; |
605 | } | 607 | } |
606 | 608 | ||
607 | static int msp_resume(struct i2c_client *client) | 609 | static int msp_resume(struct device *dev) |
608 | { | 610 | { |
611 | struct i2c_client *client = to_i2c_client(dev); | ||
609 | v4l_dbg(1, msp_debug, client, "resume\n"); | 612 | v4l_dbg(1, msp_debug, client, "resume\n"); |
610 | msp_wake_thread(client); | 613 | msp_wake_thread(client); |
611 | return 0; | 614 | return 0; |
612 | } | 615 | } |
616 | #endif | ||
613 | 617 | ||
614 | /* ----------------------------------------------------------------------- */ | 618 | /* ----------------------------------------------------------------------- */ |
615 | 619 | ||
@@ -863,6 +867,10 @@ static int msp_remove(struct i2c_client *client) | |||
863 | 867 | ||
864 | /* ----------------------------------------------------------------------- */ | 868 | /* ----------------------------------------------------------------------- */ |
865 | 869 | ||
870 | static const struct dev_pm_ops msp3400_pm_ops = { | ||
871 | SET_SYSTEM_SLEEP_PM_OPS(msp_suspend, msp_resume) | ||
872 | }; | ||
873 | |||
866 | static const struct i2c_device_id msp_id[] = { | 874 | static const struct i2c_device_id msp_id[] = { |
867 | { "msp3400", 0 }, | 875 | { "msp3400", 0 }, |
868 | { } | 876 | { } |
@@ -873,11 +881,10 @@ static struct i2c_driver msp_driver = { | |||
873 | .driver = { | 881 | .driver = { |
874 | .owner = THIS_MODULE, | 882 | .owner = THIS_MODULE, |
875 | .name = "msp3400", | 883 | .name = "msp3400", |
884 | .pm = &msp3400_pm_ops, | ||
876 | }, | 885 | }, |
877 | .probe = msp_probe, | 886 | .probe = msp_probe, |
878 | .remove = msp_remove, | 887 | .remove = msp_remove, |
879 | .suspend = msp_suspend, | ||
880 | .resume = msp_resume, | ||
881 | .id_table = msp_id, | 888 | .id_table = msp_id, |
882 | }; | 889 | }; |
883 | 890 | ||