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

Commit 9e6235e9 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: (45 commits)
  V4L/DVB (10411): s5h1409: Perform s5h1409 soft reset after tuning
  V4L/DVB (10403): saa7134-alsa: saa7130 doesn't support digital audio
  V4L/DVB (10229): ivtv: fix memory leak
  V4L/DVB (10385): gspca - main: Fix memory leak when USB disconnection while streaming.
  V4L/DVB (10325): em28xx: Fix for fail to submit URB with IRQs and Pre-emption Disabled
  V4L/DVB (10317): radio-mr800: fix radio->muted and radio->stereo
  V4L/DVB (10314): cx25840: ignore TUNER_SET_CONFIG in the command callback.
  V4L/DVB (10288): af9015: bug fix: stick does not work always when plugged
  V4L/DVB (10287): af9015: fix second FE
  V4L/DVB (10270): saa7146: fix unbalanced mutex_lock/unlock
  V4L/DVB (10265): budget.c driver: Kernel oops: "BUG: unable to handle kernel paging request at ffffffff
  V4L/DVB (10261): em28xx: fix kernel panic on audio shutdown
  V4L/DVB (10257): em28xx: Fix for KWorld 330U Board
  V4L/DVB (10256): em28xx: Fix for KWorld 330U AC97
  V4L/DVB (10254): em28xx: Fix audio URB transfer buffer race condition
  V4L/DVB (10250): cx25840: fix regression: fw not loaded on first use
  V4L/DVB (10248): v4l-dvb: fix a bunch of compile warnings.
  V4L/DVB (10243): em28xx: fix compile warning
  V4L/DVB (10240): Fix obvious swapped names in v4l2_subdev logic
  V4L/DVB (10233): [PATCH] Terratec Cinergy DT XS Diversity new USB ID (0ccd:0081)
  ...
parents 5c350d93 67e70baf
Loading
Loading
Loading
Loading
+17 −8
Original line number Diff line number Diff line
@@ -11,6 +11,15 @@
 *	Copied from http://www.tazenda.demon.co.uk/phil/vgrabber.c
 *	with minor modifications (Dave Forrest, drf5n@virginia.edu).
 *
 *
 *	For some cameras you may need to pre-load libv4l to perform
 *	the necessary decompression, e.g.:
 *
 *	export LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so
 *	./v4lgrab >image.ppm
 *
 *	see http://hansdegoede.livejournal.com/3636.html for details.
 *
 */

#include <unistd.h>
@@ -24,7 +33,7 @@
#include <linux/types.h>
#include <linux/videodev.h>

#define FILE "/dev/video0"
#define VIDEO_DEV "/dev/video0"

/* Stole this from tvset.c */

@@ -90,7 +99,7 @@ int get_brightness_adj(unsigned char *image, long size, int *brightness) {

int main(int argc, char ** argv)
{
  int fd = open(FILE, O_RDONLY), f;
  int fd = open(VIDEO_DEV, O_RDONLY), f;
  struct video_capability cap;
  struct video_window win;
  struct video_picture vpic;
@@ -100,13 +109,13 @@ int main(int argc, char ** argv)
  unsigned int i, src_depth;

  if (fd < 0) {
    perror(FILE);
    perror(VIDEO_DEV);
    exit(1);
  }

  if (ioctl(fd, VIDIOCGCAP, &cap) < 0) {
    perror("VIDIOGCAP");
    fprintf(stderr, "(" FILE " not a video4linux device?)\n");
    fprintf(stderr, "(" VIDEO_DEV " not a video4linux device?)\n");
    close(fd);
    exit(1);
  }
+1 −0
Original line number Diff line number Diff line
@@ -576,6 +576,7 @@ static int set_control(struct saa7146_fh *fh, struct v4l2_control *c)
		vv->vflip = c->value;
		break;
	default: {
		mutex_unlock(&dev->lock);
		return -EINVAL;
	}
	}
+1 −1
Original line number Diff line number Diff line
@@ -657,7 +657,7 @@ static int mxl5007t_get_status(struct dvb_frontend *fe, u32 *status)
{
	struct mxl5007t_state *state = fe->tuner_priv;
	int rf_locked, ref_locked;
	s32 rf_input_level;
	s32 rf_input_level = 0;
	int ret;

	if (fe->ops.i2c_gate_ctrl)
+21 −3
Original line number Diff line number Diff line
@@ -93,6 +93,9 @@ struct dvb_ca_slot {
	/* current state of the CAM */
	int slot_state;

	/* mutex used for serializing access to one CI slot */
	struct mutex slot_lock;

	/* Number of CAMCHANGES that have occurred since last processing */
	atomic_t camchange_count;

@@ -711,14 +714,20 @@ static int dvb_ca_en50221_write_data(struct dvb_ca_private *ca, int slot, u8 * b
	dprintk("%s\n", __func__);


	// sanity check
	/* sanity check */
	if (bytes_write > ca->slot_info[slot].link_buf_size)
		return -EINVAL;

	/* check if interface is actually waiting for us to read from it, or if a read is in progress */
	/* it is possible we are dealing with a single buffer implementation,
	   thus if there is data available for read or if there is even a read
	   already in progress, we do nothing but awake the kernel thread to
	   process the data if necessary. */
	if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_STATUS)) < 0)
		goto exitnowrite;
	if (status & (STATUSREG_DA | STATUSREG_RE)) {
		if (status & STATUSREG_DA)
			dvb_ca_en50221_thread_wakeup(ca);

		status = -EAGAIN;
		goto exitnowrite;
	}
@@ -987,6 +996,8 @@ static int dvb_ca_en50221_thread(void *data)
		/* go through all the slots processing them */
		for (slot = 0; slot < ca->slot_count; slot++) {

			mutex_lock(&ca->slot_info[slot].slot_lock);

			// check the cam status + deal with CAMCHANGEs
			while (dvb_ca_en50221_check_camstatus(ca, slot)) {
				/* clear down an old CI slot if necessary */
@@ -1122,7 +1133,7 @@ static int dvb_ca_en50221_thread(void *data)

			case DVB_CA_SLOTSTATE_RUNNING:
				if (!ca->open)
					continue;
					break;

				// poll slots for data
				pktcount = 0;
@@ -1146,6 +1157,8 @@ static int dvb_ca_en50221_thread(void *data)
				}
				break;
			}

			mutex_unlock(&ca->slot_info[slot].slot_lock);
		}
	}

@@ -1181,6 +1194,7 @@ static int dvb_ca_en50221_io_do_ioctl(struct inode *inode, struct file *file,
	switch (cmd) {
	case CA_RESET:
		for (slot = 0; slot < ca->slot_count; slot++) {
			mutex_lock(&ca->slot_info[slot].slot_lock);
			if (ca->slot_info[slot].slot_state != DVB_CA_SLOTSTATE_NONE) {
				dvb_ca_en50221_slot_shutdown(ca, slot);
				if (ca->flags & DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE)
@@ -1188,6 +1202,7 @@ static int dvb_ca_en50221_io_do_ioctl(struct inode *inode, struct file *file,
								     slot,
								     DVB_CA_EN50221_CAMCHANGE_INSERTED);
			}
			mutex_unlock(&ca->slot_info[slot].slot_lock);
		}
		ca->next_read_slot = 0;
		dvb_ca_en50221_thread_wakeup(ca);
@@ -1308,7 +1323,9 @@ static ssize_t dvb_ca_en50221_io_write(struct file *file,
				goto exit;
			}

			mutex_lock(&ca->slot_info[slot].slot_lock);
			status = dvb_ca_en50221_write_data(ca, slot, fragbuf, fraglen + 2);
			mutex_unlock(&ca->slot_info[slot].slot_lock);
			if (status == (fraglen + 2)) {
				written = 1;
				break;
@@ -1664,6 +1681,7 @@ int dvb_ca_en50221_init(struct dvb_adapter *dvb_adapter,
		ca->slot_info[i].slot_state = DVB_CA_SLOTSTATE_NONE;
		atomic_set(&ca->slot_info[i].camchange_count, 0);
		ca->slot_info[i].camchange_type = DVB_CA_EN50221_CAMCHANGE_REMOVED;
		mutex_init(&ca->slot_info[i].slot_lock);
	}

	if (signal_pending(current)) {
+4 −2
Original line number Diff line number Diff line
@@ -45,8 +45,10 @@ struct dvb_ca_en50221 {
	/* the module owning this structure */
	struct module* owner;

	/* NOTE: the read_*, write_* and poll_slot_status functions must use locks as
	 * they may be called from several threads at once */
	/* NOTE: the read_*, write_* and poll_slot_status functions will be
	 * called for different slots concurrently and need to use locks where
	 * and if appropriate. There will be no concurrent access to one slot.
	 */

	/* functions for accessing attribute memory on the CAM */
	int (*read_attribute_mem)(struct dvb_ca_en50221* ca, int slot, int address);
Loading