diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-02-04 11:15:21 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-03-21 20:32:01 -0300 |
commit | e2f63d9ba51efe8930bf1c952c66b971047d355d (patch) | |
tree | ca750d4fdf5b097a45a09e692dc45c80eced81a4 /drivers/media/video/tuner-core.c | |
parent | cbde689823776d187ba1b307a171625dbc02dd4f (diff) | |
download | linux-stable-e2f63d9ba51efe8930bf1c952c66b971047d355d.tar.gz linux-stable-e2f63d9ba51efe8930bf1c952c66b971047d355d.tar.bz2 linux-stable-e2f63d9ba51efe8930bf1c952c66b971047d355d.zip |
[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.c | 14 |
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) static int tuner_suspend(struct i2c_client *c, pm_message_t state) { struct tuner *t = to_tuner(i2c_get_clientdata(c)); + struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; tuner_dbg("suspend\n"); - /* FIXME: power down ??? */ + + if (!t->standby && analog_ops->standby) + analog_ops->standby(&t->fe); + return 0; } @@ -1132,10 +1136,10 @@ static int tuner_resume(struct i2c_client *c) struct tuner *t = to_tuner(i2c_get_clientdata(c)); tuner_dbg("resume\n"); - if (V4L2_TUNER_RADIO == t->mode) - set_freq(c, t->radio_freq); - else - set_freq(c, t->tv_freq); + + if (!t->standby) + set_mode_freq(c, t, t->type, 0); + return 0; } |