aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-05-03 05:54:51 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-05-15 06:38:43 -0400
commit5cbd28df305ab29b7e43bd8e901e7824f7ed9417 (patch)
tree05c23fd60b58bd46fa20d97f3fdd9344f9d1caf8 /drivers/media/video
parentb18900080387808b7fb5b5374192e305fb216257 (diff)
[media] Convert I2C drivers to dev_pm_ops
The legacy I2C PM functions have been deprecated and warning on boot for over a year, convert the drivers still using them to dev_pm_ops. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/msp3400-driver.c15
-rw-r--r--drivers/media/video/tuner-core.c15
2 files changed, 22 insertions, 8 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
600static int msp_suspend(struct i2c_client *client, pm_message_t state) 600#ifdef CONFIG_PM_SLEEP
601static 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
607static int msp_resume(struct i2c_client *client) 609static 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
870static const struct dev_pm_ops msp3400_pm_ops = {
871 SET_SYSTEM_SLEEP_PM_OPS(msp_suspend, msp_resume)
872};
873
866static const struct i2c_device_id msp_id[] = { 874static 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
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index a5c6397ad591..3e050e12153b 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -1241,8 +1241,10 @@ static int tuner_log_status(struct v4l2_subdev *sd)
1241 return 0; 1241 return 0;
1242} 1242}
1243 1243
1244static int tuner_suspend(struct i2c_client *c, pm_message_t state) 1244#ifdef CONFIG_PM_SLEEP
1245static int tuner_suspend(struct device *dev)
1245{ 1246{
1247 struct i2c_client *c = to_i2c_client(dev);
1246 struct tuner *t = to_tuner(i2c_get_clientdata(c)); 1248 struct tuner *t = to_tuner(i2c_get_clientdata(c));
1247 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; 1249 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops;
1248 1250
@@ -1254,8 +1256,9 @@ static int tuner_suspend(struct i2c_client *c, pm_message_t state)
1254 return 0; 1256 return 0;
1255} 1257}
1256 1258
1257static int tuner_resume(struct i2c_client *c) 1259static int tuner_resume(struct device *dev)
1258{ 1260{
1261 struct i2c_client *c = to_i2c_client(dev);
1259 struct tuner *t = to_tuner(i2c_get_clientdata(c)); 1262 struct tuner *t = to_tuner(i2c_get_clientdata(c));
1260 1263
1261 tuner_dbg("resume\n"); 1264 tuner_dbg("resume\n");
@@ -1266,6 +1269,7 @@ static int tuner_resume(struct i2c_client *c)
1266 1269
1267 return 0; 1270 return 0;
1268} 1271}
1272#endif
1269 1273
1270static int tuner_command(struct i2c_client *client, unsigned cmd, void *arg) 1274static int tuner_command(struct i2c_client *client, unsigned cmd, void *arg)
1271{ 1275{
@@ -1310,6 +1314,10 @@ static const struct v4l2_subdev_ops tuner_ops = {
1310 * I2C structs and module init functions 1314 * I2C structs and module init functions
1311 */ 1315 */
1312 1316
1317static const struct dev_pm_ops tuner_pm_ops = {
1318 SET_SYSTEM_SLEEP_PM_OPS(tuner_suspend, tuner_resume)
1319};
1320
1313static const struct i2c_device_id tuner_id[] = { 1321static const struct i2c_device_id tuner_id[] = {
1314 { "tuner", }, /* autodetect */ 1322 { "tuner", }, /* autodetect */
1315 { } 1323 { }
@@ -1320,12 +1328,11 @@ static struct i2c_driver tuner_driver = {
1320 .driver = { 1328 .driver = {
1321 .owner = THIS_MODULE, 1329 .owner = THIS_MODULE,
1322 .name = "tuner", 1330 .name = "tuner",
1331 .pm = &tuner_pm_ops,
1323 }, 1332 },
1324 .probe = tuner_probe, 1333 .probe = tuner_probe,
1325 .remove = tuner_remove, 1334 .remove = tuner_remove,
1326 .command = tuner_command, 1335 .command = tuner_command,
1327 .suspend = tuner_suspend,
1328 .resume = tuner_resume,
1329 .id_table = tuner_id, 1336 .id_table = tuner_id,
1330}; 1337};
1331 1338