#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. | |
| 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 |
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 int usb_stk11xx_default_settings | ( | struct usb_stk11xx * | dev | ) | [static] |
Set the default value about the video settings.
| dev |
Definition at line 606 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.
| interface |
Definition at line 904 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 1142 of file stk11xx-usb.c.
References STK_INFO, and usb_stk11xx_driver.
| static int __init usb_stk11xx_init | ( | void | ) | [static] |
Initialize the driver.
Definition at line 1065 of file stk11xx-usb.c.
References brightness, colour, contrast, default_brightness, default_colour, default_contrast, default_fps, default_hflip, default_vflip, default_whiteness, DRIVER_DESC, DRIVER_VERSION, fps, hflip, STK_DEBUG, STK_ERROR, STK_INFO, usb_stk11xx_driver, vflip, and whiteness.
| void usb_stk11xx_isoc_cleanup | ( | struct usb_stk11xx * | dev | ) |
Clean-up all the ISOC buffers.
| dev | Device structure |
Definition at line 431 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 |
Definition at line 243 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.
| dev | Device structure |
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] |
Load the driver.
| interface | ||
| id |
Definition at line 676 of file stk11xx-usb.c.
References dev_stk11xx_camera_off(), dev_stk11xx_camera_on(), dev_stk11xx_initialize_device(), stk11xx_create_sysfs_files(), STK11XX_SXGA, STK11XX_VGA, STK_DEBUG, STK_ERROR, STK_INFO, usb_stk11xx_default_settings(), 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_SYNTEK1_VENDOR_ID, USB_SYNTEK2_VENDOR_ID, and v4l_stk11xx_register_video_device().
| 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 |
Definition at line 572 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_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 |
Definition at line 506 of file stk11xx-usb.c.
| 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 |
Definition at line 474 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_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 |
Definition at line 540 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_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().
brightness = -1 [static] |
Module parameter to set the brightness
Definition at line 1026 of file stk11xx-usb.c.
Referenced by usb_stk11xx_init().
colour = -1 [static] |
Module parameter to set the colour
Definition at line 1044 of file stk11xx-usb.c.
Referenced by usb_stk11xx_init().
contrast = -1 [static] |
Module parameter to set the contrast
Definition at line 1038 of file stk11xx-usb.c.
Referenced by usb_stk11xx_init().
default_brightness = -1 [static] |
Set brightness
Definition at line 72 of file stk11xx-usb.c.
Referenced by usb_stk11xx_default_settings(), and usb_stk11xx_init().
default_colour = -1 [static] |
Set colour
Definition at line 90 of file stk11xx-usb.c.
Referenced by usb_stk11xx_default_settings(), and usb_stk11xx_init().
default_contrast = -1 [static] |
Set contrast
Definition at line 84 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 54 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 60 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 66 of file stk11xx-usb.c.
Referenced by usb_stk11xx_default_settings(), and usb_stk11xx_init().
default_whiteness = -1 [static] |
Set whiteness
Definition at line 78 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 1008 of file stk11xx-usb.c.
Referenced by usb_stk11xx_init().
hflip = -1 [static] |
Module parameter to enable/disable the horizontal flip process
Definition at line 1014 of file stk11xx-usb.c.
Referenced by usb_stk11xx_init().
stk11xx_table [static] |
Initial value:
{
{ USB_DEVICE(USB_SYNTEK1_VENDOR_ID, USB_STK_A311_PRODUCT_ID) },
{ USB_DEVICE(USB_SYNTEK1_VENDOR_ID, USB_STK_A821_PRODUCT_ID) },
{ USB_DEVICE(USB_SYNTEK1_VENDOR_ID, USB_STK_6A31_PRODUCT_ID) },
{ USB_DEVICE(USB_SYNTEK1_VENDOR_ID, USB_STK_6A33_PRODUCT_ID) },
{ USB_DEVICE(USB_SYNTEK1_VENDOR_ID, USB_STK_6A51_PRODUCT_ID) },
{ USB_DEVICE(USB_SYNTEK1_VENDOR_ID, USB_STK_6A54_PRODUCT_ID) },
{ USB_DEVICE(USB_SYNTEK1_VENDOR_ID, USB_STK_6D51_PRODUCT_ID) },
{ USB_DEVICE(USB_SYNTEK2_VENDOR_ID, USB_STK_0501_PRODUCT_ID) },
{ }
}
Definition at line 97 of file stk11xx-usb.c.
usb_stk11xx_driver [static] |
Initial value:
{
.name = "usb_stk11xx_driver",
.probe = usb_stk11xx_probe,
.disconnect = usb_stk11xx_disconnect,
.id_table = stk11xx_table,
}
Definition at line 994 of file stk11xx-usb.c.
Referenced by usb_stk11xx_exit(), and usb_stk11xx_init().
vflip = -1 [static] |
Module parameter to enable/disable the vertical flip process
Definition at line 1020 of file stk11xx-usb.c.
Referenced by usb_stk11xx_init().
whiteness = -1 [static] |
Module parameter to set the whiteness
Definition at line 1032 of file stk11xx-usb.c.
Referenced by usb_stk11xx_init().
1.5.9