Skip to content

Commit

Permalink
[media] tuner-core: power up tuner when called with s_power(1)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Jul 7, 2011
1 parent a6cf90a commit d16625e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions drivers/media/video/tuner-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d16625e

Please sign in to comment.