aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/tuner-core.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2011-02-04 09:15:21 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-03-21 19:32:01 -0400
commite2f63d9ba51efe8930bf1c952c66b971047d355d (patch)
treeca750d4fdf5b097a45a09e692dc45c80eced81a4 /drivers/media/video/tuner-core.c
parentcbde689823776d187ba1b307a171625dbc02dd4f (diff)
[media] tuner-core: do the right thing for suspend/resume
Power down tuners at suspend. At resume, if the tuner is in standby, calls set_mode, that will turn it on and set the latest frequencies. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/tuner-core.c')
-rw-r--r--drivers/media/video/tuner-core.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index e6855a46f433..e6b63e9c0b34 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -1121,9 +1121,13 @@ static int tuner_log_status(struct v4l2_subdev *sd)
1121static int tuner_suspend(struct i2c_client *c, pm_message_t state) 1121static int tuner_suspend(struct i2c_client *c, pm_message_t state)
1122{ 1122{
1123 struct tuner *t = to_tuner(i2c_get_clientdata(c)); 1123 struct tuner *t = to_tuner(i2c_get_clientdata(c));
1124 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops;
1124 1125
1125 tuner_dbg("suspend\n"); 1126 tuner_dbg("suspend\n");
1126 /* FIXME: power down ??? */ 1127
1128 if (!t->standby && analog_ops->standby)
1129 analog_ops->standby(&t->fe);
1130
1127 return 0; 1131 return 0;
1128} 1132}
1129 1133
@@ -1132,10 +1136,10 @@ static int tuner_resume(struct i2c_client *c)
1132 struct tuner *t = to_tuner(i2c_get_clientdata(c)); 1136 struct tuner *t = to_tuner(i2c_get_clientdata(c));
1133 1137
1134 tuner_dbg("resume\n"); 1138 tuner_dbg("resume\n");
1135 if (V4L2_TUNER_RADIO == t->mode) 1139
1136 set_freq(c, t->radio_freq); 1140 if (!t->standby)
1137 else 1141 set_mode_freq(c, t, t->type, 0);
1138 set_freq(c, t->tv_freq); 1142
1139 return 0; 1143 return 0;
1140} 1144}
1141 1145