Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
s2255drv.c File Reference
#include <linux/module.h>
#include <linux/firmware.h>
#include <linux/kernel.h>
#include <linux/mutex.h>
#include <linux/slab.h>
#include <linux/videodev2.h>
#include <linux/mm.h>
#include <media/videobuf-vmalloc.h>
#include <media/v4l2-common.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ioctl.h>
#include <linux/vmalloc.h>
#include <linux/usb.h>

Go to the source code of this file.

Data Structures

struct  s2255_mode
 
struct  s2255_framei
 
struct  s2255_bufferi
 
struct  s2255_dmaqueue
 
struct  s2255_fw
 
struct  s2255_pipeinfo
 
struct  s2255_channel
 
struct  s2255_dev
 
struct  s2255_fmt
 
struct  s2255_buffer
 
struct  s2255_fh
 

Macros

#define S2255_VERSION   "1.22.1"
 
#define FIRMWARE_FILE_NAME   "f2255usb.bin"
 
#define S2255_DEF_JPEG_QUAL   50
 
#define S2255_VR_IN   0
 
#define S2255_VR_OUT   1
 
#define S2255_VR_FW   0x30
 
#define S2255_CONFIG_EP   2
 
#define S2255_DSP_BOOTTIME   800
 
#define S2255_LOAD_TIMEOUT   (5000 + S2255_DSP_BOOTTIME)
 
#define S2255_DEF_BUFS   16
 
#define S2255_SETMODE_TIMEOUT   500
 
#define S2255_VIDSTATUS_TIMEOUT   350
 
#define S2255_MARKER_FRAME   cpu_to_le32(0x2255DA4AL)
 
#define S2255_MARKER_RESPONSE   cpu_to_le32(0x2255ACACL)
 
#define S2255_RESPONSE_SETMODE   cpu_to_le32(0x01)
 
#define S2255_RESPONSE_FW   cpu_to_le32(0x10)
 
#define S2255_RESPONSE_STATUS   cpu_to_le32(0x20)
 
#define S2255_USB_XFER_SIZE   (16 * 1024)
 
#define MAX_CHANNELS   4
 
#define SYS_FRAMES   4
 
#define SYS_FRAMES_MAXSIZE   (720*288*2*2 + 4096)
 
#define DEF_USB_BLOCK   S2255_USB_XFER_SIZE
 
#define LINE_SZ_4CIFS_NTSC   640
 
#define LINE_SZ_2CIFS_NTSC   640
 
#define LINE_SZ_1CIFS_NTSC   320
 
#define LINE_SZ_4CIFS_PAL   704
 
#define LINE_SZ_2CIFS_PAL   704
 
#define LINE_SZ_1CIFS_PAL   352
 
#define NUM_LINES_4CIFS_NTSC   240
 
#define NUM_LINES_2CIFS_NTSC   240
 
#define NUM_LINES_1CIFS_NTSC   240
 
#define NUM_LINES_4CIFS_PAL   288
 
#define NUM_LINES_2CIFS_PAL   288
 
#define NUM_LINES_1CIFS_PAL   288
 
#define LINE_SZ_DEF   640
 
#define NUM_LINES_DEF   240
 
#define FORMAT_NTSC   1
 
#define FORMAT_PAL   2
 
#define SCALE_4CIFS   1 /* 640x480(NTSC) or 704x576(PAL) */
 
#define SCALE_2CIFS   2 /* 640x240(NTSC) or 704x288(PAL) */
 
#define SCALE_1CIFS   3 /* 320x240(NTSC) or 352x288(PAL) */
 
#define SCALE_4CIFSI   4 /* 640x480(NTSC) or 704x576(PAL) high quality */
 
#define COLOR_YUVPL   1 /* YUV planar */
 
#define COLOR_YUVPK   2 /* YUV packed */
 
#define COLOR_Y8   4 /* monochrome */
 
#define COLOR_JPG   5 /* JPEG */
 
#define MASK_COLOR   0x000000ff
 
#define MASK_JPG_QUALITY   0x0000ff00
 
#define MASK_INPUT_TYPE   0x000f0000
 
#define FDEC_1   1 /* capture every frame. default */
 
#define FDEC_2   2 /* capture every 2nd frame */
 
#define FDEC_3   3 /* capture every 3rd frame */
 
#define FDEC_5   5 /* capture every 5th frame */
 
#define DEF_SCALE   SCALE_4CIFS
 
#define DEF_COLOR   COLOR_YUVPL
 
#define DEF_FDEC   FDEC_1
 
#define DEF_BRIGHT   0
 
#define DEF_CONTRAST   0x5c
 
#define DEF_SATURATION   0x80
 
#define DEF_HUE   0
 
#define IN_DATA_TOKEN   cpu_to_le32(0x2255c0de)
 
#define CMD_2255   0xc2255000
 
#define CMD_SET_MODE   cpu_to_le32((CMD_2255 | 0x10))
 
#define CMD_START   cpu_to_le32((CMD_2255 | 0x20))
 
#define CMD_STOP   cpu_to_le32((CMD_2255 | 0x30))
 
#define CMD_STATUS   cpu_to_le32((CMD_2255 | 0x40))
 
#define S2255_READ_IDLE   0
 
#define S2255_READ_FRAME   1
 
#define DEF_MODEI_NTSC_CONT
 
#define S2255_FW_NOTLOADED   0
 
#define S2255_FW_LOADED_DSPWAIT   1
 
#define S2255_FW_SUCCESS   2
 
#define S2255_FW_FAILED   3
 
#define S2255_FW_DISCONNECTING   4
 
#define S2255_FW_MARKER   cpu_to_le32(0x22552f2f)
 
#define S2255_READ_IDLE   0
 
#define S2255_READ_FRAME   1
 
#define S2255_CUR_USB_FWVER   ((3 << 8) | 12)
 
#define S2255_CUR_DSP_FWVER   10104
 
#define S2255_MIN_DSP_STATUS   5
 
#define S2255_MIN_DSP_COLORFILTER   8
 
#define S2255_NORMS   (V4L2_STD_PAL | V4L2_STD_NTSC)
 
#define S2255_V4L2_YC_ON   1
 
#define S2255_V4L2_YC_OFF   0
 
#define V4L2_CID_PRIVATE_COLORFILTER   (V4L2_CID_PRIVATE_BASE + 0)
 
#define PREFIX_SIZE   512
 
#define S2255_DRIVER_NAME   "s2255"
 
#define s2255_dev_err(dev, fmt, arg...)   dev_err(dev, S2255_DRIVER_NAME " - " fmt, ##arg)
 
#define dprintk(level, fmt, arg...)
 
#define USB_SENSORAY_VID   0x1943
 
#define BUFFER_TIMEOUT   msecs_to_jiffies(400)
 
#define CHUNK_SIZE   512
 
#define NUM_FRAME_ENUMS   4
 

Functions

 module_param (debug, int, 0644)
 
 MODULE_PARM_DESC (debug,"Debug level(0-100) default 0")
 
 module_param (vid_limit, int, 0644)
 
 MODULE_PARM_DESC (vid_limit,"video memory limit(Mb)")
 
 module_param (video_nr, int, 0644)
 
 MODULE_PARM_DESC (video_nr,"start video minor(-1 default autodetect)")
 
 module_param (jpeg_enable, int, 0644)
 
 MODULE_PARM_DESC (jpeg_enable,"Jpeg enable(1-on 0-off) default 1")
 
 MODULE_DEVICE_TABLE (usb, s2255_table)
 
 module_usb_driver (s2255_driver)
 
 MODULE_DESCRIPTION ("Sensoray 2255 Video for Linux driver")
 
 MODULE_AUTHOR ("Dean Anderson (Sensoray Company Inc.)")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_VERSION (S2255_VERSION)
 
 MODULE_FIRMWARE (FIRMWARE_FILE_NAME)
 

Macro Definition Documentation

#define BUFFER_TIMEOUT   msecs_to_jiffies(400)

Definition at line 406 of file s2255drv.c.

#define CHUNK_SIZE   512
#define CMD_2255   0xc2255000

Definition at line 137 of file s2255drv.c.

#define CMD_SET_MODE   cpu_to_le32((CMD_2255 | 0x10))

Definition at line 138 of file s2255drv.c.

#define CMD_START   cpu_to_le32((CMD_2255 | 0x20))

Definition at line 139 of file s2255drv.c.

#define CMD_STATUS   cpu_to_le32((CMD_2255 | 0x40))

Definition at line 141 of file s2255drv.c.

#define CMD_STOP   cpu_to_le32((CMD_2255 | 0x30))

Definition at line 140 of file s2255drv.c.

#define COLOR_JPG   5 /* JPEG */

Definition at line 113 of file s2255drv.c.

#define COLOR_Y8   4 /* monochrome */

Definition at line 112 of file s2255drv.c.

#define COLOR_YUVPK   2 /* YUV packed */

Definition at line 111 of file s2255drv.c.

#define COLOR_YUVPL   1 /* YUV planar */

Definition at line 110 of file s2255drv.c.

#define DEF_BRIGHT   0

Definition at line 130 of file s2255drv.c.

#define DEF_COLOR   COLOR_YUVPL

Definition at line 128 of file s2255drv.c.

#define DEF_CONTRAST   0x5c

Definition at line 131 of file s2255drv.c.

#define DEF_FDEC   FDEC_1

Definition at line 129 of file s2255drv.c.

#define DEF_HUE   0

Definition at line 133 of file s2255drv.c.

#define DEF_MODEI_NTSC_CONT
Value:

Definition at line 175 of file s2255drv.c.

#define DEF_SATURATION   0x80

Definition at line 132 of file s2255drv.c.

#define DEF_SCALE   SCALE_4CIFS

Definition at line 127 of file s2255drv.c.

#define DEF_USB_BLOCK   S2255_USB_XFER_SIZE

Definition at line 83 of file s2255drv.c.

#define dprintk (   level,
  fmt,
  arg... 
)
Value:
do { \
if (*s2255_debug >= (level)) { \
": " fmt, ##arg); \
} \
} while (0)

Definition at line 369 of file s2255drv.c.

#define FDEC_1   1 /* capture every frame. default */

Definition at line 119 of file s2255drv.c.

#define FDEC_2   2 /* capture every 2nd frame */

Definition at line 120 of file s2255drv.c.

#define FDEC_3   3 /* capture every 3rd frame */

Definition at line 121 of file s2255drv.c.

#define FDEC_5   5 /* capture every 5th frame */

Definition at line 122 of file s2255drv.c.

#define FIRMWARE_FILE_NAME   "f2255usb.bin"

Definition at line 54 of file s2255drv.c.

#define FORMAT_NTSC   1

Definition at line 101 of file s2255drv.c.

#define FORMAT_PAL   2

Definition at line 102 of file s2255drv.c.

#define IN_DATA_TOKEN   cpu_to_le32(0x2255c0de)

Definition at line 136 of file s2255drv.c.

#define LINE_SZ_1CIFS_NTSC   320

Definition at line 86 of file s2255drv.c.

#define LINE_SZ_1CIFS_PAL   352

Definition at line 89 of file s2255drv.c.

#define LINE_SZ_2CIFS_NTSC   640

Definition at line 85 of file s2255drv.c.

#define LINE_SZ_2CIFS_PAL   704

Definition at line 88 of file s2255drv.c.

#define LINE_SZ_4CIFS_NTSC   640

Definition at line 84 of file s2255drv.c.

#define LINE_SZ_4CIFS_PAL   704

Definition at line 87 of file s2255drv.c.

#define LINE_SZ_DEF   640

Definition at line 96 of file s2255drv.c.

#define MASK_COLOR   0x000000ff

Definition at line 115 of file s2255drv.c.

#define MASK_INPUT_TYPE   0x000f0000

Definition at line 117 of file s2255drv.c.

#define MASK_JPG_QUALITY   0x0000ff00

Definition at line 116 of file s2255drv.c.

#define MAX_CHANNELS   4

Definition at line 79 of file s2255drv.c.

#define NUM_FRAME_ENUMS   4
#define NUM_LINES_1CIFS_NTSC   240

Definition at line 92 of file s2255drv.c.

#define NUM_LINES_1CIFS_PAL   288

Definition at line 95 of file s2255drv.c.

#define NUM_LINES_2CIFS_NTSC   240

Definition at line 91 of file s2255drv.c.

#define NUM_LINES_2CIFS_PAL   288

Definition at line 94 of file s2255drv.c.

#define NUM_LINES_4CIFS_NTSC   240

Definition at line 90 of file s2255drv.c.

#define NUM_LINES_4CIFS_PAL   288

Definition at line 93 of file s2255drv.c.

#define NUM_LINES_DEF   240

Definition at line 97 of file s2255drv.c.

#define PREFIX_SIZE   512

Definition at line 342 of file s2255drv.c.

#define S2255_CONFIG_EP   2

Definition at line 65 of file s2255drv.c.

#define S2255_CUR_DSP_FWVER   10104

Definition at line 305 of file s2255drv.c.

#define S2255_CUR_USB_FWVER   ((3 << 8) | 12)

Definition at line 303 of file s2255drv.c.

#define S2255_DEF_BUFS   16

Definition at line 70 of file s2255drv.c.

#define S2255_DEF_JPEG_QUAL   50

Definition at line 57 of file s2255drv.c.

#define s2255_dev_err (   dev,
  fmt,
  arg... 
)    dev_err(dev, S2255_DRIVER_NAME " - " fmt, ##arg)

Definition at line 366 of file s2255drv.c.

#define S2255_DRIVER_NAME   "s2255"

Definition at line 365 of file s2255drv.c.

#define S2255_DSP_BOOTTIME   800

Definition at line 67 of file s2255drv.c.

#define S2255_FW_DISCONNECTING   4

Definition at line 189 of file s2255drv.c.

#define S2255_FW_FAILED   3

Definition at line 188 of file s2255drv.c.

#define S2255_FW_LOADED_DSPWAIT   1

Definition at line 186 of file s2255drv.c.

#define S2255_FW_MARKER   cpu_to_le32(0x22552f2f)

Definition at line 190 of file s2255drv.c.

#define S2255_FW_NOTLOADED   0

Definition at line 185 of file s2255drv.c.

#define S2255_FW_SUCCESS   2

Definition at line 187 of file s2255drv.c.

#define S2255_LOAD_TIMEOUT   (5000 + S2255_DSP_BOOTTIME)

Definition at line 69 of file s2255drv.c.

#define S2255_MARKER_FRAME   cpu_to_le32(0x2255DA4AL)

Definition at line 73 of file s2255drv.c.

#define S2255_MARKER_RESPONSE   cpu_to_le32(0x2255ACACL)

Definition at line 74 of file s2255drv.c.

#define S2255_MIN_DSP_COLORFILTER   8

Definition at line 308 of file s2255drv.c.

#define S2255_MIN_DSP_STATUS   5

Definition at line 307 of file s2255drv.c.

#define S2255_NORMS   (V4L2_STD_PAL | V4L2_STD_NTSC)

Definition at line 309 of file s2255drv.c.

#define S2255_READ_FRAME   1

Definition at line 193 of file s2255drv.c.

#define S2255_READ_FRAME   1

Definition at line 193 of file s2255drv.c.

#define S2255_READ_IDLE   0

Definition at line 192 of file s2255drv.c.

#define S2255_READ_IDLE   0

Definition at line 192 of file s2255drv.c.

#define S2255_RESPONSE_FW   cpu_to_le32(0x10)

Definition at line 76 of file s2255drv.c.

#define S2255_RESPONSE_SETMODE   cpu_to_le32(0x01)

Definition at line 75 of file s2255drv.c.

#define S2255_RESPONSE_STATUS   cpu_to_le32(0x20)

Definition at line 77 of file s2255drv.c.

#define S2255_SETMODE_TIMEOUT   500

Definition at line 71 of file s2255drv.c.

#define S2255_USB_XFER_SIZE   (16 * 1024)

Definition at line 78 of file s2255drv.c.

#define S2255_V4L2_YC_OFF   0

Definition at line 338 of file s2255drv.c.

#define S2255_V4L2_YC_ON   1

Definition at line 337 of file s2255drv.c.

#define S2255_VERSION   "1.22.1"

Definition at line 53 of file s2255drv.c.

#define S2255_VIDSTATUS_TIMEOUT   350

Definition at line 72 of file s2255drv.c.

#define S2255_VR_FW   0x30

Definition at line 63 of file s2255drv.c.

#define S2255_VR_IN   0

Definition at line 59 of file s2255drv.c.

#define S2255_VR_OUT   1

Definition at line 61 of file s2255drv.c.

#define SCALE_1CIFS   3 /* 320x240(NTSC) or 352x288(PAL) */

Definition at line 106 of file s2255drv.c.

#define SCALE_2CIFS   2 /* 640x240(NTSC) or 704x288(PAL) */

Definition at line 105 of file s2255drv.c.

#define SCALE_4CIFS   1 /* 640x480(NTSC) or 704x576(PAL) */

Definition at line 104 of file s2255drv.c.

#define SCALE_4CIFSI   4 /* 640x480(NTSC) or 704x576(PAL) high quality */

Definition at line 108 of file s2255drv.c.

#define SYS_FRAMES   4

Definition at line 80 of file s2255drv.c.

#define SYS_FRAMES_MAXSIZE   (720*288*2*2 + 4096)

Definition at line 82 of file s2255drv.c.

#define USB_SENSORAY_VID   0x1943

Definition at line 398 of file s2255drv.c.

#define V4L2_CID_PRIVATE_COLORFILTER   (V4L2_CID_PRIVATE_BASE + 0)

Definition at line 339 of file s2255drv.c.

Function Documentation

MODULE_AUTHOR ( "Dean Anderson (Sensoray Company Inc.)"  )
MODULE_DESCRIPTION ( "Sensoray 2255 Video for Linux driver )
MODULE_DEVICE_TABLE ( usb  ,
s2255_table   
)
MODULE_FIRMWARE ( FIRMWARE_FILE_NAME  )
MODULE_LICENSE ( "GPL"  )
module_param ( debug  ,
int  ,
0644   
)
module_param ( vid_limit  ,
int  ,
0644   
)
module_param ( video_nr  ,
int  ,
0644   
)
module_param ( jpeg_enable  ,
int  ,
0644   
)
MODULE_PARM_DESC ( debug  ,
"Debug level(0-100) default 0"   
)
MODULE_PARM_DESC ( vid_limit  ,
"video memory limit(Mb)"   
)
MODULE_PARM_DESC ( video_nr  ,
"start video minor(-1 default autodetect)"   
)
MODULE_PARM_DESC ( jpeg_enable  ,
"Jpeg enable(1-on 0-off) default 1"   
)
module_usb_driver ( s2255_driver  )
MODULE_VERSION ( S2255_VERSION  )