Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
mt9p031.c File Reference
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/gpio.h>
#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/log2.h>
#include <linux/pm.h>
#include <linux/slab.h>
#include <linux/videodev2.h>
#include <media/mt9p031.h>
#include <media/v4l2-chip-ident.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
#include <media/v4l2-subdev.h>
#include "aptina-pll.h"

Go to the source code of this file.

Data Structures

struct  mt9p031
 

Macros

#define MT9P031_PIXEL_ARRAY_WIDTH   2752
 
#define MT9P031_PIXEL_ARRAY_HEIGHT   2004
 
#define MT9P031_CHIP_VERSION   0x00
 
#define MT9P031_CHIP_VERSION_VALUE   0x1801
 
#define MT9P031_ROW_START   0x01
 
#define MT9P031_ROW_START_MIN   0
 
#define MT9P031_ROW_START_MAX   2004
 
#define MT9P031_ROW_START_DEF   54
 
#define MT9P031_COLUMN_START   0x02
 
#define MT9P031_COLUMN_START_MIN   0
 
#define MT9P031_COLUMN_START_MAX   2750
 
#define MT9P031_COLUMN_START_DEF   16
 
#define MT9P031_WINDOW_HEIGHT   0x03
 
#define MT9P031_WINDOW_HEIGHT_MIN   2
 
#define MT9P031_WINDOW_HEIGHT_MAX   2006
 
#define MT9P031_WINDOW_HEIGHT_DEF   1944
 
#define MT9P031_WINDOW_WIDTH   0x04
 
#define MT9P031_WINDOW_WIDTH_MIN   2
 
#define MT9P031_WINDOW_WIDTH_MAX   2752
 
#define MT9P031_WINDOW_WIDTH_DEF   2592
 
#define MT9P031_HORIZONTAL_BLANK   0x05
 
#define MT9P031_HORIZONTAL_BLANK_MIN   0
 
#define MT9P031_HORIZONTAL_BLANK_MAX   4095
 
#define MT9P031_VERTICAL_BLANK   0x06
 
#define MT9P031_VERTICAL_BLANK_MIN   1
 
#define MT9P031_VERTICAL_BLANK_MAX   4096
 
#define MT9P031_VERTICAL_BLANK_DEF   26
 
#define MT9P031_OUTPUT_CONTROL   0x07
 
#define MT9P031_OUTPUT_CONTROL_CEN   2
 
#define MT9P031_OUTPUT_CONTROL_SYN   1
 
#define MT9P031_OUTPUT_CONTROL_DEF   0x1f82
 
#define MT9P031_SHUTTER_WIDTH_UPPER   0x08
 
#define MT9P031_SHUTTER_WIDTH_LOWER   0x09
 
#define MT9P031_SHUTTER_WIDTH_MIN   1
 
#define MT9P031_SHUTTER_WIDTH_MAX   1048575
 
#define MT9P031_SHUTTER_WIDTH_DEF   1943
 
#define MT9P031_PLL_CONTROL   0x10
 
#define MT9P031_PLL_CONTROL_PWROFF   0x0050
 
#define MT9P031_PLL_CONTROL_PWRON   0x0051
 
#define MT9P031_PLL_CONTROL_USEPLL   0x0052
 
#define MT9P031_PLL_CONFIG_1   0x11
 
#define MT9P031_PLL_CONFIG_2   0x12
 
#define MT9P031_PIXEL_CLOCK_CONTROL   0x0a
 
#define MT9P031_FRAME_RESTART   0x0b
 
#define MT9P031_SHUTTER_DELAY   0x0c
 
#define MT9P031_RST   0x0d
 
#define MT9P031_RST_ENABLE   1
 
#define MT9P031_RST_DISABLE   0
 
#define MT9P031_READ_MODE_1   0x1e
 
#define MT9P031_READ_MODE_2   0x20
 
#define MT9P031_READ_MODE_2_ROW_MIR   (1 << 15)
 
#define MT9P031_READ_MODE_2_COL_MIR   (1 << 14)
 
#define MT9P031_READ_MODE_2_ROW_BLC   (1 << 6)
 
#define MT9P031_ROW_ADDRESS_MODE   0x22
 
#define MT9P031_COLUMN_ADDRESS_MODE   0x23
 
#define MT9P031_GLOBAL_GAIN   0x35
 
#define MT9P031_GLOBAL_GAIN_MIN   8
 
#define MT9P031_GLOBAL_GAIN_MAX   1024
 
#define MT9P031_GLOBAL_GAIN_DEF   8
 
#define MT9P031_GLOBAL_GAIN_MULT   (1 << 6)
 
#define MT9P031_ROW_BLACK_TARGET   0x49
 
#define MT9P031_ROW_BLACK_DEF_OFFSET   0x4b
 
#define MT9P031_GREEN1_OFFSET   0x60
 
#define MT9P031_GREEN2_OFFSET   0x61
 
#define MT9P031_BLACK_LEVEL_CALIBRATION   0x62
 
#define MT9P031_BLC_MANUAL_BLC   (1 << 0)
 
#define MT9P031_RED_OFFSET   0x63
 
#define MT9P031_BLUE_OFFSET   0x64
 
#define MT9P031_TEST_PATTERN   0xa0
 
#define MT9P031_TEST_PATTERN_SHIFT   3
 
#define MT9P031_TEST_PATTERN_ENABLE   (1 << 0)
 
#define MT9P031_TEST_PATTERN_DISABLE   (0 << 0)
 
#define MT9P031_TEST_PATTERN_GREEN   0xa1
 
#define MT9P031_TEST_PATTERN_RED   0xa2
 
#define MT9P031_TEST_PATTERN_BLUE   0xa3
 
#define V4L2_CID_BLC_AUTO   (V4L2_CID_USER_BASE | 0x1002)
 
#define V4L2_CID_BLC_TARGET_LEVEL   (V4L2_CID_USER_BASE | 0x1003)
 
#define V4L2_CID_BLC_ANALOG_OFFSET   (V4L2_CID_USER_BASE | 0x1004)
 
#define V4L2_CID_BLC_DIGITAL_OFFSET   (V4L2_CID_USER_BASE | 0x1005)
 

Enumerations

enum  mt9p031_model { MT9P031_MODEL_COLOR, MT9P031_MODEL_MONOCHROME }
 

Functions

 MODULE_DEVICE_TABLE (i2c, mt9p031_id)
 
 module_i2c_driver (mt9p031_i2c_driver)
 
 MODULE_DESCRIPTION ("Aptina MT9P031 Camera driver")
 
 MODULE_AUTHOR ("Bastian Hecht <[email protected]>")
 
 MODULE_LICENSE ("GPL v2")
 

Macro Definition Documentation

#define MT9P031_BLACK_LEVEL_CALIBRATION   0x62

Definition at line 98 of file mt9p031.c.

#define MT9P031_BLC_MANUAL_BLC   (1 << 0)

Definition at line 99 of file mt9p031.c.

#define MT9P031_BLUE_OFFSET   0x64

Definition at line 101 of file mt9p031.c.

#define MT9P031_CHIP_VERSION   0x00

Definition at line 36 of file mt9p031.c.

#define MT9P031_CHIP_VERSION_VALUE   0x1801

Definition at line 37 of file mt9p031.c.

#define MT9P031_COLUMN_ADDRESS_MODE   0x23

Definition at line 88 of file mt9p031.c.

#define MT9P031_COLUMN_START   0x02

Definition at line 42 of file mt9p031.c.

#define MT9P031_COLUMN_START_DEF   16

Definition at line 45 of file mt9p031.c.

#define MT9P031_COLUMN_START_MAX   2750

Definition at line 44 of file mt9p031.c.

#define MT9P031_COLUMN_START_MIN   0

Definition at line 43 of file mt9p031.c.

#define MT9P031_FRAME_RESTART   0x0b

Definition at line 77 of file mt9p031.c.

#define MT9P031_GLOBAL_GAIN   0x35

Definition at line 89 of file mt9p031.c.

#define MT9P031_GLOBAL_GAIN_DEF   8

Definition at line 92 of file mt9p031.c.

#define MT9P031_GLOBAL_GAIN_MAX   1024

Definition at line 91 of file mt9p031.c.

#define MT9P031_GLOBAL_GAIN_MIN   8

Definition at line 90 of file mt9p031.c.

#define MT9P031_GLOBAL_GAIN_MULT   (1 << 6)

Definition at line 93 of file mt9p031.c.

#define MT9P031_GREEN1_OFFSET   0x60

Definition at line 96 of file mt9p031.c.

#define MT9P031_GREEN2_OFFSET   0x61

Definition at line 97 of file mt9p031.c.

#define MT9P031_HORIZONTAL_BLANK   0x05

Definition at line 54 of file mt9p031.c.

#define MT9P031_HORIZONTAL_BLANK_MAX   4095

Definition at line 56 of file mt9p031.c.

#define MT9P031_HORIZONTAL_BLANK_MIN   0

Definition at line 55 of file mt9p031.c.

#define MT9P031_OUTPUT_CONTROL   0x07

Definition at line 61 of file mt9p031.c.

#define MT9P031_OUTPUT_CONTROL_CEN   2

Definition at line 62 of file mt9p031.c.

#define MT9P031_OUTPUT_CONTROL_DEF   0x1f82

Definition at line 64 of file mt9p031.c.

#define MT9P031_OUTPUT_CONTROL_SYN   1

Definition at line 63 of file mt9p031.c.

#define MT9P031_PIXEL_ARRAY_HEIGHT   2004

Definition at line 34 of file mt9p031.c.

#define MT9P031_PIXEL_ARRAY_WIDTH   2752

Definition at line 33 of file mt9p031.c.

#define MT9P031_PIXEL_CLOCK_CONTROL   0x0a

Definition at line 76 of file mt9p031.c.

#define MT9P031_PLL_CONFIG_1   0x11

Definition at line 74 of file mt9p031.c.

#define MT9P031_PLL_CONFIG_2   0x12

Definition at line 75 of file mt9p031.c.

#define MT9P031_PLL_CONTROL   0x10

Definition at line 70 of file mt9p031.c.

#define MT9P031_PLL_CONTROL_PWROFF   0x0050

Definition at line 71 of file mt9p031.c.

#define MT9P031_PLL_CONTROL_PWRON   0x0051

Definition at line 72 of file mt9p031.c.

#define MT9P031_PLL_CONTROL_USEPLL   0x0052

Definition at line 73 of file mt9p031.c.

#define MT9P031_READ_MODE_1   0x1e

Definition at line 82 of file mt9p031.c.

#define MT9P031_READ_MODE_2   0x20

Definition at line 83 of file mt9p031.c.

#define MT9P031_READ_MODE_2_COL_MIR   (1 << 14)

Definition at line 85 of file mt9p031.c.

#define MT9P031_READ_MODE_2_ROW_BLC   (1 << 6)

Definition at line 86 of file mt9p031.c.

#define MT9P031_READ_MODE_2_ROW_MIR   (1 << 15)

Definition at line 84 of file mt9p031.c.

#define MT9P031_RED_OFFSET   0x63

Definition at line 100 of file mt9p031.c.

#define MT9P031_ROW_ADDRESS_MODE   0x22

Definition at line 87 of file mt9p031.c.

#define MT9P031_ROW_BLACK_DEF_OFFSET   0x4b

Definition at line 95 of file mt9p031.c.

#define MT9P031_ROW_BLACK_TARGET   0x49

Definition at line 94 of file mt9p031.c.

#define MT9P031_ROW_START   0x01

Definition at line 38 of file mt9p031.c.

#define MT9P031_ROW_START_DEF   54

Definition at line 41 of file mt9p031.c.

#define MT9P031_ROW_START_MAX   2004

Definition at line 40 of file mt9p031.c.

#define MT9P031_ROW_START_MIN   0

Definition at line 39 of file mt9p031.c.

#define MT9P031_RST   0x0d

Definition at line 79 of file mt9p031.c.

#define MT9P031_RST_DISABLE   0

Definition at line 81 of file mt9p031.c.

#define MT9P031_RST_ENABLE   1

Definition at line 80 of file mt9p031.c.

#define MT9P031_SHUTTER_DELAY   0x0c

Definition at line 78 of file mt9p031.c.

#define MT9P031_SHUTTER_WIDTH_DEF   1943

Definition at line 69 of file mt9p031.c.

#define MT9P031_SHUTTER_WIDTH_LOWER   0x09

Definition at line 66 of file mt9p031.c.

#define MT9P031_SHUTTER_WIDTH_MAX   1048575

Definition at line 68 of file mt9p031.c.

#define MT9P031_SHUTTER_WIDTH_MIN   1

Definition at line 67 of file mt9p031.c.

#define MT9P031_SHUTTER_WIDTH_UPPER   0x08

Definition at line 65 of file mt9p031.c.

#define MT9P031_TEST_PATTERN   0xa0

Definition at line 102 of file mt9p031.c.

#define MT9P031_TEST_PATTERN_BLUE   0xa3

Definition at line 108 of file mt9p031.c.

#define MT9P031_TEST_PATTERN_DISABLE   (0 << 0)

Definition at line 105 of file mt9p031.c.

#define MT9P031_TEST_PATTERN_ENABLE   (1 << 0)

Definition at line 104 of file mt9p031.c.

#define MT9P031_TEST_PATTERN_GREEN   0xa1

Definition at line 106 of file mt9p031.c.

#define MT9P031_TEST_PATTERN_RED   0xa2

Definition at line 107 of file mt9p031.c.

#define MT9P031_TEST_PATTERN_SHIFT   3

Definition at line 103 of file mt9p031.c.

#define MT9P031_VERTICAL_BLANK   0x06

Definition at line 57 of file mt9p031.c.

#define MT9P031_VERTICAL_BLANK_DEF   26

Definition at line 60 of file mt9p031.c.

#define MT9P031_VERTICAL_BLANK_MAX   4096

Definition at line 59 of file mt9p031.c.

#define MT9P031_VERTICAL_BLANK_MIN   1

Definition at line 58 of file mt9p031.c.

#define MT9P031_WINDOW_HEIGHT   0x03

Definition at line 46 of file mt9p031.c.

#define MT9P031_WINDOW_HEIGHT_DEF   1944

Definition at line 49 of file mt9p031.c.

#define MT9P031_WINDOW_HEIGHT_MAX   2006

Definition at line 48 of file mt9p031.c.

#define MT9P031_WINDOW_HEIGHT_MIN   2

Definition at line 47 of file mt9p031.c.

#define MT9P031_WINDOW_WIDTH   0x04

Definition at line 50 of file mt9p031.c.

#define MT9P031_WINDOW_WIDTH_DEF   2592

Definition at line 53 of file mt9p031.c.

#define MT9P031_WINDOW_WIDTH_MAX   2752

Definition at line 52 of file mt9p031.c.

#define MT9P031_WINDOW_WIDTH_MIN   2

Definition at line 51 of file mt9p031.c.

#define V4L2_CID_BLC_ANALOG_OFFSET   (V4L2_CID_USER_BASE | 0x1004)

Definition at line 579 of file mt9p031.c.

#define V4L2_CID_BLC_AUTO   (V4L2_CID_USER_BASE | 0x1002)

Definition at line 577 of file mt9p031.c.

#define V4L2_CID_BLC_DIGITAL_OFFSET   (V4L2_CID_USER_BASE | 0x1005)

Definition at line 580 of file mt9p031.c.

#define V4L2_CID_BLC_TARGET_LEVEL   (V4L2_CID_USER_BASE | 0x1003)

Definition at line 578 of file mt9p031.c.

Enumeration Type Documentation

Enumerator:
MT9P031_MODEL_COLOR 
MT9P031_MODEL_MONOCHROME 

Definition at line 110 of file mt9p031.c.

Function Documentation

MODULE_AUTHOR ( "Bastian Hecht <[email protected]>"  )
MODULE_DESCRIPTION ( "Aptina MT9P031 Camera driver )
MODULE_DEVICE_TABLE ( i2c  ,
mt9p031_id   
)
module_i2c_driver ( mt9p031_i2c_driver  )
MODULE_LICENSE ( "GPL v2 )