summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2011-06-25 10:24:49 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-07-07 15:07:01 -0300
commitd16625e788b8871163ad991851ffba5f64c06d43 (patch)
treecd74a65b95552649fe960e5a6aeefae8a7a98f9f
parenta6cf90a91551c767bed78a4418c26f41aed60cde (diff)
downloadlinux-d16625e788b8871163ad991851ffba5f64c06d43.tar.gz
linux-d16625e788b8871163ad991851ffba5f64c06d43.tar.bz2
linux-d16625e788b8871163ad991851ffba5f64c06d43.zip
[media] tuner-core: power up tuner when called with s_power(1)
Drivers must be able to rely on s_power to power up subdevices. Note that at this moment no driver attempts to power up tuners. This probably isn't surprising since s_power(1) was never implemented in tuner-core.c until now. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/tuner-core.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index 1e7505eb32e9..39af999112f9 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -1039,16 +1039,20 @@ static int tuner_s_radio(struct v4l2_subdev *sd)
/**
* tuner_s_power - controls the power state of the tuner
* @sd: pointer to struct v4l2_subdev
- * @on: a zero value puts the tuner to sleep
+ * @on: a zero value puts the tuner to sleep, non-zero wakes it up
*/
static int tuner_s_power(struct v4l2_subdev *sd, int on)
{
struct tuner *t = to_tuner(sd);
struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops;
- /* FIXME: Why this function don't wake the tuner if on != 0 ? */
- if (on)
+ if (on) {
+ if (t->standby && set_mode(t, t->mode) == 0) {
+ tuner_dbg("Waking up tuner\n");
+ set_freq(t, 0);
+ }
return 0;
+ }
tuner_dbg("Putting tuner to sleep\n");
t->standby = true;