stk11xx-usb.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/mm.h>
#include <linux/usb.h>
#include <media/v4l2-common.h>
#include "stk11xx.h"

Go to the source code of this file.

Functions

 MODULE_DEVICE_TABLE (usb, stk11xx_table)
int usb_stk11xx_isoc_init (struct usb_stk11xx *dev)
 Initilize an isochronous pipe.
void usb_stk11xx_isoc_handler (struct urb *urb)
 ISOC handler.
void usb_stk11xx_isoc_cleanup (struct usb_stk11xx *dev)
 Clean-up all the ISOC buffers.
int usb_stk11xx_set_feature (struct usb_stk11xx *dev, int index)
 Send the message SET_FEATURE and choose the interface.
int usb_stk11xx_set_configuration (struct usb_stk11xx *dev)
 Send the message SET_CONFIGURATION.
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.
static int usb_stk11xx_default_settings (struct usb_stk11xx *dev)
 Set the default value about the video settings.
static int usb_stk11xx_probe (struct usb_interface *interface, const struct usb_device_id *id)
 Load the driver.
static void usb_stk11xx_disconnect (struct usb_interface *interface)
 This function is called when the device is disconnected or when the kernel module is unloaded.
 module_param (fps, int, 0444)
 Module frame per second parameter.
 module_param (hflip, int, 0444)
 Module horizontal flip process.
 module_param (vflip, int, 0444)
 Module vertical flip process.
 module_param (brightness, int, 0444)
 Module brightness.
 module_param (whiteness, int, 0444)
 Module whiteness.
 module_param (contrast, int, 0444)
 Module contrast.
 module_param (colour, int, 0444)
 Module colour.
static int __init usb_stk11xx_init (void)
 Initialize the driver.
static void __exit usb_stk11xx_exit (void)
 Close the driver.
 module_init (usb_stk11xx_init)
 Module initialize.
 module_exit (usb_stk11xx_exit)
 Module exit.
 MODULE_PARM_DESC (fps,"Frames per second [5-30]")
 Description of 'fps' parameter.
 MODULE_PARM_DESC (hflip,"Horizontal image flip")
 Description of 'hflip' parameter.
 MODULE_PARM_DESC (vflip,"Vertical image flip")
 Description of 'vflip' parameter.
 MODULE_PARM_DESC (brightness,"Brightness setting")
 Description of 'brightness' parameter.
 MODULE_PARM_DESC (whiteness,"Whiteness setting")
 Description of 'whiteness' parameter.
 MODULE_PARM_DESC (colour,"Colour setting")
 Description of 'colour' parameter.
 MODULE_PARM_DESC (contrast,"Contrast setting")
 Description of 'contrast' parameter.
 MODULE_LICENSE ("GPL")
 Driver is under licence GPL.
 MODULE_AUTHOR (DRIVER_AUTHOR)
 Driver is written by Nicolas VIVIEN.
 MODULE_DESCRIPTION (DRIVER_DESC)
 Define the description of the driver.
 MODULE_SUPPORTED_DEVICE (DRIVER_SUPPORT)
 List of supported device.

Variables

static int default_fps = -1
static int default_hflip = -1
static int default_vflip = -1
static int default_brightness = -1
static int default_whiteness = -1
static int default_contrast = -1
static int default_colour = -1
static struct usb_device_id stk11xx_table []
static struct usb_driver usb_stk11xx_driver
static int fps
static int hflip = -1
static int vflip = -1
static int brightness = -1
static int whiteness = -1
static int contrast = -1
static int colour = -1


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
2008-02-05 14:24:14 +0100 (mar, 05 fév 2008)
Revision
74
Author
nicklas79
HeadURL
https://syntekdriver.svn.sourceforge.net/svnroot/syntekdriver/tags/1.3.1/stk11xx-usb.c

Definition in file stk11xx-usb.c.


Function Documentation

MODULE_DEVICE_TABLE ( usb  ,
stk11xx_table   
)

Define the supported devices

static int usb_stk11xx_default_settings ( struct usb_stk11xx *  dev  )  [static]

Set the default value about the video settings.

Parameters:
dev 
Returns:
0 if all is OK
This function permits to set the video settings for each video camera model.

Definition at line 610 of file stk11xx-usb.c.

References default_brightness, default_colour, default_contrast, default_fps, default_hflip, default_vflip, default_whiteness, and STK11XX_PERCENT.

Referenced by usb_stk11xx_probe().

static void usb_stk11xx_disconnect ( struct usb_interface *  interface  )  [static]

This function is called when the device is disconnected or when the kernel module is unloaded.

Parameters:
interface 

Definition at line 897 of file stk11xx-usb.c.

References stk11xx_remove_sysfs_files(), STK_INFO, and v4l_stk11xx_unregister_video_device().

static void __exit usb_stk11xx_exit ( void   )  [static]

Close the driver.

This function is called at last when you unload the driver.

Definition at line 1077 of file stk11xx-usb.c.

References STK_INFO.

static int __init usb_stk11xx_init ( void   )  [static]

Initialize the driver.

Returns:
0 if all is OK
This function is called at first. This function permits to define the default values from the command line.

Definition at line 1000 of file stk11xx-usb.c.

References default_brightness, default_colour, default_contrast, default_fps, default_hflip, default_vflip, default_whiteness, DRIVER_DESC, DRIVER_VERSION, STK_DEBUG, STK_ERROR, and STK_INFO.

void usb_stk11xx_isoc_cleanup ( struct usb_stk11xx *  dev  ) 

Clean-up all the ISOC buffers.

Parameters:
dev Device structure
This function permits to clean-up all the ISOC buffers.

Definition at line 435 of file stk11xx-usb.c.

References MAX_ISO_BUFS, and STK_DEBUG.

Referenced by v4l_stk11xx_do_ioctl(), v4l_stk11xx_open(), and v4l_stk11xx_release().

void usb_stk11xx_isoc_handler ( struct urb *  urb  ) 

ISOC handler.

Parameters:
urb URB structure
This function is called as an URB transfert is complete (Isochronous pipe). So, the traitement is done in interrupt time, so it has be fast, not crash, ans not stall. Neat.

Definition at line 246 of file stk11xx-usb.c.

References stk11xx_next_frame(), STK_DEBUG, STK_ERROR, and STK_STREAM.

Referenced by usb_stk11xx_isoc_init().

int usb_stk11xx_isoc_init ( struct usb_stk11xx *  dev  ) 

Initilize an isochronous pipe.

Parameters:
dev Device structure
Returns:
0 if all is OK
This function permits to initialize an URB transfert (or isochronous pipe).

Definition at line 124 of file stk11xx-usb.c.

References ISO_BUFFER_SIZE, ISO_FRAMES_PER_DESC, ISO_MAX_FRAME_SIZE, MAX_ISO_BUFS, STK_DEBUG, STK_ERROR, and usb_stk11xx_isoc_handler().

Referenced by v4l_stk11xx_do_ioctl(), and v4l_stk11xx_open().

static int usb_stk11xx_probe ( struct usb_interface *  interface,
const struct usb_device_id *  id 
) [static]

int usb_stk11xx_read_registry ( struct usb_stk11xx *  dev,
__u16  index,
int *  value 
)

Read a 16-bits value from a 16-bits register.

Parameters:
dev 
index 
value 
Returns:
0 if all is OK
This function permits to read a 16-bits value from a 16-bits register on the USB bus.

Definition at line 576 of file stk11xx-usb.c.

References STK_ERROR.

Referenced by dev_stk11xx_check_device(), dev_stk11xx_watchdog_camera(), dev_stk6a31_camera_asleep(), dev_stk6a31_camera_settings(), dev_stk6a31_configure_device(), dev_stk6a31_sensor_settings(), dev_stk6a31_set_camera_quality(), dev_stk6a31_start_stream(), dev_stk6a33_camera_asleep(), dev_stk6a33_camera_settings(), dev_stk6a33_configure_device(), dev_stk6a33_initialize_device(), dev_stk6a33_sensor_settings(), dev_stk6a33_set_camera_quality(), dev_stk6a33_start_stream(), dev_stk6a33_stop_stream(), dev_stk6a51_camera_asleep(), dev_stk6a51_configure_device(), dev_stk6a51_initialize_device(), dev_stk6a51_sensor_settings(), dev_stk6a51_set_camera_quality(), dev_stk6a51_start_stream(), dev_stk6a54_camera_asleep(), dev_stk6a54_configure_device(), dev_stk6a54_initialize_device(), dev_stk6a54_sensor_settings(), dev_stka311_camera_asleep(), dev_stka311_configure_device(), dev_stka311_init_camera(), dev_stka311_initialize_device(), dev_stka311_sensor_settings(), dev_stka311_start_stream(), dev_stka311_stop_stream(), dev_stka821_camera_asleep(), dev_stka821_camera_settings(), dev_stka821_configure_device(), dev_stka821_initialize_device(), dev_stka821_sensor_settings(), dev_stka821_set_camera_quality(), dev_stka821_start_stream(), and dev_stka821_stop_stream().

int usb_stk11xx_set_configuration ( struct usb_stk11xx *  dev  ) 

Send the message SET_CONFIGURATION.

Parameters:
dev Device structure
Returns:
0 if all is OK
This function permits to send the message SET_CONFIGURATION on the USB bus.

Definition at line 510 of file stk11xx-usb.c.

References STK_DEBUG, and STK_ERROR.

int usb_stk11xx_set_feature ( struct usb_stk11xx *  dev,
int  index 
)

Send the message SET_FEATURE and choose the interface.

Parameters:
dev Device structure
index Choice of the interface
Returns:
0 if all is OK
This function permits to send the message SET_FEATURE on the USB bus.

Definition at line 478 of file stk11xx-usb.c.

References STK_DEBUG, and STK_ERROR.

Referenced by dev_stk6a31_init_camera(), dev_stk6a31_initialize_device(), dev_stk6a33_init_camera(), dev_stk6a33_initialize_device(), dev_stk6a51_init_camera(), dev_stk6a51_initialize_device(), dev_stk6a54_initialize_device(), dev_stka311_init_camera(), dev_stka311_initialize_device(), dev_stka821_init_camera(), and dev_stka821_initialize_device().

int usb_stk11xx_write_registry ( struct usb_stk11xx *  dev,
__u16  index,
__u16  value 
)

Write a 16-bits value to a 16-bits register.

Parameters:
dev 
index 
value 
Returns:
0 if all is OK
This function permits to write a 16-bits value to a 16-bits register on the USB bus.

Definition at line 544 of file stk11xx-usb.c.

References STK_ERROR.

Referenced by dev_stk6a31_camera_asleep(), dev_stk6a31_camera_settings(), dev_stk6a31_configure_device(), dev_stk6a31_init_camera(), dev_stk6a31_initialize_device(), dev_stk6a31_sensor_settings(), dev_stk6a31_set_camera_quality(), dev_stk6a31_start_stream(), dev_stk6a33_camera_asleep(), dev_stk6a33_camera_settings(), dev_stk6a33_configure_device(), dev_stk6a33_init_camera(), dev_stk6a33_initialize_device(), dev_stk6a33_sensor_settings(), dev_stk6a33_set_camera_quality(), dev_stk6a33_start_stream(), dev_stk6a33_stop_stream(), dev_stk6a51_camera_asleep(), dev_stk6a51_configure_device(), dev_stk6a51_init_camera(), dev_stk6a51_initialize_device(), dev_stk6a51_sensor_settings(), dev_stk6a51_set_camera_quality(), dev_stk6a51_start_stream(), dev_stk6a54_camera_asleep(), dev_stk6a54_configure_device(), dev_stk6a54_initialize_device(), dev_stk6a54_sensor_settings(), dev_stka311_camera_asleep(), dev_stka311_configure_device(), dev_stka311_init_camera(), dev_stka311_initialize_device(), dev_stka311_sensor_settings(), dev_stka311_set_camera_fps(), dev_stka311_set_camera_quality(), dev_stka311_start_stream(), dev_stka311_stop_stream(), dev_stka821_camera_asleep(), dev_stka821_camera_settings(), dev_stka821_configure_device(), dev_stka821_init_camera(), dev_stka821_initialize_device(), dev_stka821_sensor_settings(), dev_stka821_set_camera_quality(), dev_stka821_start_stream(), and dev_stka821_stop_stream().


Variable Documentation

brightness = -1 [static]

Module parameter to set the brightness

Definition at line 961 of file stk11xx-usb.c.

colour = -1 [static]

Module parameter to set the colour

Definition at line 979 of file stk11xx-usb.c.

contrast = -1 [static]

Module parameter to set the contrast

Definition at line 973 of file stk11xx-usb.c.

default_brightness = -1 [static]

Set brightness

Definition at line 73 of file stk11xx-usb.c.

Referenced by usb_stk11xx_default_settings(), and usb_stk11xx_init().

default_colour = -1 [static]

Set colour

Definition at line 91 of file stk11xx-usb.c.

Referenced by usb_stk11xx_default_settings(), and usb_stk11xx_init().

default_contrast = -1 [static]

Set contrast

Definition at line 85 of file stk11xx-usb.c.

Referenced by usb_stk11xx_default_settings(), and usb_stk11xx_init().

default_fps = -1 [static]

Number of frame per second by default

Definition at line 55 of file stk11xx-usb.c.

Referenced by usb_stk11xx_default_settings(), and usb_stk11xx_init().

default_hflip = -1 [static]

Enable / Disable horizontal flip image

Definition at line 61 of file stk11xx-usb.c.

Referenced by usb_stk11xx_default_settings(), and usb_stk11xx_init().

default_vflip = -1 [static]

Enable / Disable vertical flip image

Definition at line 67 of file stk11xx-usb.c.

Referenced by usb_stk11xx_default_settings(), and usb_stk11xx_init().

default_whiteness = -1 [static]

Set whiteness

Definition at line 79 of file stk11xx-usb.c.

Referenced by usb_stk11xx_default_settings(), and usb_stk11xx_init().

fps [static]

Module parameter to set frame per second

Definition at line 943 of file stk11xx-usb.c.

hflip = -1 [static]

Module parameter to enable/disable the horizontal flip process

Definition at line 949 of file stk11xx-usb.c.

stk11xx_table [static]

Initial value:

Define all the hotplug supported devices by this driver

Definition at line 98 of file stk11xx-usb.c.

Initial value:

 {
    .name = "stk11xx",
    .probe = usb_stk11xx_probe,
    .disconnect = usb_stk11xx_disconnect,
    .id_table = stk11xx_table,
}
This variable contains some callback

Definition at line 931 of file stk11xx-usb.c.

vflip = -1 [static]

Module parameter to enable/disable the vertical flip process

Definition at line 955 of file stk11xx-usb.c.

whiteness = -1 [static]

Module parameter to set the whiteness

Definition at line 967 of file stk11xx-usb.c.


Generated on Sun Sep 20 12:18:50 2009 for SyntekUSBVideoCamera by  doxygen 1.5.9