Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Enumerations | Functions | Variables
cx231xx-417.c File Reference
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/firmware.h>
#include <linux/vmalloc.h>
#include <media/v4l2-common.h>
#include <media/v4l2-ioctl.h>
#include <media/cx2341x.h>
#include <linux/usb.h>
#include "cx231xx.h"

Go to the source code of this file.

Macros

#define CX231xx_FIRM_IMAGE_SIZE   376836
 
#define CX231xx_FIRM_IMAGE_NAME   "v4l-cx23885-enc.fw"
 
#define ITVC_WRITE_DIR   0x03FDFC00
 
#define ITVC_READ_DIR   0x0001FC00
 
#define MCI_MEMORY_DATA_BYTE0   0x00
 
#define MCI_MEMORY_DATA_BYTE1   0x08
 
#define MCI_MEMORY_DATA_BYTE2   0x10
 
#define MCI_MEMORY_DATA_BYTE3   0x18
 
#define MCI_MEMORY_ADDRESS_BYTE2   0x20
 
#define MCI_MEMORY_ADDRESS_BYTE1   0x28
 
#define MCI_MEMORY_ADDRESS_BYTE0   0x30
 
#define MCI_REGISTER_DATA_BYTE0   0x40
 
#define MCI_REGISTER_DATA_BYTE1   0x48
 
#define MCI_REGISTER_DATA_BYTE2   0x50
 
#define MCI_REGISTER_DATA_BYTE3   0x58
 
#define MCI_REGISTER_ADDRESS_BYTE0   0x60
 
#define MCI_REGISTER_ADDRESS_BYTE1   0x68
 
#define MCI_REGISTER_MODE   0x70
 
#define MCI_MODE_REGISTER_READ   0x000
 
#define MCI_MODE_REGISTER_WRITE   0x100
 
#define MCI_MODE_MEMORY_READ   0x000
 
#define MCI_MODE_MEMORY_WRITE   0x4000
 
#define dprintk(level, fmt, arg...)
 
#define IVTV_CMD_HW_BLOCKS_RST   0xFFFFFFFF
 
#define IVTV_API_STD_TIMEOUT   500
 
#define IVTV_REG_ENC_SDRAM_REFRESH   (0x07F8)
 
#define IVTV_REG_ENC_SDRAM_PRECHARGE   (0x07FC)
 
#define IVTV_REG_SPU   (0x9050)
 
#define IVTV_REG_HW_BLOCKS   (0x9054)
 
#define IVTV_REG_VPU   (0x9058)
 
#define IVTV_REG_APU   (0xA064)
 
#define MC417_MIWR   0x8000
 
#define MC417_MIRD   0x4000
 
#define MC417_MICS   0x2000
 
#define MC417_MIRDY   0x1000
 
#define MC417_MIADDR   0x0F00
 
#define MC417_MIDATA   0x00FF
 
#define MC417_SPD_CTL(x)   (((x) << 4) & 0x00000030)
 
#define MC417_GPIO_SEL(x)   (((x) << 1) & 0x00000006)
 
#define MC417_UART_GPIO_EN   0x00000001
 
#define MC417_SPD_CTL_SLOW   0x1
 
#define MC417_SPD_CTL_MEDIUM   0x0
 
#define MC417_SPD_CTL_FAST   0x3 /* b'1x, but we use b'11 */
 
#define MC417_GPIO_SEL_GPIO3   0x3
 
#define MC417_GPIO_SEL_GPIO2   0x2
 
#define MC417_GPIO_SEL_GPIO1   0x1
 
#define MC417_GPIO_SEL_GPIO0   0x0
 
#define CX23417_GPIO_MASK   0xFC0003FF
 

Enumerations

enum  cx231xx_capture_type { CX231xx_MPEG_CAPTURE, CX231xx_RAW_CAPTURE, CX231xx_RAW_PASSTHRU_CAPTURE }
 
enum  cx231xx_capture_bits {
  CX231xx_RAW_BITS_NONE = 0x00, CX231xx_RAW_BITS_YUV_CAPTURE = 0x01, CX231xx_RAW_BITS_PCM_CAPTURE = 0x02, CX231xx_RAW_BITS_VBI_CAPTURE = 0x04,
  CX231xx_RAW_BITS_PASSTHRU_CAPTURE = 0x08, CX231xx_RAW_BITS_TO_HOST_CAPTURE = 0x10
}
 
enum  cx231xx_capture_end { CX231xx_END_AT_GOP, CX231xx_END_NOW }
 
enum  cx231xx_framerate { CX231xx_FRAMERATE_NTSC_30, CX231xx_FRAMERATE_PAL_25 }
 
enum  cx231xx_stream_port { CX231xx_OUTPUT_PORT_MEMORY, CX231xx_OUTPUT_PORT_STREAMING, CX231xx_OUTPUT_PORT_SERIAL }
 
enum  cx231xx_data_xfer_status { CX231xx_MORE_BUFFERS_FOLLOW, CX231xx_LAST_BUFFER }
 
enum  cx231xx_picture_mask { CX231xx_PICTURE_MASK_NONE, CX231xx_PICTURE_MASK_I_FRAMES, CX231xx_PICTURE_MASK_I_P_FRAMES = 0x3, CX231xx_PICTURE_MASK_ALL_FRAMES = 0x7 }
 
enum  cx231xx_vbi_mode_bits { CX231xx_VBI_BITS_SLICED, CX231xx_VBI_BITS_RAW }
 
enum  cx231xx_vbi_insertion_bits {
  CX231xx_VBI_BITS_INSERT_IN_XTENSION_USR_DATA, CX231xx_VBI_BITS_INSERT_IN_PRIVATE_PACKETS = 0x1 << 1, CX231xx_VBI_BITS_SEPARATE_STREAM = 0x2 << 1, CX231xx_VBI_BITS_SEPARATE_STREAM_USR_DATA = 0x4 << 1,
  CX231xx_VBI_BITS_SEPARATE_STREAM_PRV_DATA = 0x5 << 1
}
 
enum  cx231xx_dma_unit { CX231xx_DMA_BYTES, CX231xx_DMA_FRAMES }
 
enum  cx231xx_dma_transfer_status_bits { CX231xx_DMA_TRANSFER_BITS_DONE = 0x01, CX231xx_DMA_TRANSFER_BITS_ERROR = 0x04, CX231xx_DMA_TRANSFER_BITS_LL_ERROR = 0x10 }
 
enum  cx231xx_pause { CX231xx_PAUSE_ENCODING, CX231xx_RESUME_ENCODING }
 
enum  cx231xx_copyright { CX231xx_COPYRIGHT_OFF, CX231xx_COPYRIGHT_ON }
 
enum  cx231xx_notification_type { CX231xx_NOTIFICATION_REFRESH }
 
enum  cx231xx_notification_status { CX231xx_NOTIFICATION_OFF, CX231xx_NOTIFICATION_ON }
 
enum  cx231xx_notification_mailbox { CX231xx_NOTIFICATION_NO_MAILBOX = -1 }
 
enum  cx231xx_field1_lines { CX231xx_FIELD1_SAA7114 = 0x00EF, CX231xx_FIELD1_SAA7115 = 0x00F0, CX231xx_FIELD1_MICRONAS = 0x0105 }
 
enum  cx231xx_field2_lines { CX231xx_FIELD2_SAA7114 = 0x00EF, CX231xx_FIELD2_SAA7115 = 0x00F0, CX231xx_FIELD2_MICRONAS = 0x0106 }
 
enum  cx231xx_custom_data_type { CX231xx_CUSTOM_EXTENSION_USR_DATA, CX231xx_CUSTOM_PRIVATE_PACKET }
 
enum  cx231xx_mute { CX231xx_UNMUTE, CX231xx_MUTE }
 
enum  cx231xx_mute_video_mask { CX231xx_MUTE_VIDEO_V_MASK = 0x0000FF00, CX231xx_MUTE_VIDEO_U_MASK = 0x00FF0000, CX231xx_MUTE_VIDEO_Y_MASK = 0xFF000000 }
 
enum  cx231xx_mute_video_shift { CX231xx_MUTE_VIDEO_V_SHIFT = 8, CX231xx_MUTE_VIDEO_U_SHIFT = 16, CX231xx_MUTE_VIDEO_Y_SHIFT = 24 }
 

Functions

 module_param (mpegbufs, int, 0644)
 
 MODULE_PARM_DESC (mpegbufs,"number of mpeg buffers, range 2-32")
 
 module_param (mpeglines, int, 0644)
 
 MODULE_PARM_DESC (mpeglines,"number of lines in an MPEG buffer, range 2-32")
 
 module_param (mpeglinesize, int, 0644)
 
 MODULE_PARM_DESC (mpeglinesize,"number of bytes in each line of an MPEG buffer, range 512-1024")
 
 module_param (v4l_debug, int, 0644)
 
 MODULE_PARM_DESC (v4l_debug,"enable V4L debug messages")
 
void cx231xx_417_unregister (struct cx231xx *dev)
 
int cx231xx_417_register (struct cx231xx *dev)
 
 MODULE_FIRMWARE (CX231xx_FIRM_IMAGE_NAME)
 

Variables

struct cx231xx_dmaqueuedma_qq
 

Macro Definition Documentation

#define CX231xx_FIRM_IMAGE_NAME   "v4l-cx23885-enc.fw"

Definition at line 44 of file cx231xx-417.c.

#define CX231xx_FIRM_IMAGE_SIZE   376836

Definition at line 43 of file cx231xx-417.c.

#define CX23417_GPIO_MASK   0xFC0003FF

Definition at line 298 of file cx231xx-417.c.

#define dprintk (   level,
  fmt,
  arg... 
)
Value:
do { if (v4l_debug >= level) \
printk(KERN_INFO "%s: " fmt, \
(dev) ? dev->name : "cx231xx[?]", ## arg); \
} while (0)

Definition at line 90 of file cx231xx-417.c.

#define ITVC_READ_DIR   0x0001FC00

Definition at line 48 of file cx231xx-417.c.

#define ITVC_WRITE_DIR   0x03FDFC00

Definition at line 47 of file cx231xx-417.c.

#define IVTV_API_STD_TIMEOUT   500

Definition at line 241 of file cx231xx-417.c.

#define IVTV_CMD_HW_BLOCKS_RST   0xFFFFFFFF

Definition at line 238 of file cx231xx-417.c.

#define IVTV_REG_APU   (0xA064)

Definition at line 250 of file cx231xx-417.c.

#define IVTV_REG_ENC_SDRAM_PRECHARGE   (0x07FC)

Definition at line 246 of file cx231xx-417.c.

#define IVTV_REG_ENC_SDRAM_REFRESH   (0x07F8)

Definition at line 245 of file cx231xx-417.c.

#define IVTV_REG_HW_BLOCKS   (0x9054)

Definition at line 248 of file cx231xx-417.c.

#define IVTV_REG_SPU   (0x9050)

Definition at line 247 of file cx231xx-417.c.

#define IVTV_REG_VPU   (0x9058)

Definition at line 249 of file cx231xx-417.c.

#define MC417_GPIO_SEL (   x)    (((x) << 1) & 0x00000006)

Definition at line 283 of file cx231xx-417.c.

#define MC417_GPIO_SEL_GPIO0   0x0

Definition at line 295 of file cx231xx-417.c.

#define MC417_GPIO_SEL_GPIO1   0x1

Definition at line 294 of file cx231xx-417.c.

#define MC417_GPIO_SEL_GPIO2   0x2

Definition at line 293 of file cx231xx-417.c.

#define MC417_GPIO_SEL_GPIO3   0x3

Definition at line 292 of file cx231xx-417.c.

#define MC417_MIADDR   0x0F00

Definition at line 272 of file cx231xx-417.c.

#define MC417_MICS   0x2000

Definition at line 270 of file cx231xx-417.c.

#define MC417_MIDATA   0x00FF

Definition at line 273 of file cx231xx-417.c.

#define MC417_MIRD   0x4000

Definition at line 269 of file cx231xx-417.c.

#define MC417_MIRDY   0x1000

Definition at line 271 of file cx231xx-417.c.

#define MC417_MIWR   0x8000

Definition at line 268 of file cx231xx-417.c.

#define MC417_SPD_CTL (   x)    (((x) << 4) & 0x00000030)

Definition at line 282 of file cx231xx-417.c.

#define MC417_SPD_CTL_FAST   0x3 /* b'1x, but we use b'11 */

Definition at line 289 of file cx231xx-417.c.

#define MC417_SPD_CTL_MEDIUM   0x0

Definition at line 288 of file cx231xx-417.c.

#define MC417_SPD_CTL_SLOW   0x1

Definition at line 287 of file cx231xx-417.c.

#define MC417_UART_GPIO_EN   0x00000001

Definition at line 284 of file cx231xx-417.c.

#define MCI_MEMORY_ADDRESS_BYTE0   0x30

Definition at line 57 of file cx231xx-417.c.

#define MCI_MEMORY_ADDRESS_BYTE1   0x28

Definition at line 56 of file cx231xx-417.c.

#define MCI_MEMORY_ADDRESS_BYTE2   0x20

Definition at line 55 of file cx231xx-417.c.

#define MCI_MEMORY_DATA_BYTE0   0x00

Definition at line 50 of file cx231xx-417.c.

#define MCI_MEMORY_DATA_BYTE1   0x08

Definition at line 51 of file cx231xx-417.c.

#define MCI_MEMORY_DATA_BYTE2   0x10

Definition at line 52 of file cx231xx-417.c.

#define MCI_MEMORY_DATA_BYTE3   0x18

Definition at line 53 of file cx231xx-417.c.

#define MCI_MODE_MEMORY_READ   0x000

Definition at line 72 of file cx231xx-417.c.

#define MCI_MODE_MEMORY_WRITE   0x4000

Definition at line 73 of file cx231xx-417.c.

#define MCI_MODE_REGISTER_READ   0x000

Definition at line 70 of file cx231xx-417.c.

#define MCI_MODE_REGISTER_WRITE   0x100

Definition at line 71 of file cx231xx-417.c.

#define MCI_REGISTER_ADDRESS_BYTE0   0x60

Definition at line 64 of file cx231xx-417.c.

#define MCI_REGISTER_ADDRESS_BYTE1   0x68

Definition at line 65 of file cx231xx-417.c.

#define MCI_REGISTER_DATA_BYTE0   0x40

Definition at line 59 of file cx231xx-417.c.

#define MCI_REGISTER_DATA_BYTE1   0x48

Definition at line 60 of file cx231xx-417.c.

#define MCI_REGISTER_DATA_BYTE2   0x50

Definition at line 61 of file cx231xx-417.c.

#define MCI_REGISTER_DATA_BYTE3   0x58

Definition at line 62 of file cx231xx-417.c.

#define MCI_REGISTER_MODE   0x70

Definition at line 67 of file cx231xx-417.c.

Enumeration Type Documentation

Enumerator:
CX231xx_RAW_BITS_NONE 
CX231xx_RAW_BITS_YUV_CAPTURE 
CX231xx_RAW_BITS_PCM_CAPTURE 
CX231xx_RAW_BITS_VBI_CAPTURE 
CX231xx_RAW_BITS_PASSTHRU_CAPTURE 
CX231xx_RAW_BITS_TO_HOST_CAPTURE 

Definition at line 139 of file cx231xx-417.c.

Enumerator:
CX231xx_END_AT_GOP 
CX231xx_END_NOW 

Definition at line 147 of file cx231xx-417.c.

Enumerator:
CX231xx_MPEG_CAPTURE 
CX231xx_RAW_CAPTURE 
CX231xx_RAW_PASSTHRU_CAPTURE 

Definition at line 134 of file cx231xx-417.c.

Enumerator:
CX231xx_COPYRIGHT_OFF 
CX231xx_COPYRIGHT_ON 

Definition at line 194 of file cx231xx-417.c.

Enumerator:
CX231xx_CUSTOM_EXTENSION_USR_DATA 
CX231xx_CUSTOM_PRIVATE_PACKET 

Definition at line 218 of file cx231xx-417.c.

Enumerator:
CX231xx_MORE_BUFFERS_FOLLOW 
CX231xx_LAST_BUFFER 

Definition at line 160 of file cx231xx-417.c.

Enumerator:
CX231xx_DMA_TRANSFER_BITS_DONE 
CX231xx_DMA_TRANSFER_BITS_ERROR 
CX231xx_DMA_TRANSFER_BITS_LL_ERROR 

Definition at line 185 of file cx231xx-417.c.

Enumerator:
CX231xx_DMA_BYTES 
CX231xx_DMA_FRAMES 

Definition at line 181 of file cx231xx-417.c.

Enumerator:
CX231xx_FIELD1_SAA7114 
CX231xx_FIELD1_SAA7115 
CX231xx_FIELD1_MICRONAS 

Definition at line 208 of file cx231xx-417.c.

Enumerator:
CX231xx_FIELD2_SAA7114 
CX231xx_FIELD2_SAA7115 
CX231xx_FIELD2_MICRONAS 

Definition at line 213 of file cx231xx-417.c.

Enumerator:
CX231xx_FRAMERATE_NTSC_30 
CX231xx_FRAMERATE_PAL_25 

Definition at line 151 of file cx231xx-417.c.

Enumerator:
CX231xx_UNMUTE 
CX231xx_MUTE 

Definition at line 222 of file cx231xx-417.c.

Enumerator:
CX231xx_MUTE_VIDEO_V_MASK 
CX231xx_MUTE_VIDEO_U_MASK 
CX231xx_MUTE_VIDEO_Y_MASK 

Definition at line 226 of file cx231xx-417.c.

Enumerator:
CX231xx_MUTE_VIDEO_V_SHIFT 
CX231xx_MUTE_VIDEO_U_SHIFT 
CX231xx_MUTE_VIDEO_Y_SHIFT 

Definition at line 231 of file cx231xx-417.c.

Enumerator:
CX231xx_NOTIFICATION_NO_MAILBOX 

Definition at line 205 of file cx231xx-417.c.

Enumerator:
CX231xx_NOTIFICATION_OFF 
CX231xx_NOTIFICATION_ON 

Definition at line 201 of file cx231xx-417.c.

Enumerator:
CX231xx_NOTIFICATION_REFRESH 

Definition at line 198 of file cx231xx-417.c.

Enumerator:
CX231xx_PAUSE_ENCODING 
CX231xx_RESUME_ENCODING 

Definition at line 190 of file cx231xx-417.c.

Enumerator:
CX231xx_PICTURE_MASK_NONE 
CX231xx_PICTURE_MASK_I_FRAMES 
CX231xx_PICTURE_MASK_I_P_FRAMES 
CX231xx_PICTURE_MASK_ALL_FRAMES 

Definition at line 164 of file cx231xx-417.c.

Enumerator:
CX231xx_OUTPUT_PORT_MEMORY 
CX231xx_OUTPUT_PORT_STREAMING 
CX231xx_OUTPUT_PORT_SERIAL 

Definition at line 155 of file cx231xx-417.c.

Enumerator:
CX231xx_VBI_BITS_INSERT_IN_XTENSION_USR_DATA 
CX231xx_VBI_BITS_INSERT_IN_PRIVATE_PACKETS 
CX231xx_VBI_BITS_SEPARATE_STREAM 
CX231xx_VBI_BITS_SEPARATE_STREAM_USR_DATA 
CX231xx_VBI_BITS_SEPARATE_STREAM_PRV_DATA 

Definition at line 174 of file cx231xx-417.c.

Enumerator:
CX231xx_VBI_BITS_SLICED 
CX231xx_VBI_BITS_RAW 

Definition at line 170 of file cx231xx-417.c.

Function Documentation

int cx231xx_417_register ( struct cx231xx dev)

Definition at line 2159 of file cx231xx-417.c.

void cx231xx_417_unregister ( struct cx231xx dev)

Definition at line 2121 of file cx231xx-417.c.

MODULE_FIRMWARE ( CX231xx_FIRM_IMAGE_NAME  )
module_param ( mpegbufs  ,
int  ,
0644   
)
module_param ( mpeglines  ,
int  ,
0644   
)
module_param ( mpeglinesize  ,
int  ,
0644   
)
module_param ( v4l_debug  ,
int  ,
0644   
)
MODULE_PARM_DESC ( mpegbufs  ,
"number of mpeg  buffers,
range 2-32"   
)
MODULE_PARM_DESC ( mpeglines  ,
"number of lines in an MPEG  buffer,
range 2-32"   
)
MODULE_PARM_DESC ( mpeglinesize  ,
"number of bytes in each line of an MPEG  buffer,
range 512-1024"   
)
MODULE_PARM_DESC ( v4l_debug  ,
"enable V4L debug messages"   
)

Variable Documentation

Definition at line 89 of file cx231xx-417.c.