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);
343 STK_INFO(
"Syntek USB2.0 Camera is ready\n");
370 static const int values_001B[] = {
371 0x0e, 0x03, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07
373 static const int values_001C[] = {
374 0x06, 0x02, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06
376 static const int values_0202[] = {
377 0x1e, 0x0a, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x14, 0x1e, 0x1f, 0x1f, 0x1f, 0x1f
379 static const int values_0110[] = {
380 0x07, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
382 static const int values_0112[] = {
383 0x07, 0x00, 0x00, 0x00, 0x00, 0x09, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
385 static const int values_0114[] = {
386 0x87, 0x80, 0x80, 0x80, 0x80, 0xbe, 0xbe, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80
388 static const int values_0115[] = {
389 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x05, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02
391 static const int values_0116[] = {
392 0xe7, 0xe0, 0xe0, 0xe0, 0xe0, 0xe9, 0xe9, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0
394 static const int values_0117[] = {
395 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01
397 static const int values_0100[] = {
398 0x20, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20
401 STK_DEBUG(
"dev_stk6a33_configure_device : %d\n", step);
714 static const int values_204[] = {
715 0xf0, 0xf1, 0x0d, 0xf1, 0x0d, 0xf1, 0xf0, 0xf1, 0x35, 0xf1,
716 0xf0, 0xf1, 0x06, 0xf1, 0xf0, 0xf1, 0xdd, 0xf1, 0xf0, 0xf1,
717 0x1f, 0xf1, 0x20, 0xf1, 0x21, 0xf1, 0x22, 0xf1, 0x23, 0xf1,
718 0x24, 0xf1, 0x28, 0xf1, 0x29, 0xf1, 0x5e, 0xf1, 0x5f, 0xf1,
719 0x60, 0xf1, 0xef, 0xf1, 0xf2, 0xf1, 0x02, 0xf1, 0x03, 0xf1,
720 0x04, 0xf1, 0x09, 0xf1, 0x0a, 0xf1, 0x0b, 0xf1, 0x0c, 0xf1,
721 0x0d, 0xf1, 0x0e, 0xf1, 0x0f, 0xf1, 0x10, 0xf1, 0x11, 0xf1,
722 0x15, 0xf1, 0x16, 0xf1, 0x17, 0xf1, 0x18, 0xf1, 0x19, 0xf1,
723 0x1a, 0xf1, 0x1b, 0xf1, 0x1c, 0xf1, 0x1d, 0xf1, 0x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
741 0xf0, 0xf1, 0x5b, 0xf1, 0xf0, 0xf1, 0x36, 0xf1, 0x37, 0xf1,
742 0xf0, 0xf1, 0x08, 0xf1
744 static const int values_205[] = {
745 0x00, 0x00, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x00, 0x00, 0x22,
746 0x00, 0x01, 0x70, 0x0e, 0x00, 0x02, 0x18, 0xe0, 0x00, 0x02,
747 0x01, 0x80, 0xc8, 0x14, 0x80, 0x80, 0xa0, 0x78, 0xa0, 0x78,
748 0x5f, 0x20, 0xea, 0x02, 0x86, 0x7a, 0x59, 0x4c, 0x4d, 0x51,
749 0x00, 0x02, 0x00, 0x08, 0x00, 0x00, 0x00, 0xee, 0x39, 0x23,
750 0x07, 0x24, 0x00, 0xcd, 0x00, 0x93, 0x00, 0x04, 0x00, 0x5c,
751 0x00, 0xd9, 0x00, 0x53, 0x00, 0x08, 0x00, 0x91, 0x00, 0xcf,
752 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
753 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
754 0x00, 0x01, 0xf0, 0x0e, 0x70, 0x0e, 0x00, 0x01, 0x00, 0x0b,
755 0xee, 0x08, 0xf8, 0xf3, 0x00, 0xfb, 0xee, 0x09, 0xf7, 0xf3,
756 0xff, 0xfa, 0xf2, 0x08, 0xf9, 0xf5, 0xff, 0xf9, 0xe4, 0x10,
757 0xf1, 0xea, 0xf8, 0xf6, 0x00, 0x00, 0xe9, 0x0f, 0xf2, 0xed,
758 0xf6, 0xf6, 0x00, 0x00, 0xea, 0x0d, 0xf4, 0xf1, 0xf8, 0xf8,
759 0x00, 0x00, 0x07, 0x06, 0x1c, 0x0b, 0x08, 0x06, 0x17, 0x0a,
760 0x05, 0x06, 0x1a, 0x07, 0x06, 0x04, 0x0a, 0x08, 0x00, 0x19,
761 0x06, 0x05, 0x07, 0x0a, 0x00, 0x1f, 0x04, 0x04, 0x04, 0x08,
762 0x00, 0x1b, 0x74, 0x0e, 0x00, 0x01, 0x0b, 0x03, 0x47, 0x22,
763 0xac, 0x82, 0xda, 0xc7, 0xf5, 0xe9, 0xff, 0x00, 0x00, 0x01,
764 0x02, 0x80, 0x01, 0xe0, 0x43, 0x00, 0x05, 0x00, 0x04, 0x00,
765 0x43, 0x00, 0x01, 0x80, 0x00, 0x02, 0xd1, 0x00, 0xd1, 0x00,
766 0x00, 0x00, 0x00, 0x04, 0x00, 0x01, 0x0c, 0x50, 0x10, 0x10,
767 0x00, 0x00, 0xa0, 0x00, 0x20, 0x03, 0x05, 0x01, 0x20, 0x00,
768 0x00, 0x00, 0x01, 0xb8, 0x00, 0xd8, 0x00, 0x02, 0x06, 0xc0,
769 0x04, 0x0e, 0x06, 0xc0, 0x05, 0x64, 0x02, 0x08, 0x02, 0x71,
770 0x02, 0x08, 0x02, 0x71, 0x12, 0x0d, 0x17, 0x12, 0x5e, 0x1c,
771 0x00, 0x02, 0x00, 0x03, 0x00, 0x02, 0x78, 0x10, 0x83, 0x04,
772 0x00, 0x00, 0x00, 0x21
776 asize = ARRAY_SIZE(values_204);
778 for(i=0; i<asize; i++) {
791 STK_ERROR(
"Load default sensor settings fail !\n");
823 static const int values_204[] = {
824 0xf0, 0xf1, 0x2e, 0xf1, 0xf0, 0xf1, 0x5b, 0xf1, 0xf0, 0xf1, 0x36, 0xf1, 0x37, 0xf1, 0xf0, 0xf1, 0x08, 0xf1
826 static const int values_205[] = {
827 0x00, 0x02, 0x0c, 0x3c, 0x00, 0x02, 0x00, 0x03, 0x00, 0x02, 0x78, 0x10, 0x83, 0x04, 0x00, 0x00, 0x00, 0x21
831 asize = ARRAY_SIZE(values_204);
834 for (i=0; i<asize; i++) {
931 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_stk6a33_sensor_settings(struct usb_stk11xx *dev)
This function permits to set default sensor settings.
int dev_stk6a33_camera_asleep(struct usb_stk11xx *dev)
Wake-up the camera.
int dev_stk6a33_stop_stream(struct usb_stk11xx *dev)
This function sets the device to stop the stream.
#define STK_DEBUG(str, args...)
int dev_stk6a33_camera_settings(struct usb_stk11xx *dev)
This function permits to modify the settings of the camera.
int dev_stk6a33_reconf_camera(struct usb_stk11xx *dev)
Reconfigure the camera before the stream.
#define STK_ERROR(str, args...)
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_stk6a33_set_camera_fps(struct usb_stk11xx *dev)
This function permits to modify the settings of the camera.
int dev_stk6a33_init_camera(struct usb_stk11xx *dev)
This function initializes the device for the stream.
int dev_stk6a33_start_stream(struct usb_stk11xx *dev)
This function sets the device to start the stream.
int usb_stk11xx_set_feature(struct usb_stk11xx *dev, int index)
Send the message SET_FEATURE and choose the interface.
int dev_stk6a33_configure_device(struct usb_stk11xx *dev, int step)
This function permits to configure the device.
int dev_stk6a33_initialize_device(struct usb_stk11xx *dev)
This function permits to initialize the device.
#define STK_INFO(str, args...)
int usb_stk11xx_write_registry(struct usb_stk11xx *dev, __u16 index, __u16 value)
Write a 16-bits value to a 16-bits register.
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.
int dev_stk6a33_set_camera_quality(struct usb_stk11xx *dev)
This function permits to modify the settings of the camera.