34 #include <linux/module.h>
35 #include <linux/init.h>
36 #include <linux/kernel.h>
37 #include <linux/version.h>
38 #include <linux/errno.h>
39 #include <linux/slab.h>
40 #include <linux/kref.h>
42 #include <linux/usb.h>
43 #include <media/v4l2-common.h>
44 #include <media/v4l2-ioctl.h>
75 STK_INFO(
"Initialize USB2.0 Syntek Camera\n");
113 for (i=0; i<16; i++) {
118 STK_DEBUG(
"Loop 1 : Read 0x0000 = %02X\n", value);
162 for (i=0; i<16; i++) {
167 STK_DEBUG(
"Loop 2 : Read 0x0000 = %02X\n", value);
217 for (i=0; i<16; i++) {
222 STK_DEBUG(
"Loop 3 : Read 0x0000 = %02X\n", value);
296 STK_INFO(
"Syntek USB2.0 Camera is ready\n");
320 static const int values_001B[] = {
321 0x0e, 0x03, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x07, 0x07, 0x07, 0x07, 0x07
323 static const int values_001C[] = {
324 0x06, 0x02, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06
326 static const int values_0202[] = {
327 0x1e, 0x0a, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e
329 static const int values_0110[] = {
330 0x07, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x3e, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00
332 static const int values_0112[] = {
333 0x07, 0x00, 0x00, 0x00, 0x00, 0x09, 0x09, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00
335 static const int values_0114[] = {
336 0x87, 0x80, 0x80, 0x80, 0x80, 0xbe, 0xbe, 0x80, 0x84, 0x80, 0x80, 0x80, 0x80, 0x80
338 static const int values_0116[] = {
339 0xe7, 0xe0, 0xe0, 0xe0, 0xe0, 0xe9, 0xe9, 0xe0, 0xe4, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0
341 static const int values_0100[] = {
342 0x20, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x23, 0x20, 0x20, 0x20, 0x20, 0x20
345 STK_DEBUG(
"dev_stka821_configure_device : %d\n", step);
667 static const int values_204[] = {
668 0x17, 0x19, 0xb4, 0xa6, 0x12, 0x13, 0x1e, 0x21, 0x24, 0x32,
669 0x36, 0x39, 0x4d, 0x53, 0x5d, 0x5f, 0x60, 0x61, 0x62, 0x63,
670 0x64, 0x65, 0x66, 0x82, 0x83, 0x85, 0x86, 0x89, 0x97, 0x98,
671 0xad, 0xae, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbf, 0x48, 0xd8,
672 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
673 0x80, 0x81, 0xd8, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c,
674 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0xd8, 0x76, 0x77, 0x78, 0x79,
675 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x5c, 0xc0,
676 0x59, 0x5a, 0x5b, 0xd4, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93,
677 0x94, 0x95, 0x96, 0xb3, 0x73, 0x06, 0x07, 0x0b, 0x15, 0x20,
678 0x4e, 0x4f, 0x49, 0x4a, 0x4b, 0x4c, 0x46, 0x06, 0x07, 0xb9,
679 0xba, 0xbb, 0xbc, 0x61, 0x62, 0x65, 0x66
681 static const int values_205[] = {
682 0x41, 0x41, 0x03, 0x06, 0x06, 0x08, 0x06, 0x00, 0x02, 0x69,
683 0x35, 0x60, 0xfe, 0x1c, 0x04, 0x08, 0x08, 0x08, 0x08, 0x00,
684 0x00, 0x10, 0x14, 0x01, 0x80, 0x0c, 0xb6, 0x00, 0x25, 0x25,
685 0x3f, 0x24, 0x10, 0x07, 0xcc, 0x1f, 0x30, 0x02, 0x9c, 0x80,
686 0x00, 0x0d, 0x18, 0x22, 0x2c, 0x3e, 0x4f, 0x6f, 0x8e, 0xac,
687 0xc8, 0xe5, 0xa0, 0x00, 0x0d, 0x18, 0x22, 0x2c, 0x3e, 0x4f,
688 0x6f, 0x8e, 0xac, 0xc8, 0xe5, 0xc0, 0x00, 0x0d, 0x18, 0x22,
689 0x2c, 0x3e, 0x4f, 0x6f, 0x8e, 0xac, 0xc8, 0xe5, 0x70, 0x18,
690 0x09, 0x07, 0x07, 0x3c, 0x3d, 0x95, 0x88, 0x89, 0x47, 0x9c,
691 0x81, 0x9c, 0x3d, 0x76, 0x76, 0x01, 0xf3, 0x05, 0x00, 0x44,
692 0x06, 0x0a, 0x96, 0x00, 0x7d, 0x00, 0x20, 0x01, 0xf3, 0x04,
693 0xe4, 0x09, 0xc8, 0x08, 0x08, 0x10, 0x14
697 asize = ARRAY_SIZE(values_204);
699 for(i=0; i<asize; i++) {
710 STK_ERROR(
"Load default sensor settings fail !\n");
742 static const int values_204[] = {
743 0xb3, 0x73, 0x46, 0x06, 0x07, 0xb9, 0xba, 0xbb, 0xbc, 0x61, 0x62, 0x65, 0x66
745 static const int values_205[] = {
746 0x76, 0x76, 0x20, 0x01, 0xf3, 0x04, 0xe4, 0x09, 0xc8, 0x08, 0x08, 0x10, 0x14
761 asize = ARRAY_SIZE(values_204);
763 for (i=1; i<asize; i++) {
844 int value_116, value_117;
int dev_stk11xx_camera_off(struct usb_stk11xx *dev)
This function switchs off the camera.
int dev_stk11xx_camera_settings(struct usb_stk11xx *dev)
This function permits to modify the settings of the camera.
int dev_stka821_set_camera_quality(struct usb_stk11xx *dev)
This function permits to modify the settings of the camera.
#define STK_DEBUG(str, args...)
#define STK_ERROR(str, args...)
int dev_stka821_camera_asleep(struct usb_stk11xx *dev)
Wake-up the camera.
int dev_stka821_sensor_settings(struct usb_stk11xx *dev)
This function permits to set default sensor settings.
int dev_stka821_init_camera(struct usb_stk11xx *dev)
This function initializes the device for the stream.
struct stk11xx_video vsettings
int dev_stk11xx_check_device(struct usb_stk11xx *dev, int nbr)
This function permits to check the device in reading the register 0x0201.
int dev_stka821_stop_stream(struct usb_stk11xx *dev)
This function sets the device to stop the stream.
int dev_stka821_initialize_device(struct usb_stk11xx *dev)
This function permits to initialize the device.
int dev_stka821_reconf_camera(struct usb_stk11xx *dev)
Reconfigure the camera before the stream.
int usb_stk11xx_set_feature(struct usb_stk11xx *dev, int index)
Send the message SET_FEATURE and choose the interface.
int dev_stka821_configure_device(struct usb_stk11xx *dev, int step)
This function permits to configure the device.
int dev_stka821_set_camera_fps(struct usb_stk11xx *dev)
This function permits to modify the settings of the camera.
#define STK_INFO(str, args...)
int dev_stka821_start_stream(struct usb_stk11xx *dev)
This function sets the device to start the stream.
int usb_stk11xx_write_registry(struct usb_stk11xx *dev, __u16 index, __u16 value)
Write a 16-bits value to a 16-bits register.
int dev_stka821_camera_settings(struct usb_stk11xx *dev)
This function permits to modify the settings of the camera.
int usb_stk11xx_read_registry(struct usb_stk11xx *dev, __u16 index, int *value)
Read a 16-bits value from a 16-bits register.
Driver for Syntek USB video camera.
Driver for Syntek USB video camera.