stk11xx-dev-a311.c File Reference

Driver for Syntek USB video camera. More...

#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/version.h>
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/kref.h>
#include <linux/usb.h>
#include <media/v4l2-common.h>
#include "stk11xx.h"
#include "stk11xx-dev.h"

Go to the source code of this file.

Functions

int dev_stka311_initialize_device (struct usb_stk11xx *dev)
 This function permits to initialize the device.
int dev_stka311_configure_device (struct usb_stk11xx *dev, int step)
 This function permits to configure the device.
int dev_stka311_camera_asleep (struct usb_stk11xx *dev)
 Wake-up the camera.
int dev_stka311_init_camera (struct usb_stk11xx *dev)
 This function initializes the device for the stream.
int dev_stka311_sensor_settings (struct usb_stk11xx *dev)
 This function permits to set default sensor settings.
int dev_stka311_camera_settings (struct usb_stk11xx *dev)
 This function permits to modify the settings of the camera.
int dev_stka311_set_camera_quality (struct usb_stk11xx *dev)
 This function permits to modify the settings of the camera.
int dev_stka311_set_camera_fps (struct usb_stk11xx *dev)
 This function permits to modify the settings of the camera.
int dev_stka311_start_stream (struct usb_stk11xx *dev)
 This function sets the device to start the stream.
int dev_stka311_reconf_camera (struct usb_stk11xx *dev)
 Reconfigure the camera before the stream.
int dev_stka311_stop_stream (struct usb_stk11xx *dev)
 This function sets the device to stop the stream.


Detailed Description

Driver for Syntek USB video camera.

Author:
Nicolas VIVIEN
Date:
2006-10-23
Version:
v1.3.x
Note:
Copyright (C) Nicolas VIVIEN
Licences
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

SubVersion
Date
2007-12-08 11:34:45 +0100 (sam, 08 déc 2007)
Revision
68
Author
nicklas79
HeadURL
https://syntekdriver.svn.sourceforge.net/svnroot/syntekdriver/tags/1.3.1/stk11xx-dev-a311.c

Definition in file stk11xx-dev-a311.c.


Function Documentation

int dev_stka311_camera_asleep ( struct usb_stk11xx *  dev  ) 

Wake-up the camera.

Parameters:
dev Device structure
Returns:
0 if all is OK
This function permits to wake-up the device.

Definition at line 631 of file stk11xx-dev-a311.c.

References usb_stk11xx_read_registry(), and usb_stk11xx_write_registry().

Referenced by dev_stk11xx_camera_asleep(), dev_stka311_init_camera(), and dev_stka311_initialize_device().

int dev_stka311_camera_settings ( struct usb_stk11xx *  dev  ) 

This function permits to modify the settings of the camera.

Parameters:
dev Device structure
Returns:
0 if all is OK
This functions permits to modify the settings :
  • brightness
  • contrast
  • white balance
  • ...

Definition at line 818 of file stk11xx-dev-a311.c.

References dev_stk11xx_check_device(), dev_stka311_set_camera_fps(), dev_stka311_set_camera_quality(), and STK_DEBUG.

Referenced by dev_stk11xx_camera_settings(), and dev_stka311_init_camera().

int dev_stka311_configure_device ( struct usb_stk11xx *  dev,
int  step 
)

This function permits to configure the device.

Parameters:
dev Device structure
step The step of configuration [0-11]
Returns:
0 if all is OK
The configuration of device is composed of 11 steps. This function is called by the initialization process.

We don't know the meaning of these steps ! We only replay the USB log.

The steps 0 to 9 are called during the initialization. Then, the driver choose the last step : 10 : for a resolution from 80x60 to 640x480 11 : for a resolution from 800x600 to 1280x1024

Definition at line 392 of file stk11xx-dev-a311.c.

References dev_stk11xx_check_device(), dev_stka311_sensor_settings(), STK_DEBUG, usb_stk11xx_read_registry(), and usb_stk11xx_write_registry().

Referenced by dev_stka311_init_camera(), dev_stka311_initialize_device(), and dev_stka311_reconf_camera().

int dev_stka311_init_camera ( struct usb_stk11xx *  dev  ) 

This function initializes the device for the stream.

Parameters:
dev Device structure
Returns:
0 if all is OK
It's the start. This function has to be called at first, before enabling the video stream.

Definition at line 661 of file stk11xx-dev-a311.c.

References dev_stk11xx_camera_off(), dev_stk11xx_check_device(), dev_stka311_camera_asleep(), dev_stka311_camera_settings(), dev_stka311_configure_device(), usb_stk11xx_read_registry(), usb_stk11xx_set_feature(), and usb_stk11xx_write_registry().

Referenced by dev_stk11xx_init_camera().

int dev_stka311_initialize_device ( struct usb_stk11xx *  dev  ) 

This function permits to initialize the device.

Parameters:
dev Device structure
Returns:
0 if all is OK
This function must be called at first. It's the start of the initialization process. After this process, the device is completly initalized and it's ready.

This function is written from the USB log.

Definition at line 69 of file stk11xx-dev-a311.c.

References dev_stk11xx_check_device(), dev_stka311_camera_asleep(), dev_stka311_configure_device(), STK_DEBUG, STK_INFO, usb_stk11xx_read_registry(), usb_stk11xx_set_feature(), and usb_stk11xx_write_registry().

Referenced by dev_stk11xx_initialize_device().

int dev_stka311_reconf_camera ( struct usb_stk11xx *  dev  ) 

Reconfigure the camera before the stream.

Parameters:
dev Device structure
Returns:
0 if all is OK
Before enabling the video stream, you have to reconfigure the device.

Definition at line 1004 of file stk11xx-dev-a311.c.

References dev_stk11xx_camera_settings(), and dev_stka311_configure_device().

Referenced by dev_stk11xx_reconf_camera().

int dev_stka311_sensor_settings ( struct usb_stk11xx *  dev  ) 

This function permits to set default sensor settings.

Parameters:
dev Device structure
Returns:
0 if all is OK
We set some registers in using a I2C bus. WARNING, the sensor settings can be different following the situation.

Definition at line 710 of file stk11xx-dev-a311.c.

References dev_stk11xx_check_device(), STK_ERROR, usb_stk11xx_read_registry(), and usb_stk11xx_write_registry().

Referenced by dev_stka311_configure_device().

int dev_stka311_set_camera_fps ( struct usb_stk11xx *  dev  ) 

This function permits to modify the settings of the camera.

Parameters:
dev Device structure
Returns:
0 if all is OK
This functions permits to modify the frame rate per second.

0x204 = 0x2e : Fps MSB (by default 0x01) 0x204 = 0x2d : Fps LSB (by default 0x00)

0x2e | 0x2d | Nbr fps -----+------+-------- 0x00 | 0x00 | 30 0x01 | 0x00 | 20 0x02 | 0x00 | 15 0x03 | 0x00 | 12 0x04 | 0x00 | 10

Definition at line 915 of file stk11xx-dev-a311.c.

References usb_stk11xx_write_registry().

Referenced by dev_stk11xx_set_camera_fps(), and dev_stka311_camera_settings().

int dev_stka311_set_camera_quality ( struct usb_stk11xx *  dev  ) 

This function permits to modify the settings of the camera.

Parameters:
dev Device structure
Returns:
0 if all is OK
This functions permits to modify the settings :
  • brightness
  • contrast
  • white balance
  • ...

0x204 = 0xa1 : unkown (by default 0x00) 0x204 = 0x10 : contrast (by default 0x7c) 0x204 = 0x04 : Mode (unknown) (by default 0x00) (=> already looked 0x01 and 0x02) 0x204 = 0x00 : brightness / white balance (by default 0x00)

Definition at line 858 of file stk11xx-dev-a311.c.

References STK_DEBUG, and usb_stk11xx_write_registry().

Referenced by dev_stk11xx_set_camera_quality(), and dev_stka311_camera_settings().

int dev_stka311_start_stream ( struct usb_stk11xx *  dev  ) 

This function sets the device to start the stream.

Parameters:
dev Device structure
Returns:
0 if all is OK
After the initialization of the device and the initialization of the video stream, this function permits to enable the stream.

Definition at line 974 of file stk11xx-dev-a311.c.

References usb_stk11xx_read_registry(), and usb_stk11xx_write_registry().

Referenced by dev_stk11xx_start_stream().

int dev_stka311_stop_stream ( struct usb_stk11xx *  dev  ) 

This function sets the device to stop the stream.

Parameters:
dev Device structure
Returns:
0 if all is OK
You use the function start_stream to enable the video stream. So you have to use the function stop_strem to disable the video stream.

Definition at line 1045 of file stk11xx-dev-a311.c.

References usb_stk11xx_read_registry(), and usb_stk11xx_write_registry().

Referenced by dev_stk11xx_stop_stream().


Generated on Tue Jul 29 16:45:24 2008 for SyntekUSBVideoCamera by  doxygen 1.5.6