Commit ec16dae5 authored by Jaime Velasco Juan's avatar Jaime Velasco Juan Committed by Mauro Carvalho Chehab

V4L/DVB (7019): V4L: add support for Syntek DC1125 webcams

This driver supports cameras with USB ID 174f:a311 or 05e1:0501,
and the ov965x sensors. These devices are found in some Asus laptops
and probably somewhere else.

It is based on the stk11xx driver written by Nicolas Vivien
Signed-off-by: default avatarJaime Velasco Juan <jsagarribay@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent b6667e5f
...@@ -821,6 +821,19 @@ config USB_ZR364XX ...@@ -821,6 +821,19 @@ config USB_ZR364XX
To compile this driver as a module, choose M here: the To compile this driver as a module, choose M here: the
module will be called zr364xx. module will be called zr364xx.
config USB_STKWEBCAM
tristate "USB Syntek DC1125 Camera support"
depends on VIDEO_V4L2 && EXPERIMENTAL
---help---
Say Y here if you want to use this type of camera.
Supported devices are typically found in some Asus laptops,
with USB id 174f:a311 and 05e1:0501. Other Syntek cameras
may be supported by the stk11xx driver, from which this is
derived, see http://stk11xx.sourceforge.net
To compile this driver as a module, choose M here: the
module will be called stkwebcam.
endif # V4L_USB_DRIVERS endif # V4L_USB_DRIVERS
endif # VIDEO_CAPTURE_DRIVERS endif # VIDEO_CAPTURE_DRIVERS
...@@ -8,6 +8,8 @@ tuner-objs := tuner-core.o tuner-types.o ...@@ -8,6 +8,8 @@ tuner-objs := tuner-core.o tuner-types.o
msp3400-objs := msp3400-driver.o msp3400-kthreads.o msp3400-objs := msp3400-driver.o msp3400-kthreads.o
stkwebcam-objs := stk-webcam.o stk-sensor.o
obj-$(CONFIG_VIDEO_DEV) += videodev.o v4l2-common.o compat_ioctl32.o \ obj-$(CONFIG_VIDEO_DEV) += videodev.o v4l2-common.o compat_ioctl32.o \
v4l2-int-device.o v4l2-int-device.o
...@@ -116,6 +118,7 @@ obj-$(CONFIG_USB_SE401) += se401.o ...@@ -116,6 +118,7 @@ obj-$(CONFIG_USB_SE401) += se401.o
obj-$(CONFIG_USB_STV680) += stv680.o obj-$(CONFIG_USB_STV680) += stv680.o
obj-$(CONFIG_USB_W9968CF) += w9968cf.o obj-$(CONFIG_USB_W9968CF) += w9968cf.o
obj-$(CONFIG_USB_ZR364XX) += zr364xx.o obj-$(CONFIG_USB_ZR364XX) += zr364xx.o
obj-$(CONFIG_USB_STKWEBCAM) += stkwebcam.o
obj-$(CONFIG_USB_SN9C102) += sn9c102/ obj-$(CONFIG_USB_SN9C102) += sn9c102/
obj-$(CONFIG_USB_ET61X251) += et61x251/ obj-$(CONFIG_USB_ET61X251) += et61x251/
......
This diff is collapsed.
This diff is collapsed.
/*
* stk-webcam.h : Driver for Syntek 1125 USB webcam controller
*
* Copyright (C) 2006 Nicolas VIVIEN
* Copyright 2007-2008 Jaime Velasco Juan <jsagarribay@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef STKWEBCAM_H
#define STKWEBCAM_H
#include <linux/usb.h>
#include <media/v4l2-common.h>
#define DRIVER_VERSION "v0.0.1"
#define DRIVER_VERSION_NUM 0x000001
#define MAX_ISO_BUFS 3
#define ISO_FRAMES_PER_DESC 16
#define ISO_MAX_FRAME_SIZE 3 * 1024
#define ISO_BUFFER_SIZE (ISO_FRAMES_PER_DESC * ISO_MAX_FRAME_SIZE)
#define PREFIX "stkwebcam: "
#define STK_INFO(str, args...) printk(KERN_INFO PREFIX str, ##args)
#define STK_ERROR(str, args...) printk(KERN_ERR PREFIX str, ##args)
#define STK_WARNING(str, args...) printk(KERN_WARNING PREFIX str, ##args)
struct stk_iso_buf {
void *data;
int length;
int read;
struct urb *urb;
};
/* Streaming IO buffers */
struct stk_sio_buffer {
struct v4l2_buffer v4lbuf;
char *buffer;
int mapcount;
struct stk_camera *dev;
struct list_head list;
};
enum stk_mode {MODE_VGA, MODE_SXGA, MODE_CIF, MODE_QVGA, MODE_QCIF};
struct stk_video {
enum stk_mode mode;
int brightness;
__u32 palette;
int hflip;
int vflip;
};
enum stk_status {
S_PRESENT = 1,
S_INITIALISED = 2,
S_MEMALLOCD = 4,
S_STREAMING = 8,
};
#define is_present(dev) ((dev)->status & S_PRESENT)
#define is_initialised(dev) ((dev)->status & S_INITIALISED)
#define is_streaming(dev) ((dev)->status & S_STREAMING)
#define is_memallocd(dev) ((dev)->status & S_MEMALLOCD)
#define set_present(dev) ((dev)->status = S_PRESENT)
#define unset_present(dev) ((dev)->status &= \
~(S_PRESENT|S_INITIALISED|S_STREAMING))
#define set_initialised(dev) ((dev)->status |= S_INITIALISED)
#define set_memallocd(dev) ((dev)->status |= S_MEMALLOCD)
#define unset_memallocd(dev) ((dev)->status &= ~S_MEMALLOCD)
#define set_streaming(dev) ((dev)->status |= S_STREAMING)
#define unset_streaming(dev) ((dev)->status &= ~S_STREAMING)
struct regval {
unsigned reg;
unsigned val;
};
struct stk_camera {
struct video_device vdev;
struct usb_device *udev;
struct usb_interface *interface;
int webcam_model;
struct file *owner;
u8 isoc_ep;
struct kref kref;
/* Not sure if this is right */
atomic_t urbs_used;
struct stk_video vsettings;
enum stk_status status;
spinlock_t spinlock;
wait_queue_head_t wait_frame;
struct stk_iso_buf *isobufs;
int frame_size;
/* Streaming buffers */
unsigned int n_sbufs;
struct stk_sio_buffer *sio_bufs;
struct list_head sio_avail;
struct list_head sio_full;
unsigned sequence;
};
#define to_stk_camera(d) container_of(d, struct stk_camera, kref)
#define vdev_to_camera(d) container_of(d, struct stk_camera, vdev)
void stk_camera_delete(struct kref *);
int stk_camera_write_reg(struct stk_camera *, u16, u8);
int stk_camera_read_reg(struct stk_camera *, u16, int *);
int stk_sensor_outb(struct stk_camera *dev, u8 reg, u8 val);
int stk_sensor_inb(struct stk_camera *dev, u8 reg, u8 *val);
int stk_sensor_init(struct stk_camera *);
int stk_sensor_configure(struct stk_camera *);
int stk_sensor_sleep(struct stk_camera *dev);
int stk_sensor_wakeup(struct stk_camera *dev);
int stk_sensor_set_brightness(struct stk_camera *dev, int br);
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment