Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
mt9m032.c File Reference
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/math64.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/slab.h>
#include <linux/v4l2-mediabus.h>
#include <media/media-entity.h>
#include <media/mt9m032.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  mt9m032
 

Macros

#define MT9M032_PIXEL_ARRAY_WIDTH   1600
 
#define MT9M032_PIXEL_ARRAY_HEIGHT   1152
 
#define MT9M032_CHIP_VERSION   0x00
 
#define MT9M032_CHIP_VERSION_VALUE   0x1402
 
#define MT9M032_ROW_START   0x01
 
#define MT9M032_ROW_START_MIN   0
 
#define MT9M032_ROW_START_MAX   1152
 
#define MT9M032_ROW_START_DEF   60
 
#define MT9M032_COLUMN_START   0x02
 
#define MT9M032_COLUMN_START_MIN   0
 
#define MT9M032_COLUMN_START_MAX   1600
 
#define MT9M032_COLUMN_START_DEF   16
 
#define MT9M032_ROW_SIZE   0x03
 
#define MT9M032_ROW_SIZE_MIN   32
 
#define MT9M032_ROW_SIZE_MAX   1152
 
#define MT9M032_ROW_SIZE_DEF   1080
 
#define MT9M032_COLUMN_SIZE   0x04
 
#define MT9M032_COLUMN_SIZE_MIN   32
 
#define MT9M032_COLUMN_SIZE_MAX   1600
 
#define MT9M032_COLUMN_SIZE_DEF   1440
 
#define MT9M032_HBLANK   0x05
 
#define MT9M032_VBLANK   0x06
 
#define MT9M032_VBLANK_MAX   0x7ff
 
#define MT9M032_SHUTTER_WIDTH_HIGH   0x08
 
#define MT9M032_SHUTTER_WIDTH_LOW   0x09
 
#define MT9M032_SHUTTER_WIDTH_MIN   1
 
#define MT9M032_SHUTTER_WIDTH_MAX   1048575
 
#define MT9M032_SHUTTER_WIDTH_DEF   1943
 
#define MT9M032_PIX_CLK_CTRL   0x0a
 
#define MT9M032_PIX_CLK_CTRL_INV_PIXCLK   0x8000
 
#define MT9M032_RESTART   0x0b
 
#define MT9M032_RESET   0x0d
 
#define MT9M032_PLL_CONFIG1   0x11
 
#define MT9M032_PLL_CONFIG1_OUTDIV_MASK   0x3f
 
#define MT9M032_PLL_CONFIG1_MUL_SHIFT   8
 
#define MT9M032_READ_MODE1   0x1e
 
#define MT9M032_READ_MODE2   0x20
 
#define MT9M032_READ_MODE2_VFLIP_SHIFT   15
 
#define MT9M032_READ_MODE2_HFLIP_SHIFT   14
 
#define MT9M032_READ_MODE2_ROW_BLC   0x40
 
#define MT9M032_GAIN_GREEN1   0x2b
 
#define MT9M032_GAIN_BLUE   0x2c
 
#define MT9M032_GAIN_RED   0x2d
 
#define MT9M032_GAIN_GREEN2   0x2e
 
#define MT9M032_GAIN_ALL   0x35
 
#define MT9M032_GAIN_DIGITAL_MASK   0x7f
 
#define MT9M032_GAIN_DIGITAL_SHIFT   8
 
#define MT9M032_GAIN_AMUL_SHIFT   6
 
#define MT9M032_GAIN_ANALOG_MASK   0x3f
 
#define MT9M032_FORMATTER1   0x9e
 
#define MT9M032_FORMATTER2   0x9f
 
#define MT9M032_FORMATTER2_DOUT_EN   0x1000
 
#define MT9M032_FORMATTER2_PIXCLK_EN   0x2000
 
#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_CONFIG2   0x11
 
#define MT9P031_PLL_CONFIG2_P1_DIV_MASK   0x1f
 
#define to_mt9m032(sd)   container_of(sd, struct mt9m032, subdev)
 
#define to_dev(sensor)   (&((struct i2c_client *)v4l2_get_subdevdata(&(sensor)->subdev))->dev)
 

Functions

 MODULE_DEVICE_TABLE (i2c, mt9m032_id_table)
 
 module_i2c_driver (mt9m032_i2c_driver)
 
 MODULE_AUTHOR ("Martin Hostettler <[email protected]>")
 
 MODULE_DESCRIPTION ("MT9M032 camera sensor driver")
 
 MODULE_LICENSE ("GPL v2")
 

Macro Definition Documentation

#define MT9M032_CHIP_VERSION   0x00

Definition at line 59 of file mt9m032.c.

#define MT9M032_CHIP_VERSION_VALUE   0x1402

Definition at line 60 of file mt9m032.c.

#define MT9M032_COLUMN_SIZE   0x04

Definition at line 73 of file mt9m032.c.

#define MT9M032_COLUMN_SIZE_DEF   1440

Definition at line 76 of file mt9m032.c.

#define MT9M032_COLUMN_SIZE_MAX   1600

Definition at line 75 of file mt9m032.c.

#define MT9M032_COLUMN_SIZE_MIN   32

Definition at line 74 of file mt9m032.c.

#define MT9M032_COLUMN_START   0x02

Definition at line 65 of file mt9m032.c.

#define MT9M032_COLUMN_START_DEF   16

Definition at line 68 of file mt9m032.c.

#define MT9M032_COLUMN_START_MAX   1600

Definition at line 67 of file mt9m032.c.

#define MT9M032_COLUMN_START_MIN   0

Definition at line 66 of file mt9m032.c.

#define MT9M032_FORMATTER1   0x9e

Definition at line 108 of file mt9m032.c.

#define MT9M032_FORMATTER2   0x9f

Definition at line 109 of file mt9m032.c.

#define MT9M032_FORMATTER2_DOUT_EN   0x1000

Definition at line 110 of file mt9m032.c.

#define MT9M032_FORMATTER2_PIXCLK_EN   0x2000

Definition at line 111 of file mt9m032.c.

#define MT9M032_GAIN_ALL   0x35

Definition at line 103 of file mt9m032.c.

#define MT9M032_GAIN_AMUL_SHIFT   6

Definition at line 106 of file mt9m032.c.

#define MT9M032_GAIN_ANALOG_MASK   0x3f

Definition at line 107 of file mt9m032.c.

#define MT9M032_GAIN_BLUE   0x2c

Definition at line 98 of file mt9m032.c.

#define MT9M032_GAIN_DIGITAL_MASK   0x7f

Definition at line 104 of file mt9m032.c.

#define MT9M032_GAIN_DIGITAL_SHIFT   8

Definition at line 105 of file mt9m032.c.

#define MT9M032_GAIN_GREEN1   0x2b

Definition at line 97 of file mt9m032.c.

#define MT9M032_GAIN_GREEN2   0x2e

Definition at line 100 of file mt9m032.c.

#define MT9M032_GAIN_RED   0x2d

Definition at line 99 of file mt9m032.c.

#define MT9M032_HBLANK   0x05

Definition at line 77 of file mt9m032.c.

#define MT9M032_PIX_CLK_CTRL   0x0a

Definition at line 85 of file mt9m032.c.

#define MT9M032_PIX_CLK_CTRL_INV_PIXCLK   0x8000

Definition at line 86 of file mt9m032.c.

#define MT9M032_PIXEL_ARRAY_HEIGHT   1152

Definition at line 57 of file mt9m032.c.

#define MT9M032_PIXEL_ARRAY_WIDTH   1600

Definition at line 56 of file mt9m032.c.

#define MT9M032_PLL_CONFIG1   0x11

Definition at line 89 of file mt9m032.c.

#define MT9M032_PLL_CONFIG1_MUL_SHIFT   8

Definition at line 91 of file mt9m032.c.

#define MT9M032_PLL_CONFIG1_OUTDIV_MASK   0x3f

Definition at line 90 of file mt9m032.c.

#define MT9M032_READ_MODE1   0x1e

Definition at line 92 of file mt9m032.c.

#define MT9M032_READ_MODE2   0x20

Definition at line 93 of file mt9m032.c.

#define MT9M032_READ_MODE2_HFLIP_SHIFT   14

Definition at line 95 of file mt9m032.c.

#define MT9M032_READ_MODE2_ROW_BLC   0x40

Definition at line 96 of file mt9m032.c.

#define MT9M032_READ_MODE2_VFLIP_SHIFT   15

Definition at line 94 of file mt9m032.c.

#define MT9M032_RESET   0x0d

Definition at line 88 of file mt9m032.c.

#define MT9M032_RESTART   0x0b

Definition at line 87 of file mt9m032.c.

#define MT9M032_ROW_SIZE   0x03

Definition at line 69 of file mt9m032.c.

#define MT9M032_ROW_SIZE_DEF   1080

Definition at line 72 of file mt9m032.c.

#define MT9M032_ROW_SIZE_MAX   1152

Definition at line 71 of file mt9m032.c.

#define MT9M032_ROW_SIZE_MIN   32

Definition at line 70 of file mt9m032.c.

#define MT9M032_ROW_START   0x01

Definition at line 61 of file mt9m032.c.

#define MT9M032_ROW_START_DEF   60

Definition at line 64 of file mt9m032.c.

#define MT9M032_ROW_START_MAX   1152

Definition at line 63 of file mt9m032.c.

#define MT9M032_ROW_START_MIN   0

Definition at line 62 of file mt9m032.c.

#define MT9M032_SHUTTER_WIDTH_DEF   1943

Definition at line 84 of file mt9m032.c.

#define MT9M032_SHUTTER_WIDTH_HIGH   0x08

Definition at line 80 of file mt9m032.c.

#define MT9M032_SHUTTER_WIDTH_LOW   0x09

Definition at line 81 of file mt9m032.c.

#define MT9M032_SHUTTER_WIDTH_MAX   1048575

Definition at line 83 of file mt9m032.c.

#define MT9M032_SHUTTER_WIDTH_MIN   1

Definition at line 82 of file mt9m032.c.

#define MT9M032_VBLANK   0x06

Definition at line 78 of file mt9m032.c.

#define MT9M032_VBLANK_MAX   0x7ff

Definition at line 79 of file mt9m032.c.

#define MT9P031_PLL_CONFIG2   0x11

Definition at line 124 of file mt9m032.c.

#define MT9P031_PLL_CONFIG2_P1_DIV_MASK   0x1f

Definition at line 125 of file mt9m032.c.

#define MT9P031_PLL_CONTROL   0x10

Definition at line 120 of file mt9m032.c.

#define MT9P031_PLL_CONTROL_PWROFF   0x0050

Definition at line 121 of file mt9m032.c.

#define MT9P031_PLL_CONTROL_PWRON   0x0051

Definition at line 122 of file mt9m032.c.

#define MT9P031_PLL_CONTROL_USEPLL   0x0052

Definition at line 123 of file mt9m032.c.

#define to_dev (   sensor)    (&((struct i2c_client *)v4l2_get_subdevdata(&(sensor)->subdev))->dev)

Definition at line 150 of file mt9m032.c.

#define to_mt9m032 (   sd)    container_of(sd, struct mt9m032, subdev)

Definition at line 149 of file mt9m032.c.

Function Documentation

MODULE_AUTHOR ( "Martin Hostettler <[email protected]>"  )
MODULE_DESCRIPTION ( "MT9M032 camera sensor driver )
MODULE_DEVICE_TABLE ( i2c  ,
mt9m032_id_table   
)
module_i2c_driver ( mt9m032_i2c_driver  )
MODULE_LICENSE ( "GPL v2 )