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

Commit d43fa32f authored by Jean-Francois Moine's avatar Jean-Francois Moine Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB (8156): Many bug fixes, zc3xx added.

parent 4aa0d037
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
obj-$(CONFIG_GSPCA)	+= gspca_main.o gspca_pac207.o gspca_stk014.o
obj-$(CONFIG_GSPCA)	+= gspca_main.o \
	gspca_pac207.o gspca_stk014.o gspca_zc3xx.o

gspca_main-objs := gspca.o
gspca_pac207-objs := pac207.o
gspca_stk014-objs := stk014.o
gspca_zc3xx-objs := zc3xx.o
+768 −223

File changed.

Preview size limit exceeded, changes collapsed.

+13 −5
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ extern int gspca_debug;
#define D_PACK 0x20
#define D_USBI 0x40
#define D_USBO 0x80
#define D_V4L2 0x0100
#else
#define PDEBUG(level, fmt, args...)
#endif
@@ -46,9 +47,9 @@ extern int gspca_debug;

#define GSPCA_MAX_FRAMES 16	/* maximum number of video frame buffers */
/* ISOC transfers */
#define NURBS 4			/* number of URBs */
#define MAX_NURBS 32		/* max number of URBs (read & userptr) */
#define ISO_MAX_PKT 32		/* max number of packets in an ISOC transfer */
#define ISO_MAX_SIZE 0x10000	/* max size of one URB buffer (64 Kb) */
#define ISO_MAX_SIZE 0x8000	/* max size of one URB buffer (32 Kb) */

/* device information - set at probe time */
struct cam_mode {
@@ -123,13 +124,14 @@ struct gspca_frame {

struct gspca_dev {
	struct video_device vdev;	/* !! must be the first item */
	struct file_operations fops;
	struct usb_device *dev;
	struct file *capt_file;		/* file doing video capture */

	struct cam cam;				/* device information */
	const struct sd_desc *sd_desc;		/* subdriver description */

	struct urb *urb[NURBS];
	struct urb *urb[MAX_NURBS];

	__u8 *frbuf;				/* buffer for nframes */
	struct gspca_frame frame[GSPCA_MAX_FRAMES];
@@ -155,15 +157,21 @@ struct gspca_dev {
	struct mutex queue_lock;	/* ISOC queue protection */
	__u32 sequence;			/* frame sequence number */
	char streaming;
	char users;			/* # open */
	char users;			/* number of opens */
	char present;			/* device connected */
	char nbufread;			/* number of buffers for read() */
	char nurbs;			/* number of allocated URBs */
	char memory;			/* memory type (V4L2_MEMORY_xxx) */
	__u8 urb_in;			/* URB pointers - used when !mmap */
	__u8 urb_out;
	__u8 nbalt;			/* number of USB alternate settings */
};

int gspca_dev_probe(struct usb_interface *intf,
		const struct usb_device_id *id,
		const struct sd_desc *sd_desc,
		int dev_size);
		int dev_size,
		struct module *module);
void gspca_disconnect(struct usb_interface *intf);
struct gspca_frame *gspca_frame_add(struct gspca_dev *gspca_dev,
				    int packet_type,
+1 −1
Original line number Diff line number Diff line
@@ -265,7 +265,7 @@ static unsigned char eoh[] = {
		0x02, 0x11, 0x01,	/* samples CbCr - quant CbCr */
		0x03, 0x11, 0x01,

	0xff, 0xda, 0x00, 0x0c,		/* SOS (start of scan */
	0xff, 0xda, 0x00, 0x0c,		/* SOS (start of scan) */
	0x03, 0x01, 0x00, 0x02, 0x11, 0x03, 0x11, 0x00, 0x3f, 0x00
};
#endif
+17 −14
Original line number Diff line number Diff line
@@ -27,8 +27,8 @@

#include "gspca.h"

#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(0, 1, 1)
static const char version[] = "0.1.1";
#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(0, 2, 15)
static const char version[] = "0.2.15";

MODULE_AUTHOR("Hans de Goede <j.w.r.degoede@hhs.nl>");
MODULE_DESCRIPTION("Pixart PAC207");
@@ -188,7 +188,8 @@ static const __u8 pac207_sensor_init[][8] = {
			/* 48 reg_72 Rate Control end BalSize_4a =0x36 */
static const __u8 PacReg72[] = { 0x00, 0x00, 0x36, 0x00 };

static const char pac207_sof_marker[5] = { 0xff, 0xff, 0x00, 0xff, 0x96 };
static const unsigned char pac207_sof_marker[5] =
		{ 0xff, 0xff, 0x00, 0xff, 0x96 };

int pac207_write_regs(struct gspca_dev *gspca_dev, u16 index,
	const u8 *buffer, u16 length)
@@ -330,8 +331,9 @@ static void sd_start(struct gspca_dev *gspca_dev)
	if (gspca_dev->width == 176) {	/* 176x144 */
		mode |= 0x01;
		PDEBUG(D_STREAM, "pac207_start mode 176x144");
	} else/* 352x288 */
	} else {				/* 352x288 */
		PDEBUG(D_STREAM, "pac207_start mode 352x288");
	}
	pac207_write_reg(gspca_dev, 0x41, mode);

	pac207_write_reg(gspca_dev, 0x13, 0x01); /* Bit 0, auto clear */
@@ -425,7 +427,7 @@ void init_pixart_decoder(void)
}

/* auto gain and exposure algorithm based on the knee algorithm described here:
   http://ytse.tricolour.net/docs/LowLightOptimization.html */
 * <http://ytse.tricolour.net/docs/LowLightOptimization.html> */
static void pac207_do_auto_gain(struct gspca_dev *gspca_dev)
{
	struct sd *sd = (struct sd *) gspca_dev;
@@ -508,9 +510,10 @@ static unsigned char *pac207_find_sof(struct gspca_dev *gspca_dev,
				sd->sof_read = 0;
				return m + i + 1;
			}
		} else
		} else {
			sd->sof_read = 0;
		}
	}

	return NULL;
}
@@ -556,9 +559,9 @@ static int pac207_decompress_row(struct gspca_dev *gspca_dev,
			decoder_state->line_read++;
			decoder_state->get_abs = 0;
		} else {
			if (table[code].is_abs)
			if (table[code].is_abs) {
				decoder_state->get_abs = 1;
			else {
			} else {
				/* relative to left pixel */
				val = outp[-2] +
					table[code].val;
@@ -894,13 +897,13 @@ static struct sd_desc sd_desc = {
#define DVNM(name) .driver_info = (kernel_ulong_t) name
static __devinitdata struct usb_device_id device_table[] = {
	{USB_DEVICE(0x041e, 0x4028), DVNM("Creative Webcam Vista Plus")},
	{USB_DEVICE(0x093a, 0x2460), DVNM("PAC207 Qtec Webcam 100")},
	{USB_DEVICE(0x093a, 0x2460), DVNM("Q-Tec Webcam 100")},
	{USB_DEVICE(0x093a, 0x2463), DVNM("Philips spc200nc pac207")},
	{USB_DEVICE(0x093a, 0x2464), DVNM("Labtec Webcam 1200")},
	{USB_DEVICE(0x093a, 0x2468), DVNM("PAC207")},
	{USB_DEVICE(0x093a, 0x2470), DVNM("Genius GF112")},
	{USB_DEVICE(0x093a, 0x2471), DVNM("PAC207 Genius VideoCam ge111")},
	{USB_DEVICE(0x093a, 0x2472), DVNM("PAC207 Genius VideoCam ge110")},
	{USB_DEVICE(0x093a, 0x2471), DVNM("Genius VideoCam GE111")},
	{USB_DEVICE(0x093a, 0x2472), DVNM("Genius VideoCam GE110")},
	{USB_DEVICE(0x2001, 0xf115), DVNM("D-Link DSB-C120")},
	{}
};
@@ -910,8 +913,8 @@ MODULE_DEVICE_TABLE(usb, device_table);
static int sd_probe(struct usb_interface *intf,
			const struct usb_device_id *id)
{
	PDEBUG(D_PROBE, "camera probe");
	return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd));
	return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
				THIS_MODULE);
}

static struct usb_driver sd_driver = {
Loading