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);
368 STK_INFO(
"Syntek USB2.0 Camera is ready\n");
398 static const int values_001B[] = {
399 0x0e, 0x03, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e
401 static const int values_001C[] = {
402 0x06, 0x02, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x0e
404 static const int values_0202[] = {
405 0x1e, 0x0a, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e
407 static const int values_0110[] = {
408 0x07, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00
410 static const int values_0112[] = {
411 0x07, 0x00, 0x00, 0x00, 0x00, 0x09, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00
413 static const int values_0114[] = {
414 0x87, 0x80, 0x80, 0x80, 0x80, 0xbe, 0xbe, 0x80, 0x80, 0x80, 0x80, 0x00
416 static const int values_0115[] = {
417 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x05
419 static const int values_0116[] = {
420 0xe7, 0xe0, 0xe0, 0xe0, 0xe0, 0xe9, 0xe9, 0xe0, 0xe0, 0xe0, 0xe0, 0x00
422 static const int values_0117[] = {
423 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x04
425 static const int values_0100[] = {
426 0x20, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21
429 STK_DEBUG(
"dev_stka311_configure_device : %d\n", step);
715 int *values_204 = NULL;
716 int *values_205 = NULL;
719 static const int values_1_204[] = {
720 0x12, 0x11, 0x3b, 0x6a, 0x13, 0x10, 0x00, 0x01, 0x02, 0x13,
721 0x39, 0x38, 0x37, 0x35, 0x0e, 0x12, 0x04, 0x0c, 0x0d, 0x17,
722 0x18, 0x32, 0x19, 0x1a, 0x03, 0x1b, 0x16, 0x33, 0x34, 0x41,
723 0x96, 0x3d, 0x69, 0x3a, 0x8e, 0x3c, 0x8f, 0x8b, 0x8c, 0x94,
724 0x95, 0x40, 0x29, 0x0f, 0xa5, 0x1e, 0xa9, 0xaa, 0xab, 0x90,
725 0x91, 0x9f, 0xa0, 0x24, 0x25, 0x26, 0x14, 0x2a, 0x2b
727 static const int values_1_205[] = {
728 0x45, 0x80, 0x01, 0x7d, 0x80, 0x00, 0x00, 0x80, 0x80, 0x80,
729 0x50, 0x93, 0x00, 0x81, 0x20, 0x45, 0x00, 0x00, 0x00, 0x24,
730 0xc4, 0xb6, 0x00, 0x3c, 0x36, 0x00, 0x07, 0xe2, 0xbf, 0x00,
731 0x04, 0x19, 0x40, 0x0d, 0x00, 0x73, 0xdf, 0x06, 0x20, 0x88,
732 0x88, 0xc1, 0x3f, 0x42, 0x80, 0x04, 0xb8, 0x92, 0x0a, 0x00,
733 0x00, 0x00, 0x00, 0x68, 0x5c, 0xc3, 0x2e, 0x00, 0x00
737 static const int values_2_204[] = {
738 0x12, 0x11, 0x3b, 0x6a, 0x13, 0x10, 0x00, 0x01, 0x02, 0x13,
739 0x39, 0x38, 0x37, 0x35, 0x0e, 0x12, 0x04, 0x0c, 0x0d, 0x17,
740 0x18, 0x32, 0x19, 0x1a, 0x03, 0x1b, 0x16, 0x33, 0x34, 0x41,
741 0x96, 0x3d, 0x69, 0x3a, 0x8e, 0x3c, 0x8f, 0x8b, 0x8c, 0x94,
742 0x95, 0x40, 0x29, 0x0f, 0xa5, 0x1e, 0xa9, 0xaa, 0xab, 0x90,
743 0x91, 0x9f, 0xa0, 0x24, 0x25, 0x26, 0x14, 0x2a, 0x2b
745 static const int values_2_205[] = {
746 0x05, 0x80, 0x01, 0x7d, 0x80, 0x00, 0x00, 0x80, 0x80, 0x80,
747 0x50, 0x93, 0x00, 0x81, 0x20, 0x05, 0x00, 0x00, 0x00, 0x1b,
748 0xbb, 0xa4, 0x01, 0x81, 0x12, 0x00, 0x07, 0xe2, 0xbf, 0x00,
749 0x04, 0x19, 0x40, 0x0d, 0x00, 0x73, 0xdf, 0x06, 0x20, 0x88,
750 0x88, 0xc1, 0x3f, 0x42, 0x80, 0x04, 0xb8, 0x92, 0x0a, 0x00,
751 0x00, 0x00, 0x00, 0x68, 0x5c, 0xc3, 0x2e, 0x00, 0x00
756 switch (dev->resolution) {
757 case STK11XX_1280x1024:
758 case STK11XX_1024x768:
759 case STK11XX_800x600:
760 case STK11XX_720x576:
761 asize = ARRAY_SIZE(values_2_204);
762 values_204 = (
int *) values_2_204;
763 values_205 = (
int *) values_2_205;
766 case STK11XX_640x480:
767 case STK11XX_320x240:
768 case STK11XX_160x120:
769 case STK11XX_213x160:
773 asize = ARRAY_SIZE(values_1_204);
774 values_204 = (
int *) values_1_204;
775 values_205 = (
int *) values_1_205;
780 for(i=0; i<asize; i++) {
791 STK_ERROR(
"Load default sensor settings fail !\n");
976 int value_116, value_117;
1008 switch (dev->resolution) {
1009 case STK11XX_1280x1024:
1010 case STK11XX_1024x768:
1011 case STK11XX_800x600:
1012 case STK11XX_720x576:
1016 case STK11XX_640x480:
1017 case STK11XX_320x240:
1018 case STK11XX_160x120:
1019 case STK11XX_213x160:
1020 case STK11XX_128x96:
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_stka311_camera_asleep(struct usb_stk11xx *dev)
Wake-up the camera.
#define STK_DEBUG(str, args...)
int dev_stka311_sensor_settings(struct usb_stk11xx *dev)
This function permits to set default sensor settings.
#define STK_ERROR(str, args...)
int dev_stka311_stop_stream(struct usb_stk11xx *dev)
This function sets the device to stop the stream.
int dev_stka311_camera_settings(struct usb_stk11xx *dev)
This function permits to modify the settings of the camera.
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_stka311_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_stka311_start_stream(struct usb_stk11xx *dev)
This function sets the device to start the stream.
int dev_stka311_set_camera_quality(struct usb_stk11xx *dev)
This function permits to modify the settings of the camera.
#define STK_INFO(str, args...)
int dev_stka311_set_camera_fps(struct usb_stk11xx *dev)
This function permits to modify the settings of the camera.
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_stka311_init_camera(struct usb_stk11xx *dev)
This function initializes the device for the stream.
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.
int dev_stka311_initialize_device(struct usb_stk11xx *dev)
This function permits to initialize the device.
Driver for Syntek USB video camera.
int dev_stka311_configure_device(struct usb_stk11xx *dev, int step)
This function permits to configure the device.