@@ -1026,6 +1026,7 @@ long v4l2_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg)
case VIDIOC_ENUM_DV_TIMINGS:
case VIDIOC_QUERY_DV_TIMINGS:
case VIDIOC_DV_TIMINGS_CAP:
+ case VIDIOC_ENUM_FREQ_BANDS:
ret = do_video_ioctl(file, cmd, arg);
break;
@@ -663,6 +663,7 @@ static void determine_valid_ioctls(struct video_device *vdev)
SET_VALID_IOCTL(ops, VIDIOC_S_TUNER, vidioc_s_tuner);
SET_VALID_IOCTL(ops, VIDIOC_G_FREQUENCY, vidioc_g_frequency);
SET_VALID_IOCTL(ops, VIDIOC_S_FREQUENCY, vidioc_s_frequency);
+ SET_VALID_IOCTL(ops, VIDIOC_ENUM_FREQ_BANDS, vidioc_enum_freq_bands);
SET_VALID_IOCTL(ops, VIDIOC_G_SLICED_VBI_CAP, vidioc_g_sliced_vbi_cap);
SET_VALID_IOCTL(ops, VIDIOC_LOG_STATUS, vidioc_log_status);
#ifdef CONFIG_VIDEO_ADV_DEBUG
@@ -284,6 +284,7 @@ static struct v4l2_ioctl_info v4l2_ioctls[] = {
IOCTL_INFO(VIDIOC_ENUM_DV_TIMINGS, 0),
IOCTL_INFO(VIDIOC_QUERY_DV_TIMINGS, 0),
IOCTL_INFO(VIDIOC_DV_TIMINGS_CAP, 0),
+ IOCTL_INFO(VIDIOC_ENUM_FREQ_BANDS, 0),
};
#define V4L2_IOCTLS ARRAY_SIZE(v4l2_ioctls)
@@ -1765,6 +1766,26 @@ static long __video_do_ioctl(struct file *file,
ret = ops->vidioc_s_frequency(file, fh, p);
break;
}
+ case VIDIOC_ENUM_FREQ_BANDS:
+ {
+ struct v4l2_frequency_band *p = arg;
+ enum v4l2_tuner_type type;
+
+ type = (vfd->vfl_type == VFL_TYPE_RADIO) ?
+ V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV;
+ if (p->type != type)
+ ret = -EINVAL;
+ else
+ ret = ops->vidioc_enum_freq_bands(file, fh, p);
+ if (!ret)
+ dbgarg(cmd, "tuner=%d, index=%d, name=%s, "
+ "capability=0x%x, rangelow=%d, "
+ "rangehigh=%d\n",
+ p->tuner, p->index, p->name,
+ p->capability, p->rangelow,
+ p->rangehigh);
+ break;
+ }
case VIDIOC_G_SLICED_VBI_CAP:
{
struct v4l2_sliced_vbi_cap *p = arg;
@@ -230,6 +230,8 @@ struct v4l2_ioctl_ops {
struct v4l2_frequency *a);
int (*vidioc_s_frequency) (struct file *file, void *fh,
struct v4l2_frequency *a);
+ int (*vidioc_enum_freq_bands) (struct file *file, void *fh,
+ struct v4l2_frequency_band *band);
/* Sliced VBI cap */
int (*vidioc_g_sliced_vbi_cap) (struct file *file, void *fh,