aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Lorenz <tobias.lorenz@gmx.net>2008-05-26 17:40:46 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-20 06:07:12 -0400
commit1d0ba5f3784612fe6e91a12e0dec37c797d4f07c (patch)
tree8e05b0fc73664285504c4319892c842a78d6b63d
parentf90fe7a3f7fcba0abd89ce0978628ef1d86ecbf9 (diff)
V4L/DVB (7942): Hardware frequency seek ioctl interface
Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r--drivers/media/video/compat_ioctl32.c1
-rw-r--r--drivers/media/video/videodev.c12
-rw-r--r--include/linux/videodev2.h10
-rw-r--r--include/media/v4l2-dev.h2
4 files changed, 25 insertions, 0 deletions
diff --git a/drivers/media/video/compat_ioctl32.c b/drivers/media/video/compat_ioctl32.c
index cefd1381e8de..54de0cd482e9 100644
--- a/drivers/media/video/compat_ioctl32.c
+++ b/drivers/media/video/compat_ioctl32.c
@@ -884,6 +884,7 @@ long v4l_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg)
884 case VIDIOC_G_INPUT32: 884 case VIDIOC_G_INPUT32:
885 case VIDIOC_S_INPUT32: 885 case VIDIOC_S_INPUT32:
886 case VIDIOC_TRY_FMT32: 886 case VIDIOC_TRY_FMT32:
887 case VIDIOC_S_HW_FREQ_SEEK:
887 ret = do_video_ioctl(file, cmd, arg); 888 ret = do_video_ioctl(file, cmd, arg);
888 break; 889 break;
889 890
diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c
index 7649860a388d..52c56678ee69 100644
--- a/drivers/media/video/videodev.c
+++ b/drivers/media/video/videodev.c
@@ -278,6 +278,7 @@ static const char *v4l2_ioctls[] = {
278 [_IOC_NR(VIDIOC_DBG_G_REGISTER)] = "VIDIOC_DBG_G_REGISTER", 278 [_IOC_NR(VIDIOC_DBG_G_REGISTER)] = "VIDIOC_DBG_G_REGISTER",
279 279
280 [_IOC_NR(VIDIOC_G_CHIP_IDENT)] = "VIDIOC_G_CHIP_IDENT", 280 [_IOC_NR(VIDIOC_G_CHIP_IDENT)] = "VIDIOC_G_CHIP_IDENT",
281 [_IOC_NR(VIDIOC_S_HW_FREQ_SEEK)] = "VIDIOC_S_HW_FREQ_SEEK",
281#endif 282#endif
282}; 283};
283#define V4L2_IOCTLS ARRAY_SIZE(v4l2_ioctls) 284#define V4L2_IOCTLS ARRAY_SIZE(v4l2_ioctls)
@@ -1763,6 +1764,17 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
1763 ret = vfd->vidioc_default(file, fh, cmd, arg); 1764 ret = vfd->vidioc_default(file, fh, cmd, arg);
1764 break; 1765 break;
1765 } 1766 }
1767 case VIDIOC_S_HW_FREQ_SEEK:
1768 {
1769 struct v4l2_hw_freq_seek *p = arg;
1770 if (!vfd->vidioc_s_hw_freq_seek)
1771 break;
1772 dbgarg(cmd,
1773 "tuner=%d, type=%d, seek_upward=%d, wrap_around=%d\n",
1774 p->tuner, p->type, p->seek_upward, p->wrap_around);
1775 ret = vfd->vidioc_s_hw_freq_seek(file, fh, p);
1776 break;
1777 }
1766 } /* switch */ 1778 } /* switch */
1767 1779
1768 if (vfd->debug & V4L2_DEBUG_IOCTL_ARG) { 1780 if (vfd->debug & V4L2_DEBUG_IOCTL_ARG) {
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 4a535ea1e123..9385c823a978 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -246,6 +246,7 @@ struct v4l2_capability
246#define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080 /* Is a sliced VBI output device */ 246#define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080 /* Is a sliced VBI output device */
247#define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */ 247#define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */
248#define V4L2_CAP_VIDEO_OUTPUT_OVERLAY 0x00000200 /* Can do video output overlay */ 248#define V4L2_CAP_VIDEO_OUTPUT_OVERLAY 0x00000200 /* Can do video output overlay */
249#define V4L2_CAP_HW_FREQ_SEEK 0x00000400 /* Can do hardware frequency seek */
249 250
250#define V4L2_CAP_TUNER 0x00010000 /* has a tuner */ 251#define V4L2_CAP_TUNER 0x00010000 /* has a tuner */
251#define V4L2_CAP_AUDIO 0x00020000 /* has audio support */ 252#define V4L2_CAP_AUDIO 0x00020000 /* has audio support */
@@ -1156,6 +1157,14 @@ struct v4l2_frequency
1156 __u32 reserved[8]; 1157 __u32 reserved[8];
1157}; 1158};
1158 1159
1160struct v4l2_hw_freq_seek {
1161 __u32 tuner;
1162 enum v4l2_tuner_type type;
1163 __u32 seek_upward;
1164 __u32 wrap_around;
1165 __u32 reserved[8];
1166};
1167
1159/* 1168/*
1160 * A U D I O 1169 * A U D I O
1161 */ 1170 */
@@ -1441,6 +1450,7 @@ struct v4l2_chip_ident {
1441 1450
1442#define VIDIOC_G_CHIP_IDENT _IOWR ('V', 81, struct v4l2_chip_ident) 1451#define VIDIOC_G_CHIP_IDENT _IOWR ('V', 81, struct v4l2_chip_ident)
1443#endif 1452#endif
1453#define VIDIOC_S_HW_FREQ_SEEK _IOW ('V', 82, struct v4l2_hw_freq_seek)
1444 1454
1445#ifdef __OLD_VIDIOC_ 1455#ifdef __OLD_VIDIOC_
1446/* for compatibility, will go away some day */ 1456/* for compatibility, will go away some day */
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h
index 859f7a6f6f67..53b651ac685a 100644
--- a/include/media/v4l2-dev.h
+++ b/include/media/v4l2-dev.h
@@ -306,6 +306,8 @@ struct video_device
306 /* Log status ioctl */ 306 /* Log status ioctl */
307 int (*vidioc_log_status) (struct file *file, void *fh); 307 int (*vidioc_log_status) (struct file *file, void *fh);
308 308
309 int (*vidioc_s_hw_freq_seek) (struct file *file, void *fh,
310 struct v4l2_hw_freq_seek *a);
309 311
310 /* Debugging ioctls */ 312 /* Debugging ioctls */
311#ifdef CONFIG_VIDEO_ADV_DEBUG 313#ifdef CONFIG_VIDEO_ADV_DEBUG