Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
mt9v032.c File Reference
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/log2.h>
#include <linux/mutex.h>
#include <linux/slab.h>
#include <linux/videodev2.h>
#include <linux/v4l2-mediabus.h>
#include <linux/module.h>
#include <media/mt9v032.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
#include <media/v4l2-subdev.h>

Go to the source code of this file.

Data Structures

struct  mt9v032
 

Macros

#define MT9V032_PIXEL_ARRAY_HEIGHT   492
 
#define MT9V032_PIXEL_ARRAY_WIDTH   782
 
#define MT9V032_SYSCLK_FREQ_DEF   26600000
 
#define MT9V032_CHIP_VERSION   0x00
 
#define MT9V032_CHIP_ID_REV1   0x1311
 
#define MT9V032_CHIP_ID_REV3   0x1313
 
#define MT9V032_COLUMN_START   0x01
 
#define MT9V032_COLUMN_START_MIN   1
 
#define MT9V032_COLUMN_START_DEF   1
 
#define MT9V032_COLUMN_START_MAX   752
 
#define MT9V032_ROW_START   0x02
 
#define MT9V032_ROW_START_MIN   4
 
#define MT9V032_ROW_START_DEF   5
 
#define MT9V032_ROW_START_MAX   482
 
#define MT9V032_WINDOW_HEIGHT   0x03
 
#define MT9V032_WINDOW_HEIGHT_MIN   1
 
#define MT9V032_WINDOW_HEIGHT_DEF   480
 
#define MT9V032_WINDOW_HEIGHT_MAX   480
 
#define MT9V032_WINDOW_WIDTH   0x04
 
#define MT9V032_WINDOW_WIDTH_MIN   1
 
#define MT9V032_WINDOW_WIDTH_DEF   752
 
#define MT9V032_WINDOW_WIDTH_MAX   752
 
#define MT9V032_HORIZONTAL_BLANKING   0x05
 
#define MT9V032_HORIZONTAL_BLANKING_MIN   43
 
#define MT9V032_HORIZONTAL_BLANKING_DEF   94
 
#define MT9V032_HORIZONTAL_BLANKING_MAX   1023
 
#define MT9V032_VERTICAL_BLANKING   0x06
 
#define MT9V032_VERTICAL_BLANKING_MIN   4
 
#define MT9V032_VERTICAL_BLANKING_DEF   45
 
#define MT9V032_VERTICAL_BLANKING_MAX   3000
 
#define MT9V032_CHIP_CONTROL   0x07
 
#define MT9V032_CHIP_CONTROL_MASTER_MODE   (1 << 3)
 
#define MT9V032_CHIP_CONTROL_DOUT_ENABLE   (1 << 7)
 
#define MT9V032_CHIP_CONTROL_SEQUENTIAL   (1 << 8)
 
#define MT9V032_SHUTTER_WIDTH1   0x08
 
#define MT9V032_SHUTTER_WIDTH2   0x09
 
#define MT9V032_SHUTTER_WIDTH_CONTROL   0x0a
 
#define MT9V032_TOTAL_SHUTTER_WIDTH   0x0b
 
#define MT9V032_TOTAL_SHUTTER_WIDTH_MIN   1
 
#define MT9V032_TOTAL_SHUTTER_WIDTH_DEF   480
 
#define MT9V032_TOTAL_SHUTTER_WIDTH_MAX   32767
 
#define MT9V032_RESET   0x0c
 
#define MT9V032_READ_MODE   0x0d
 
#define MT9V032_READ_MODE_ROW_BIN_MASK   (3 << 0)
 
#define MT9V032_READ_MODE_ROW_BIN_SHIFT   0
 
#define MT9V032_READ_MODE_COLUMN_BIN_MASK   (3 << 2)
 
#define MT9V032_READ_MODE_COLUMN_BIN_SHIFT   2
 
#define MT9V032_READ_MODE_ROW_FLIP   (1 << 4)
 
#define MT9V032_READ_MODE_COLUMN_FLIP   (1 << 5)
 
#define MT9V032_READ_MODE_DARK_COLUMNS   (1 << 6)
 
#define MT9V032_READ_MODE_DARK_ROWS   (1 << 7)
 
#define MT9V032_PIXEL_OPERATION_MODE   0x0f
 
#define MT9V032_PIXEL_OPERATION_MODE_COLOR   (1 << 2)
 
#define MT9V032_PIXEL_OPERATION_MODE_HDR   (1 << 6)
 
#define MT9V032_ANALOG_GAIN   0x35
 
#define MT9V032_ANALOG_GAIN_MIN   16
 
#define MT9V032_ANALOG_GAIN_DEF   16
 
#define MT9V032_ANALOG_GAIN_MAX   64
 
#define MT9V032_MAX_ANALOG_GAIN   0x36
 
#define MT9V032_MAX_ANALOG_GAIN_MAX   127
 
#define MT9V032_FRAME_DARK_AVERAGE   0x42
 
#define MT9V032_DARK_AVG_THRESH   0x46
 
#define MT9V032_DARK_AVG_LOW_THRESH_MASK   (255 << 0)
 
#define MT9V032_DARK_AVG_LOW_THRESH_SHIFT   0
 
#define MT9V032_DARK_AVG_HIGH_THRESH_MASK   (255 << 8)
 
#define MT9V032_DARK_AVG_HIGH_THRESH_SHIFT   8
 
#define MT9V032_ROW_NOISE_CORR_CONTROL   0x70
 
#define MT9V032_ROW_NOISE_CORR_ENABLE   (1 << 5)
 
#define MT9V032_ROW_NOISE_CORR_USE_BLK_AVG   (1 << 7)
 
#define MT9V032_PIXEL_CLOCK   0x74
 
#define MT9V032_PIXEL_CLOCK_INV_LINE   (1 << 0)
 
#define MT9V032_PIXEL_CLOCK_INV_FRAME   (1 << 1)
 
#define MT9V032_PIXEL_CLOCK_XOR_LINE   (1 << 2)
 
#define MT9V032_PIXEL_CLOCK_CONT_LINE   (1 << 3)
 
#define MT9V032_PIXEL_CLOCK_INV_PXL_CLK   (1 << 4)
 
#define MT9V032_TEST_PATTERN   0x7f
 
#define MT9V032_TEST_PATTERN_DATA_MASK   (1023 << 0)
 
#define MT9V032_TEST_PATTERN_DATA_SHIFT   0
 
#define MT9V032_TEST_PATTERN_USE_DATA   (1 << 10)
 
#define MT9V032_TEST_PATTERN_GRAY_MASK   (3 << 11)
 
#define MT9V032_TEST_PATTERN_GRAY_NONE   (0 << 11)
 
#define MT9V032_TEST_PATTERN_GRAY_VERTICAL   (1 << 11)
 
#define MT9V032_TEST_PATTERN_GRAY_HORIZONTAL   (2 << 11)
 
#define MT9V032_TEST_PATTERN_GRAY_DIAGONAL   (3 << 11)
 
#define MT9V032_TEST_PATTERN_ENABLE   (1 << 13)
 
#define MT9V032_TEST_PATTERN_FLIP   (1 << 14)
 
#define MT9V032_AEC_AGC_ENABLE   0xaf
 
#define MT9V032_AEC_ENABLE   (1 << 0)
 
#define MT9V032_AGC_ENABLE   (1 << 1)
 
#define MT9V032_THERMAL_INFO   0xc1
 
#define EXT_CLK   25000000
 
#define V4L2_CID_TEST_PATTERN_COLOR   (V4L2_CID_USER_BASE | 0x1001)
 

Functions

 MODULE_DEVICE_TABLE (i2c, mt9v032_id)
 
 module_i2c_driver (mt9v032_driver)
 
 MODULE_DESCRIPTION ("Aptina MT9V032 Camera driver")
 
 MODULE_AUTHOR ("Laurent Pinchart <[email protected]>")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define EXT_CLK   25000000

Definition at line 215 of file mt9v032.c.

#define MT9V032_AEC_AGC_ENABLE   0xaf

Definition at line 117 of file mt9v032.c.

#define MT9V032_AEC_ENABLE   (1 << 0)

Definition at line 118 of file mt9v032.c.

#define MT9V032_AGC_ENABLE   (1 << 1)

Definition at line 119 of file mt9v032.c.

#define MT9V032_ANALOG_GAIN   0x35

Definition at line 85 of file mt9v032.c.

#define MT9V032_ANALOG_GAIN_DEF   16

Definition at line 87 of file mt9v032.c.

#define MT9V032_ANALOG_GAIN_MAX   64

Definition at line 88 of file mt9v032.c.

#define MT9V032_ANALOG_GAIN_MIN   16

Definition at line 86 of file mt9v032.c.

#define MT9V032_CHIP_CONTROL   0x07

Definition at line 61 of file mt9v032.c.

#define MT9V032_CHIP_CONTROL_DOUT_ENABLE   (1 << 7)

Definition at line 63 of file mt9v032.c.

#define MT9V032_CHIP_CONTROL_MASTER_MODE   (1 << 3)

Definition at line 62 of file mt9v032.c.

#define MT9V032_CHIP_CONTROL_SEQUENTIAL   (1 << 8)

Definition at line 64 of file mt9v032.c.

#define MT9V032_CHIP_ID_REV1   0x1311

Definition at line 35 of file mt9v032.c.

#define MT9V032_CHIP_ID_REV3   0x1313

Definition at line 36 of file mt9v032.c.

#define MT9V032_CHIP_VERSION   0x00

Definition at line 34 of file mt9v032.c.

#define MT9V032_COLUMN_START   0x01

Definition at line 37 of file mt9v032.c.

#define MT9V032_COLUMN_START_DEF   1

Definition at line 39 of file mt9v032.c.

#define MT9V032_COLUMN_START_MAX   752

Definition at line 40 of file mt9v032.c.

#define MT9V032_COLUMN_START_MIN   1

Definition at line 38 of file mt9v032.c.

#define MT9V032_DARK_AVG_HIGH_THRESH_MASK   (255 << 8)

Definition at line 95 of file mt9v032.c.

#define MT9V032_DARK_AVG_HIGH_THRESH_SHIFT   8

Definition at line 96 of file mt9v032.c.

#define MT9V032_DARK_AVG_LOW_THRESH_MASK   (255 << 0)

Definition at line 93 of file mt9v032.c.

#define MT9V032_DARK_AVG_LOW_THRESH_SHIFT   0

Definition at line 94 of file mt9v032.c.

#define MT9V032_DARK_AVG_THRESH   0x46

Definition at line 92 of file mt9v032.c.

#define MT9V032_FRAME_DARK_AVERAGE   0x42

Definition at line 91 of file mt9v032.c.

#define MT9V032_HORIZONTAL_BLANKING   0x05

Definition at line 53 of file mt9v032.c.

#define MT9V032_HORIZONTAL_BLANKING_DEF   94

Definition at line 55 of file mt9v032.c.

#define MT9V032_HORIZONTAL_BLANKING_MAX   1023

Definition at line 56 of file mt9v032.c.

#define MT9V032_HORIZONTAL_BLANKING_MIN   43

Definition at line 54 of file mt9v032.c.

#define MT9V032_MAX_ANALOG_GAIN   0x36

Definition at line 89 of file mt9v032.c.

#define MT9V032_MAX_ANALOG_GAIN_MAX   127

Definition at line 90 of file mt9v032.c.

#define MT9V032_PIXEL_ARRAY_HEIGHT   492

Definition at line 29 of file mt9v032.c.

#define MT9V032_PIXEL_ARRAY_WIDTH   782

Definition at line 30 of file mt9v032.c.

#define MT9V032_PIXEL_CLOCK   0x74

Definition at line 100 of file mt9v032.c.

#define MT9V032_PIXEL_CLOCK_CONT_LINE   (1 << 3)

Definition at line 104 of file mt9v032.c.

#define MT9V032_PIXEL_CLOCK_INV_FRAME   (1 << 1)

Definition at line 102 of file mt9v032.c.

#define MT9V032_PIXEL_CLOCK_INV_LINE   (1 << 0)

Definition at line 101 of file mt9v032.c.

#define MT9V032_PIXEL_CLOCK_INV_PXL_CLK   (1 << 4)

Definition at line 105 of file mt9v032.c.

#define MT9V032_PIXEL_CLOCK_XOR_LINE   (1 << 2)

Definition at line 103 of file mt9v032.c.

#define MT9V032_PIXEL_OPERATION_MODE   0x0f

Definition at line 82 of file mt9v032.c.

#define MT9V032_PIXEL_OPERATION_MODE_COLOR   (1 << 2)

Definition at line 83 of file mt9v032.c.

#define MT9V032_PIXEL_OPERATION_MODE_HDR   (1 << 6)

Definition at line 84 of file mt9v032.c.

#define MT9V032_READ_MODE   0x0d

Definition at line 73 of file mt9v032.c.

#define MT9V032_READ_MODE_COLUMN_BIN_MASK   (3 << 2)

Definition at line 76 of file mt9v032.c.

#define MT9V032_READ_MODE_COLUMN_BIN_SHIFT   2

Definition at line 77 of file mt9v032.c.

#define MT9V032_READ_MODE_COLUMN_FLIP   (1 << 5)

Definition at line 79 of file mt9v032.c.

#define MT9V032_READ_MODE_DARK_COLUMNS   (1 << 6)

Definition at line 80 of file mt9v032.c.

#define MT9V032_READ_MODE_DARK_ROWS   (1 << 7)

Definition at line 81 of file mt9v032.c.

#define MT9V032_READ_MODE_ROW_BIN_MASK   (3 << 0)

Definition at line 74 of file mt9v032.c.

#define MT9V032_READ_MODE_ROW_BIN_SHIFT   0

Definition at line 75 of file mt9v032.c.

#define MT9V032_READ_MODE_ROW_FLIP   (1 << 4)

Definition at line 78 of file mt9v032.c.

#define MT9V032_RESET   0x0c

Definition at line 72 of file mt9v032.c.

#define MT9V032_ROW_NOISE_CORR_CONTROL   0x70

Definition at line 97 of file mt9v032.c.

#define MT9V032_ROW_NOISE_CORR_ENABLE   (1 << 5)

Definition at line 98 of file mt9v032.c.

#define MT9V032_ROW_NOISE_CORR_USE_BLK_AVG   (1 << 7)

Definition at line 99 of file mt9v032.c.

#define MT9V032_ROW_START   0x02

Definition at line 41 of file mt9v032.c.

#define MT9V032_ROW_START_DEF   5

Definition at line 43 of file mt9v032.c.

#define MT9V032_ROW_START_MAX   482

Definition at line 44 of file mt9v032.c.

#define MT9V032_ROW_START_MIN   4

Definition at line 42 of file mt9v032.c.

#define MT9V032_SHUTTER_WIDTH1   0x08

Definition at line 65 of file mt9v032.c.

#define MT9V032_SHUTTER_WIDTH2   0x09

Definition at line 66 of file mt9v032.c.

#define MT9V032_SHUTTER_WIDTH_CONTROL   0x0a

Definition at line 67 of file mt9v032.c.

#define MT9V032_SYSCLK_FREQ_DEF   26600000

Definition at line 32 of file mt9v032.c.

#define MT9V032_TEST_PATTERN   0x7f

Definition at line 106 of file mt9v032.c.

#define MT9V032_TEST_PATTERN_DATA_MASK   (1023 << 0)

Definition at line 107 of file mt9v032.c.

#define MT9V032_TEST_PATTERN_DATA_SHIFT   0

Definition at line 108 of file mt9v032.c.

#define MT9V032_TEST_PATTERN_ENABLE   (1 << 13)

Definition at line 115 of file mt9v032.c.

#define MT9V032_TEST_PATTERN_FLIP   (1 << 14)

Definition at line 116 of file mt9v032.c.

#define MT9V032_TEST_PATTERN_GRAY_DIAGONAL   (3 << 11)

Definition at line 114 of file mt9v032.c.

#define MT9V032_TEST_PATTERN_GRAY_HORIZONTAL   (2 << 11)

Definition at line 113 of file mt9v032.c.

#define MT9V032_TEST_PATTERN_GRAY_MASK   (3 << 11)

Definition at line 110 of file mt9v032.c.

#define MT9V032_TEST_PATTERN_GRAY_NONE   (0 << 11)

Definition at line 111 of file mt9v032.c.

#define MT9V032_TEST_PATTERN_GRAY_VERTICAL   (1 << 11)

Definition at line 112 of file mt9v032.c.

#define MT9V032_TEST_PATTERN_USE_DATA   (1 << 10)

Definition at line 109 of file mt9v032.c.

#define MT9V032_THERMAL_INFO   0xc1

Definition at line 120 of file mt9v032.c.

#define MT9V032_TOTAL_SHUTTER_WIDTH   0x0b

Definition at line 68 of file mt9v032.c.

#define MT9V032_TOTAL_SHUTTER_WIDTH_DEF   480

Definition at line 70 of file mt9v032.c.

#define MT9V032_TOTAL_SHUTTER_WIDTH_MAX   32767

Definition at line 71 of file mt9v032.c.

#define MT9V032_TOTAL_SHUTTER_WIDTH_MIN   1

Definition at line 69 of file mt9v032.c.

#define MT9V032_VERTICAL_BLANKING   0x06

Definition at line 57 of file mt9v032.c.

#define MT9V032_VERTICAL_BLANKING_DEF   45

Definition at line 59 of file mt9v032.c.

#define MT9V032_VERTICAL_BLANKING_MAX   3000

Definition at line 60 of file mt9v032.c.

#define MT9V032_VERTICAL_BLANKING_MIN   4

Definition at line 58 of file mt9v032.c.

#define MT9V032_WINDOW_HEIGHT   0x03

Definition at line 45 of file mt9v032.c.

#define MT9V032_WINDOW_HEIGHT_DEF   480

Definition at line 47 of file mt9v032.c.

#define MT9V032_WINDOW_HEIGHT_MAX   480

Definition at line 48 of file mt9v032.c.

#define MT9V032_WINDOW_HEIGHT_MIN   1

Definition at line 46 of file mt9v032.c.

#define MT9V032_WINDOW_WIDTH   0x04

Definition at line 49 of file mt9v032.c.

#define MT9V032_WINDOW_WIDTH_DEF   752

Definition at line 51 of file mt9v032.c.

#define MT9V032_WINDOW_WIDTH_MAX   752

Definition at line 52 of file mt9v032.c.

#define MT9V032_WINDOW_WIDTH_MIN   1

Definition at line 50 of file mt9v032.c.

#define V4L2_CID_TEST_PATTERN_COLOR   (V4L2_CID_USER_BASE | 0x1001)

Definition at line 507 of file mt9v032.c.

Function Documentation

MODULE_AUTHOR ( "Laurent Pinchart <[email protected]>"  )
MODULE_DESCRIPTION ( "Aptina MT9V032 Camera driver )
MODULE_DEVICE_TABLE ( i2c  ,
mt9v032_id   
)
module_i2c_driver ( mt9v032_driver  )
MODULE_LICENSE ( "GPL"  )