SyntekUSBVideoCamera
|
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 <media/v4l2-ioctl.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. More... | |
void | usb_stk11xx_isoc_handler (struct urb *urb) |
ISOC handler. More... | |
void | usb_stk11xx_isoc_cleanup (struct usb_stk11xx *dev) |
Clean-up all the ISOC buffers. More... | |
int | usb_stk11xx_set_feature (struct usb_stk11xx *dev, int index) |
Send the message SET_FEATURE and choose the interface. More... | |
int | usb_stk11xx_set_configuration (struct usb_stk11xx *dev) |
Send the message SET_CONFIGURATION. More... | |
int | usb_stk11xx_write_registry (struct usb_stk11xx *dev, __u16 index, __u16 value) |
Write a 16-bits value to a 16-bits register. More... | |
int | usb_stk11xx_read_registry (struct usb_stk11xx *dev, __u16 index, int *value) |
Read a 16-bits value from a 16-bits register. More... | |
static int | usb_stk11xx_default_settings (struct usb_stk11xx *dev) |
Set the default value about the video settings. More... | |
static int | usb_stk11xx_probe (struct usb_interface *interface, const struct usb_device_id *id) |
Load the driver. More... | |
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. More... | |
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. | |
module_param (norm, int, 0444) | |
Module norm. | |
static int __init | usb_stk11xx_init (void) |
Initialize the driver. More... | |
static void __exit | usb_stk11xx_exit (void) |
Close the driver. More... | |
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_PARM_DESC (norm,"Norm setting (0=NTSC, 1=PAL)") | |
Description of 'default_norm' 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. | |
MODULE_VERSION (DRIVER_VERSION) | |
Define the version of the driver. | |
MODULE_INFO (url, DRIVER_URL) | |
Driver homepage URL. | |
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 int | default_norm = -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 |
static int | norm = -1 |
Driver for Syntek USB video camera.
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
Definition in file stk11xx-usb.c.
MODULE_DEVICE_TABLE | ( | usb | , |
stk11xx_table | |||
) |
Define the supported devices
|
static |
Set the default value about the video settings.
dev |
This function permits to set the video settings for each video camera model.
Definition at line 624 of file stk11xx-usb.c.
References stk11xx_video::brightness, stk11xx_video::colour, stk11xx_video::contrast, default_brightness, default_colour, default_contrast, default_fps, default_hflip, default_norm, default_vflip, default_whiteness, stk11xx_video::fps, stk11xx_video::hflip, stk11xx_video::input, stk11xx_video::norm, STK11XX_PERCENT, stk11xx_video::vflip, usb_stk11xx::vsettings, usb_stk11xx::webcam_model, and stk11xx_video::whiteness.
Referenced by usb_stk11xx_probe().
|
static |
This function is called when the device is disconnected or when the kernel module is unloaded.
interface |
Definition at line 973 of file stk11xx-usb.c.
References stk11xx_remove_sysfs_files(), STK_INFO, v4l_stk11xx_unregister_video_device(), usb_stk11xx::vdev, usb_stk11xx::vopen, and usb_stk11xx::wait_frame.
|
static |
Close the driver.
This function is called at last when you unload the driver.
Definition at line 1226 of file stk11xx-usb.c.
References brightness, colour, contrast, DRIVER_AUTHOR, DRIVER_DESC, DRIVER_SUPPORT, DRIVER_URL, DRIVER_VERSION, fps, hflip, MODULE_AUTHOR(), MODULE_DESCRIPTION(), module_exit(), MODULE_INFO(), module_init(), MODULE_LICENSE(), MODULE_PARM_DESC(), MODULE_SUPPORTED_DEVICE(), MODULE_VERSION(), norm, STK_INFO, usb_stk11xx_driver, usb_stk11xx_init(), vflip, and whiteness.
|
static |
Initialize the driver.
This function is called at first. This function permits to define the default values from the command line.
Definition at line 1143 of file stk11xx-usb.c.
References brightness, colour, contrast, default_brightness, default_colour, default_contrast, default_fps, default_hflip, default_norm, default_vflip, default_whiteness, DRIVER_AUTHOR, DRIVER_DESC, DRIVER_URL, DRIVER_VERSION, DRIVER_YEAR, fps, hflip, norm, STK_DEBUG, STK_ERROR, STK_INFO, usb_stk11xx_driver, vflip, and whiteness.
Referenced by usb_stk11xx_exit().
void usb_stk11xx_isoc_cleanup | ( | struct usb_stk11xx * | dev | ) |
Clean-up all the ISOC buffers.
dev | Device structure |
This function permits to clean-up all the ISOC buffers.
Definition at line 449 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.
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 252 of file stk11xx-usb.c.
References stk11xx_next_frame(), STK_DEBUG, STK_ERROR, STK_STREAM, usb_stk11xx::udev, usb_stk11xx::vframes_dumped, usb_stk11xx::vframes_error, usb_stk11xx::visoc_errors, and usb_stk11xx::wait_frame.
Referenced by usb_stk11xx_isoc_init().
int usb_stk11xx_isoc_init | ( | struct usb_stk11xx * | dev | ) |
Initilize an isochronous pipe.
dev | Device structure |
This function permits to initialize an URB transfert (or isochronous pipe).
Definition at line 133 of file stk11xx-usb.c.
References ISO_BUFFER_SIZE, ISO_FRAMES_PER_DESC, ISO_MAX_FRAME_SIZE, usb_stk11xx::isoc_in_endpointAddr, usb_stk11xx::isoc_in_size, MAX_ISO_BUFS, STK_DEBUG, STK_ERROR, usb_stk11xx::udev, and usb_stk11xx_isoc_handler().
Referenced by v4l_stk11xx_do_ioctl(), and v4l_stk11xx_open().
|
static |
Load the driver.
interface | |
id |
This function detects the device and allocate the buffers for the device and the video interface.
Definition at line 716 of file stk11xx-usb.c.
References dev_stk11xx_camera_off(), dev_stk11xx_camera_on(), dev_stk11xx_initialize_device(), usb_stk11xx::int_in_endpointAddr, usb_stk11xx::int_in_size, usb_stk11xx::interface, usb_stk11xx::isoc_in_endpointAddr, usb_stk11xx::isoc_in_size, usb_stk11xx::modlock, usb_stk11xx::mutex, usb_stk11xx::release, usb_stk11xx::spinlock, stk11xx_create_sysfs_files(), STK11XX_FRAME_SIZE, STK11XX_PAL, STK11XX_SXGA, STK11XX_VGA, STK_DEBUG, STK_ERROR, STK_INFO, usb_stk11xx::udev, usb_stk11xx_default_settings(), USB_STK_0408_PRODUCT_ID, USB_STK_0500_PRODUCT_ID, USB_STK_0501_PRODUCT_ID, USB_STK_6A31_PRODUCT_ID, USB_STK_6A33_PRODUCT_ID, USB_STK_6A51_PRODUCT_ID, USB_STK_6A54_PRODUCT_ID, USB_STK_6D51_PRODUCT_ID, USB_STK_A311_PRODUCT_ID, USB_STK_A821_PRODUCT_ID, USB_STK_AA11_PRODUCT_ID, USB_SYNTEK1_VENDOR_ID, USB_SYNTEK2_VENDOR_ID, v4l_stk11xx_register_video_device(), usb_stk11xx::vdev, usb_stk11xx::wait_frame, usb_stk11xx::webcam_model, and usb_stk11xx::webcam_type.
int usb_stk11xx_read_registry | ( | struct usb_stk11xx * | dev, |
__u16 | index, | ||
int * | value | ||
) |
Read a 16-bits value from a 16-bits register.
dev | |
index | |
value |
This function permits to read a 16-bits value from a 16-bits register on the USB bus.
Definition at line 590 of file stk11xx-usb.c.
References STK_ERROR, and usb_stk11xx::udev.
Referenced by dev_stk0408_camera_asleep(), dev_stk0408_configure_device(), dev_stk0408_init_camera(), dev_stk0408_initialize_device(), dev_stk0408_start_stream(), dev_stk0408_stop_stream(), dev_stk0500_camera_asleep(), dev_stk0500_configure_device(), dev_stk0500_sensor_settings(), dev_stk0500_set_camera_quality(), dev_stk0500_start_stream(), dev_stk0500_stop_stream(), 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_stk6d51_camera_asleep(), dev_stk6d51_configure_device(), dev_stk6d51_initialize_device(), dev_stk6d51_sensor_settings(), dev_stk6d51_set_camera_quality(), 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.
dev | Device structure |
This function permits to send the message SET_CONFIGURATION on the USB bus.
Definition at line 524 of file stk11xx-usb.c.
References STK_DEBUG, STK_ERROR, and usb_stk11xx::udev.
int usb_stk11xx_set_feature | ( | struct usb_stk11xx * | dev, |
int | index | ||
) |
Send the message SET_FEATURE and choose the interface.
dev | Device structure |
index | Choice of the interface |
This function permits to send the message SET_FEATURE on the USB bus.
Definition at line 492 of file stk11xx-usb.c.
References STK_DEBUG, STK_ERROR, and usb_stk11xx::udev.
Referenced by dev_stk0408_initialize_device(), dev_stk0500_init_camera(), dev_stk0500_initialize_device(), 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_stk6d51_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.
dev | |
index | |
value |
This function permits to write a 16-bits value to a 16-bits register on the USB bus.
Definition at line 558 of file stk11xx-usb.c.
References STK_ERROR, and usb_stk11xx::udev.
Referenced by dev_stk0408_camera_asleep(), dev_stk0408_configure_device(), dev_stk0408_initialize_device(), dev_stk0408_set_camera_quality(), dev_stk0408_start_stream(), dev_stk0408_stop_stream(), dev_stk0500_camera_asleep(), dev_stk0500_configure_device(), dev_stk0500_init_camera(), dev_stk0500_initialize_device(), dev_stk0500_sensor_settings(), dev_stk0500_set_camera_quality(), dev_stk0500_start_stream(), dev_stk0500_stop_stream(), 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_stk6d51_camera_asleep(), dev_stk6d51_configure_device(), dev_stk6d51_initialize_device(), dev_stk6d51_sensor_settings(), dev_stk6d51_set_camera_quality(), 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().
|
static |
Module parameter to set the brightness
Definition at line 1097 of file stk11xx-usb.c.
Referenced by stk11xx_correct_brightness(), store_vflip(), usb_stk11xx_exit(), and usb_stk11xx_init().
|
static |
Module parameter to set the colour
Definition at line 1115 of file stk11xx-usb.c.
Referenced by store_vflip(), usb_stk11xx_exit(), and usb_stk11xx_init().
|
static |
Module parameter to set the contrast
Definition at line 1109 of file stk11xx-usb.c.
Referenced by store_vflip(), usb_stk11xx_exit(), and usb_stk11xx_init().
|
static |
Set brightness
Definition at line 72 of file stk11xx-usb.c.
Referenced by usb_stk11xx_default_settings(), and usb_stk11xx_init().
|
static |
Set colour
Definition at line 90 of file stk11xx-usb.c.
Referenced by usb_stk11xx_default_settings(), and usb_stk11xx_init().
|
static |
Set contrast
Definition at line 84 of file stk11xx-usb.c.
Referenced by usb_stk11xx_default_settings(), and usb_stk11xx_init().
|
static |
Number of frame per second by default
Definition at line 54 of file stk11xx-usb.c.
Referenced by usb_stk11xx_default_settings(), and usb_stk11xx_init().
|
static |
Enable / Disable horizontal flip image
Definition at line 60 of file stk11xx-usb.c.
Referenced by usb_stk11xx_default_settings(), and usb_stk11xx_init().
|
static |
Set norm
Definition at line 96 of file stk11xx-usb.c.
Referenced by usb_stk11xx_default_settings(), and usb_stk11xx_init().
|
static |
Enable / Disable vertical flip image
Definition at line 66 of file stk11xx-usb.c.
Referenced by usb_stk11xx_default_settings(), and usb_stk11xx_init().
|
static |
Set whiteness
Definition at line 78 of file stk11xx-usb.c.
Referenced by usb_stk11xx_default_settings(), and usb_stk11xx_init().
|
static |
Module parameter to set frame per second
Definition at line 1079 of file stk11xx-usb.c.
Referenced by store_vflip(), usb_stk11xx_exit(), and usb_stk11xx_init().
|
static |
Module parameter to enable/disable the horizontal flip process
Definition at line 1085 of file stk11xx-usb.c.
Referenced by dev_stk0408_stop_stream(), store_vflip(), usb_stk11xx_exit(), and usb_stk11xx_init().
|
static |
Module parameter to set the norm
Definition at line 1121 of file stk11xx-usb.c.
Referenced by usb_stk11xx_exit(), and usb_stk11xx_init().
|
static |
Define all the hotplug supported devices by this driver
Definition at line 103 of file stk11xx-usb.c.
|
static |
This variable contains some callback
Definition at line 1065 of file stk11xx-usb.c.
Referenced by usb_stk11xx_exit(), and usb_stk11xx_init().
|
static |
Module parameter to enable/disable the vertical flip process
Definition at line 1091 of file stk11xx-usb.c.
Referenced by dev_stk0408_stop_stream(), store_vflip(), usb_stk11xx_exit(), and usb_stk11xx_init().
|
static |
Module parameter to set the whiteness
Definition at line 1103 of file stk11xx-usb.c.
Referenced by usb_stk11xx_exit(), and usb_stk11xx_init().