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> 72 STK_INFO(
"Initialize USB2.0 Syntek Camera\n");
154 STK_INFO(
"Syntek USB2.0 Camera is ready\n");
178 static const int values_001B[] = {
179 0x03, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x0e, 0x0e, 0x0e
181 static const int values_001C[] = {
182 0x02, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x46, 0x46, 0x46
184 static const int values_0202[] = {
185 0x0a, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x0a, 0x1e, 0x1f, 0x1f, 0x0a, 0x1e, 0x1e
187 static const int values_0110[] = {
188 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01
190 static const int values_0112[] = {
191 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01
193 static const int values_0114[] = {
194 0x80, 0x80, 0x80, 0x80, 0x00, 0xbe, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x81, 0x81
196 static const int values_0115[] = {
197 0x02, 0x02, 0x02, 0x02, 0x05, 0x02, 0x02, 0x02, 0x00, 0x02, 0x02, 0x02, 0x05, 0x02, 0x02, 0x02, 0x02, 0x02
199 static const int values_0116[] = {
200 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe9, 0xe0, 0xe0, 0x00, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe1, 0xe1, 0xe1
202 static const int values_0117[] = {
203 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01
205 static const int values_0100[] = {
206 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, 0x21
210 STK_DEBUG(
"dev_stk0500_configure_device : %d\n", step);
623 static const int values_204[] = {
624 0x1e, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
625 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12,
626 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1b, 0x1c, 0x1d,
627 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x1e, 0x25,
628 0x06, 0x25, 0x03, 0x04
630 static const int values_205[] = {
631 0x10, 0x11, 0x7b, 0x19, 0x06, 0x78, 0x10, 0x00, 0x00, 0x00,
632 0x00, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00,
633 0x04, 0x00, 0x0b, 0x04, 0x08, 0x05, 0x08, 0x01, 0x10, 0x09,
634 0x00, 0x08, 0x24, 0x05, 0x48, 0x00, 0x20, 0x01, 0x00, 0x01,
635 0x01, 0x01, 0x06, 0x78
639 asize = ARRAY_SIZE(values_204);
641 for(i=0; i<asize; i++) {
654 STK_ERROR(
"Load default sensor settings fail !\n");
int dev_stk11xx_camera_off(struct usb_stk11xx *dev)
This function switchs off the camera.
int dev_stk0500_sensor_settings(struct usb_stk11xx *dev)
This function permits to set default sensor settings.
int dev_stk0500_camera_settings(struct usb_stk11xx *dev)
This function permits to modify the settings of the camera.
int dev_stk0500_start_stream(struct usb_stk11xx *dev)
This function sets the device to start the stream.
int dev_stk0500_initialize_device(struct usb_stk11xx *dev)
This function permits to initialize the device.
int dev_stk0500_configure_device(struct usb_stk11xx *dev, int step)
This function permits to configure the device.
#define STK_DEBUG(str, args...)
#define STK_ERROR(str, args...)
int dev_stk0500_set_camera_quality(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_stk0500_camera_asleep(struct usb_stk11xx *dev)
Wake-up the camera.
int dev_stk0500_init_camera(struct usb_stk11xx *dev)
This function initializes the device for the stream.
int usb_stk11xx_set_feature(struct usb_stk11xx *dev, int index)
Send the message SET_FEATURE and choose the interface.
int dev_stk0500_stop_stream(struct usb_stk11xx *dev)
This function sets the device to stop the stream.
#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 dev_stk0500_reconf_camera(struct usb_stk11xx *dev)
Reconfigure the camera before 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.
Driver for Syntek USB video camera.
int dev_stk0500_set_camera_fps(struct usb_stk11xx *dev)
This function permits to modify the settings of the camera.