37 #define DRIVER_NAME "stk11xx" 38 #define DRIVER_VERSION "v3.0.0" 39 #define DRIVER_VERSION_NUM 0x030000 40 #define DRIVER_YEAR 2012 41 #define DRIVER_DESC "Syntek USB Video Camera" 42 #define DRIVER_AUTHOR "Nicolas VIVIEN" 43 #define PREFIX DRIVER_NAME ": " 45 "http://sourceforge.net/projects/syntekdriver/" 47 #define USB_SYNTEK1_VENDOR_ID 0x174f 48 #define USB_SYNTEK2_VENDOR_ID 0x05e1 50 #define USB_STK_A311_PRODUCT_ID 0xa311 51 #define USB_STK_A821_PRODUCT_ID 0xa821 52 #define USB_STK_AA11_PRODUCT_ID 0xaa11 53 #define USB_STK_6A31_PRODUCT_ID 0x6a31 54 #define USB_STK_6A33_PRODUCT_ID 0x6a33 55 #define USB_STK_6A51_PRODUCT_ID 0x6a51 56 #define USB_STK_6A54_PRODUCT_ID 0x6a54 57 #define USB_STK_6D51_PRODUCT_ID 0x6d51 59 #define USB_STK_0408_PRODUCT_ID 0x0408 60 #define USB_STK_0500_PRODUCT_ID 0x0500 61 #define USB_STK_0501_PRODUCT_ID 0x0501 70 #define VID_HARDWARE_STK11XX 88 88 #define MAX_ISO_BUFS 16 89 #define ISO_FRAMES_PER_DESC 10 90 #define ISO_MAX_FRAME_SIZE 3 * 1024 91 #define ISO_BUFFER_SIZE (ISO_FRAMES_PER_DESC * ISO_MAX_FRAME_SIZE) 105 #define STK11XX_MAX_IMAGES 10 106 #define STK11XX_FRAME_SIZE (1280 * 1024 * 4) 120 #define DRIVER_SUPPORT "Syntek USB Camera : STK-1135" 142 #ifndef CONFIG_STK11XX_DEBUG 143 #define CONFIG_STK11XX_DEBUG 0 146 #if CONFIG_STK11XX_DEBUG 148 #define STK_INFO(str, args...) printk(KERN_INFO PREFIX str, ##args) 149 #define STK_ERROR(str, args...) printk(KERN_ERR PREFIX str, ##args) 150 #define STK_WARNING(str, args...) printk(KERN_WARNING PREFIX str, ##args) 151 #define STK_DEBUG(str, args...) printk(KERN_DEBUG PREFIX str, ##args) 155 #define STK_INFO(str, args...) printk(KERN_INFO PREFIX str, ##args) 156 #define STK_ERROR(str, args...) printk(KERN_ERR PREFIX str, ##args) 157 #define STK_WARNING(str, args...) printk(KERN_WARNING PREFIX str, ##args) 158 #define STK_DEBUG(str, args...) do { } while(0) 171 #ifndef CONFIG_STK11XX_DEBUG_STREAM 172 #define CONFIG_STK11XX_DEBUG_STREAM 0 175 #if CONFIG_STK11XX_DEBUG_STREAM 177 #define STK_STREAM(str, args...) printk(KERN_DEBUG PREFIX str, ##args) 181 #define STK_STREAM(str, args...) do { } while(0) 200 SYNTEK_STK_0408 = 10,
201 SYNTEK_STK_AA11 = 11,
238 STK11XX_PALETTE_RGB24,
239 STK11XX_PALETTE_RGB32,
240 STK11XX_PALETTE_BGR24,
241 STK11XX_PALETTE_BGR32,
242 STK11XX_PALETTE_UYVY,
349 struct semaphore mutex;
351 struct mutex modlock;
372 unsigned int nbuffers;
373 unsigned int len_per_image;
386 #define STK11XX_PERCENT(x,y) ( ((int)x * (int)y) / 100) 393 #define to_stk11xx_dev(d) container_of(d, struct usb_stk11xx, kref) int dev_stk11xx_initialize_device(struct usb_stk11xx *)
This function permits to initialize the device.
int dev_stk11xx_camera_settings(struct usb_stk11xx *)
This function permits to modify the settings of the camera.
int v4l_stk11xx_select_video_mode(struct usb_stk11xx *, int, int)
Select a video mode.
int dev_stk11xx_init_camera(struct usb_stk11xx *)
This function initializes the device for the stream.
int dev_stk11xx_start_stream(struct usb_stk11xx *)
This function sets the device to start the stream.
int dev_stk11xx_watchdog_camera(struct usb_stk11xx *)
A espece of software watchdog.
static int default_whiteness
int usb_stk11xx_read_registry(struct usb_stk11xx *, __u16, int *)
Read a 16-bits value from a 16-bits register.
int dev_stk11xx_set_camera_fps(struct usb_stk11xx *)
This function permits to modify the fps of the camera.
void stk11xx_next_image(struct usb_stk11xx *)
Prepare the next image.
int stk11xx_next_frame(struct usb_stk11xx *)
Prepare the next frame.
wait_queue_head_t wait_frame
unsigned char * int_in_buffer
int v4l_stk11xx_unregister_video_device(struct usb_stk11xx *)
Unregister the video device.
void usb_stk11xx_isoc_handler(struct urb *)
ISOC handler.
int stk11xx_clear_buffers(struct usb_stk11xx *)
Clear current buffers.
#define STK11XX_MAX_IMAGES
int dev_stk11xx_camera_on(struct usb_stk11xx *)
This function switchs on the camera.
int dev_stk11xx_decompress(struct usb_stk11xx *)
Decompress/convert a frame from the video stream.
int stk11xx_create_sysfs_files(struct video_device *)
Create the 'sys' entries.
static int default_colour
int dev_stk11xx_stop_stream(struct usb_stk11xx *)
This function sets the device to stop the stream.
__u8 isoc_in_endpointAddr
int dev_stk11xx_reconf_camera(struct usb_stk11xx *)
Reconfigure the camera before the stream.
int usb_stk11xx_set_configuration(struct usb_stk11xx *)
Send the message SET_CONFIGURATION.
void usb_stk11xx_isoc_cleanup(struct usb_stk11xx *)
Clean-up all the ISOC buffers.
int stk11xx_free_buffers(struct usb_stk11xx *)
Release all buffers.
struct video_device * vdev
void stk11xx_remove_sysfs_files(struct video_device *)
Remove the 'sys' entries.
int v4l_stk11xx_register_video_device(struct usb_stk11xx *)
Register the video device.
int usb_stk11xx_isoc_init(struct usb_stk11xx *)
Initilize an isochronous pipe.
int dev_stk11xx_check_device(struct usb_stk11xx *, int)
This function permits to check the device in reading the register 0x0201.
int dev_stk11xx_set_camera_quality(struct usb_stk11xx *)
This function permits to modify the quality video of the camera.
int stk11xx_handle_frame(struct usb_stk11xx *)
Handler frame.
const struct stk11xx_coord stk11xx_image_sizes[STK11XX_NBR_SIZES]
int stk11xx_decompress(struct usb_stk11xx *)
Decompress a frame.
int usb_stk11xx_write_registry(struct usb_stk11xx *, __u16, __u16)
Write a 16-bits value to a 16-bits register.
static int default_brightness
int usb_stk11xx_set_feature(struct usb_stk11xx *, int)
Send the message SET_FEATURE and choose the interface.
int dev_stk11xx_camera_off(struct usb_stk11xx *)
This function switchs off the camera.
int dev_stk11xx_camera_asleep(struct usb_stk11xx *)
Wake-up the camera.
static int default_contrast
struct usb_interface * interface
int stk11xx_reset_buffers(struct usb_stk11xx *)
Reset all ISOC buffers.
int stk11xx_allocate_buffers(struct usb_stk11xx *)
Allocate all ISOC buffers.