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

Commit f60a0a79 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (34 commits)
  V4L/DVB (10173): Missing v4l2_prio_close in radio_release
  V4L/DVB (10172): add DVB_DEVICE_TYPE= to uevent
  V4L/DVB (10171): Use usb_set_intfdata
  V4L/DVB (10170): tuner-simple: prevent possible OOPS caused by divide by zero error
  V4L/DVB (10168): sms1xxx: fix inverted gpio for lna control on tiger r2
  V4L/DVB (10167): sms1xxx: add support for inverted gpio
  V4L/DVB (10166): dvb frontend: stop using non-C99 compliant comments
  V4L/DVB (10165): Add FE_CAN_2G_MODULATION flag to frontends that support DVB-S2
  V4L/DVB (10164): Add missing S2 caps flag to S2API
  V4L/DVB (10163): em28xx: allocate adev together with struct em28xx dev
  V4L/DVB (10162): tuner-simple: Fix tuner type set message
  V4L/DVB (10161): saa7134: fix autodetection for AVer TV GO 007 FM Plus
  V4L/DVB (10160): em28xx: update chip id for em2710
  V4L/DVB (10157): Add USB ID for the Sil4701 radio from DealExtreme
  V4L/DVB (10156): saa7134: Add support for Avermedia AVer TV GO 007 FM Plus
  V4L/DVB (10155): Add TEA5764 radio driver
  V4L/DVB (10154): saa7134: fix a merge conflict on Behold H6 board
  V4L/DVB (10153): Add the Beholder H6 card to DVB-T part of sources.
  V4L/DVB (10152): Change configuration of the Beholder H6 card
  V4L/DVB (10151): Fix I2C bridge error in zl10353
  ...
parents 2f983570 b15dd79e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -152,3 +152,4 @@
151 -> ADS Tech Instant HDTV                    [1421:0380]
152 -> Asus Tiger Rev:1.00                      [1043:4857]
153 -> Kworld Plus TV Analog Lite PCI           [17de:7128]
154 -> Avermedia AVerTV GO 007 FM Plus          [1461:f31d]
+1 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ chips are known to work:
- 10c4:818a: Silicon Labs USB FM Radio Reference Design
- 06e1:a155: ADS/Tech FM Radio Receiver (formerly Instant FM Music) (RDX-155-EF)
- 1b80:d700: KWorld USB FM Radio SnapMusic Mobile 700 (FM700)
- 10c5:819a: DealExtreme USB Radio


Software
+10 −9
Original line number Diff line number Diff line
@@ -184,7 +184,7 @@ may be NULL if the subdev driver does not support anything from that category.
It looks like this:

struct v4l2_subdev_core_ops {
	int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_chip_ident *chip);
	int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip);
	int (*log_status)(struct v4l2_subdev *sd);
	int (*init)(struct v4l2_subdev *sd, u32 val);
	...
@@ -390,16 +390,18 @@ allocated memory.

You should also set these fields:

- parent: set to the parent device (same device as was used to register
  v4l2_device).
- v4l2_dev: set to the v4l2_device parent device.
- name: set to something descriptive and unique.
- fops: set to the file_operations struct.
- fops: set to the v4l2_file_operations struct.
- ioctl_ops: if you use the v4l2_ioctl_ops to simplify ioctl maintenance
  (highly recommended to use this and it might become compulsory in the
  future!), then set this to your v4l2_ioctl_ops struct.

If you use v4l2_ioctl_ops, then you should set .unlocked_ioctl to
__video_ioctl2 or .ioctl to video_ioctl2 in your file_operations struct.
If you use v4l2_ioctl_ops, then you should set either .unlocked_ioctl or
.ioctl to video_ioctl2 in your v4l2_file_operations struct.

The v4l2_file_operations struct is a subset of file_operations. The main
difference is that the inode argument is omitted since it is never used.


video_device registration
@@ -410,7 +412,7 @@ for you.

	err = video_register_device(vdev, VFL_TYPE_GRABBER, -1);
	if (err) {
		video_device_release(vdev); // or kfree(my_vdev);
		video_device_release(vdev); /* or kfree(my_vdev); */
		return err;
	}

@@ -516,5 +518,4 @@ void *video_drvdata(struct file *file);

You can go from a video_device struct to the v4l2_device struct using:

struct v4l2_device *v4l2_dev = dev_get_drvdata(vdev->parent);
struct v4l2_device *v4l2_dev = vdev->v4l2_dev;
+10 −11
Original line number Diff line number Diff line
@@ -192,9 +192,9 @@ void saa7146_buffer_timeout(unsigned long data)
/********************************************************************************/
/* file operations */

static int fops_open(struct inode *inode, struct file *file)
static int fops_open(struct file *file)
{
	unsigned int minor = iminor(inode);
	unsigned int minor = video_devdata(file)->minor;
	struct saa7146_dev *h = NULL, *dev = NULL;
	struct list_head *list;
	struct saa7146_fh *fh = NULL;
@@ -202,7 +202,7 @@ static int fops_open(struct inode *inode, struct file *file)

	enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE;

	DEB_EE(("inode:%p, file:%p, minor:%d\n",inode,file,minor));
	DEB_EE(("file:%p, minor:%d\n", file, minor));

	if (mutex_lock_interruptible(&saa7146_devices_lock))
		return -ERESTARTSYS;
@@ -255,7 +255,7 @@ static int fops_open(struct inode *inode, struct file *file)
		if (dev->ext_vv_data->capabilities & V4L2_CAP_VBI_CAPTURE)
			result = saa7146_vbi_uops.open(dev,file);
		if (dev->ext_vv_data->vbi_fops.open)
			dev->ext_vv_data->vbi_fops.open(inode, file);
			dev->ext_vv_data->vbi_fops.open(file);
	} else {
		DEB_S(("initializing video...\n"));
		result = saa7146_video_uops.open(dev,file);
@@ -280,12 +280,12 @@ static int fops_open(struct inode *inode, struct file *file)
	return result;
}

static int fops_release(struct inode *inode, struct file *file)
static int fops_release(struct file *file)
{
	struct saa7146_fh  *fh  = file->private_data;
	struct saa7146_dev *dev = fh->dev;

	DEB_EE(("inode:%p, file:%p\n",inode,file));
	DEB_EE(("file:%p\n", file));

	if (mutex_lock_interruptible(&saa7146_devices_lock))
		return -ERESTARTSYS;
@@ -294,7 +294,7 @@ static int fops_release(struct inode *inode, struct file *file)
		if (dev->ext_vv_data->capabilities & V4L2_CAP_VBI_CAPTURE)
			saa7146_vbi_uops.release(dev,file);
		if (dev->ext_vv_data->vbi_fops.release)
			dev->ext_vv_data->vbi_fops.release(inode, file);
			dev->ext_vv_data->vbi_fops.release(file);
	} else {
		saa7146_video_uops.release(dev,file);
	}
@@ -308,10 +308,10 @@ static int fops_release(struct inode *inode, struct file *file)
	return 0;
}

static int fops_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
static long fops_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
/*
	DEB_EE(("inode:%p, file:%p, cmd:%d, arg:%li\n",inode, file, cmd, arg));
	DEB_EE(("file:%p, cmd:%d, arg:%li\n", file, cmd, arg));
*/
	return video_usercopy(file, cmd, arg, saa7146_video_do_ioctl);
}
@@ -416,7 +416,7 @@ static ssize_t fops_write(struct file *file, const char __user *data, size_t cou
	}
}

static const struct file_operations video_fops =
static const struct v4l2_file_operations video_fops =
{
	.owner		= THIS_MODULE,
	.open		= fops_open,
@@ -426,7 +426,6 @@ static const struct file_operations video_fops =
	.poll		= fops_poll,
	.mmap		= fops_mmap,
	.ioctl		= fops_ioctl,
	.llseek		= no_llseek,
};

static void vv_callback(struct saa7146_dev *dev, unsigned long status)
+3 −2
Original line number Diff line number Diff line
@@ -834,13 +834,14 @@ static int video_end(struct saa7146_fh *fh, struct file *file)
 * copying is done already, arg is a kernel pointer.
 */

int saa7146_video_do_ioctl(struct file *file, unsigned int cmd, void *arg)
long saa7146_video_do_ioctl(struct file *file, unsigned int cmd, void *arg)
{
	struct saa7146_fh *fh  = file->private_data;
	struct saa7146_dev *dev = fh->dev;
	struct saa7146_vv *vv = dev->vv_data;

	int err = 0, result = 0, ee = 0;
	long err = 0;
	int result = 0, ee = 0;

	struct saa7146_use_ops *ops;
	struct videobuf_queue *q;
Loading