From: Jiri Benc Date: Sat, 7 May 2005 04:30:42 +0000 (-0700) Subject: [PATCH] video/tuner: add VIDEO_G_FREQUENCY and freq range to VIDIOC_G_TUNER X-Git-Tag: v2.6.12-rc4~13 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c184ca3681ee9ae0bb63cb591e1e16f42536415c;p=linux-2.6 [PATCH] video/tuner: add VIDEO_G_FREQUENCY and freq range to VIDIOC_G_TUNER This patch adds a VIDIOC_G_FREQUENCY command to tuner-core.c and sets lowest and highest tunable frequencies in v4l2_tuner structure returned by VIDIOC_G_TUNER command. Signed-off-by: Jiri Benc Cc: Gerd Knorr Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index c7d0c9f093..6212388edb 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c @@ -360,6 +360,15 @@ tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) set_freq(client,f->frequency); break; } + case VIDIOC_G_FREQUENCY: + { + struct v4l2_frequency *f = arg; + + SWITCH_V4L2; + f->type = t->mode; + f->frequency = t->freq; + break; + } case VIDIOC_G_TUNER: { struct v4l2_tuner *tuner = arg; @@ -367,6 +376,8 @@ tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) SWITCH_V4L2; if (V4L2_TUNER_RADIO == t->mode && t->has_signal) tuner->signal = t->has_signal(client); + tuner->rangelow = tv_range[0] * 16; + tuner->rangehigh = tv_range[1] * 16; break; } default: