Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 401998fa authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

V4L/DVB (4065): Several improvements at videodev.c



Videodev now is capable of better handling V4L2 api, by
processing V4L2 ioctls and using callbacks to the driver.
The drivers should be migrated to the newer way and the older
one will be obsoleted soon.

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 7565ab08
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
#include <linux/videodev2.h>
#include <linux/kdev_t.h>

#include <media/v4l2-common.h>
#include <media/tuner.h>
#include <media/tveeprom.h>
#include <media/video-buf.h>
+1 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@

#include <asm/io.h>

#include <media/v4l2-common.h>
#include <media/tuner.h>
#include <media/ir-common.h>
#include <media/ir-kbd-i2c.h>
+13 −0
Original line number Diff line number Diff line
@@ -59,6 +59,7 @@
#include <asm/io.h>
#include <asm/div64.h>
#include <linux/video_decoder.h>
#define __OLD_VIDIOC_ /* To allow fixing old calls*/
#include <media/v4l2-common.h>

#ifdef CONFIG_KMOD
@@ -424,7 +425,9 @@ void v4l_printk_ioctl_arg(char *s,unsigned int cmd, void *arg)
	case TUNER_SET_TYPE_ADDR:
	case TUNER_SET_STANDBY:
	case TDA9887_SET_CONFIG:
#ifdef __OLD_VIDIOC_
	case VIDIOC_OVERLAY_OLD:
#endif
	case VIDIOC_STREAMOFF:
	case VIDIOC_G_OUTPUT:
	case VIDIOC_S_OUTPUT:
@@ -440,7 +443,9 @@ void v4l_printk_ioctl_arg(char *s,unsigned int cmd, void *arg)
	case VIDIOC_G_AUDIO:
	case VIDIOC_S_AUDIO:
	case VIDIOC_ENUMAUDIO:
#ifdef __OLD_VIDIOC_
	case VIDIOC_G_AUDIO_OLD:
#endif
	{
		struct v4l2_audio *p=arg;

@@ -451,7 +456,9 @@ void v4l_printk_ioctl_arg(char *s,unsigned int cmd, void *arg)
	case VIDIOC_G_AUDOUT:
	case VIDIOC_S_AUDOUT:
	case VIDIOC_ENUMAUDOUT:
#ifdef __OLD_VIDIOC_
	case VIDIOC_G_AUDOUT_OLD:
#endif
	{
		struct v4l2_audioout *p=arg;
		printk ("%s: index=%d, name=%s, capability=%d, mode=%d\n", s,
@@ -496,7 +503,9 @@ void v4l_printk_ioctl_arg(char *s,unsigned int cmd, void *arg)
	}
	case VIDIOC_G_CTRL:
	case VIDIOC_S_CTRL:
#ifdef __OLD_VIDIOC_
	case VIDIOC_S_CTRL_OLD:
#endif
	{
		struct v4l2_control *p=arg;
		printk ("%s: id=%d, value=%d\n", s, p->id, p->value);
@@ -511,7 +520,9 @@ void v4l_printk_ioctl_arg(char *s,unsigned int cmd, void *arg)
		break;
	}
	case VIDIOC_CROPCAP:
#ifdef __OLD_VIDIOC_
	case VIDIOC_CROPCAP_OLD:
#endif
	{
		struct v4l2_cropcap *p=arg;
		/*FIXME: Should also show rect structs */
@@ -703,7 +714,9 @@ void v4l_printk_ioctl_arg(char *s,unsigned int cmd, void *arg)
	}
	case VIDIOC_G_PARM:
	case VIDIOC_S_PARM:
#ifdef __OLD_VIDIOC_
	case VIDIOC_S_PARM_OLD:
#endif
	{
		struct v4l2_streamparm *p=arg;
		printk ("%s: type=%d\n", s, p->type);
+1156 −16

File changed.

Preview size limit exceeded, changes collapsed.

+21 −37
Original line number Diff line number Diff line
/*
 *	Video for Linux version 1 - OBSOLETE
 *
 *	Header file for v4l1 drivers and applications, for
 *	Linux kernels 2.2.x or 2.4.x.
 *
 *	Provides header for legacy drivers and applications
 *
 *	See http://linuxtv.org for more info
 *
 */
#ifndef __LINUX_VIDEODEV_H
#define __LINUX_VIDEODEV_H

#include <linux/types.h>
#include <linux/poll.h>
#include <linux/fs.h>
#include <linux/device.h>
#include <linux/mutex.h>
#include <linux/compiler.h> /* need __user */

#define HAVE_V4L1 1

#include <linux/videodev2.h>

#ifdef __KERNEL__

#include <linux/mm.h>

extern struct video_device* video_devdata(struct file*);

#define to_video_device(cd) container_of(cd, struct video_device, class_dev)
static inline void
video_device_create_file(struct video_device *vfd,
			 struct class_device_attribute *attr)
{
	class_device_create_file(&vfd->class_dev, attr);
}
static inline void
video_device_remove_file(struct video_device *vfd,
			 struct class_device_attribute *attr)
{
	class_device_remove_file(&vfd->class_dev, attr);
}

#if OBSOLETE_OWNER /* to be removed in 2.6.15 */
/* helper functions to access driver private data. */
static inline void *video_get_drvdata(struct video_device *dev)
{
	return dev->priv;
}

static inline void video_set_drvdata(struct video_device *dev, void *data)
{
	dev->priv = data;
}
#endif

extern int video_exclusive_open(struct inode *inode, struct file *file);
extern int video_exclusive_release(struct inode *inode, struct file *file);
#endif /* __KERNEL__ */

struct video_capability
{
	char name[32];
@@ -363,6 +342,11 @@ struct video_code
#define VID_HARDWARE_SAA7114H   37
#define VID_HARDWARE_SN9C102	38
#define VID_HARDWARE_ARV	39

#ifdef __KERNEL__
#include <media/v4l2-dev.h>
#endif /* __KERNEL__ */

#endif /* __LINUX_VIDEODEV_H */

/*
Loading