Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
ov9740.c File Reference
#include <linux/init.h>
#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/v4l2-mediabus.h>
#include <media/soc_camera.h>
#include <media/v4l2-chip-ident.h>
#include <media/v4l2-ctrls.h>

Go to the source code of this file.

Data Structures

struct  ov9740_reg
 
struct  ov9740_priv
 

Macros

#define to_ov9740(sd)   container_of(sd, struct ov9740_priv, subdev)
 
#define OV9740_MODEL_ID_HI   0x0000
 
#define OV9740_MODEL_ID_LO   0x0001
 
#define OV9740_REVISION_NUMBER   0x0002
 
#define OV9740_MANUFACTURER_ID   0x0003
 
#define OV9740_SMIA_VERSION   0x0004
 
#define OV9740_MODE_SELECT   0x0100
 
#define OV9740_IMAGE_ORT   0x0101
 
#define OV9740_SOFTWARE_RESET   0x0103
 
#define OV9740_GRP_PARAM_HOLD   0x0104
 
#define OV9740_MSK_CORRUP_FM   0x0105
 
#define OV9740_FRM_LENGTH_LN_HI   0x0340 /* VTS */
 
#define OV9740_FRM_LENGTH_LN_LO   0x0341 /* VTS */
 
#define OV9740_LN_LENGTH_PCK_HI   0x0342 /* HTS */
 
#define OV9740_LN_LENGTH_PCK_LO   0x0343 /* HTS */
 
#define OV9740_X_ADDR_START_HI   0x0344
 
#define OV9740_X_ADDR_START_LO   0x0345
 
#define OV9740_Y_ADDR_START_HI   0x0346
 
#define OV9740_Y_ADDR_START_LO   0x0347
 
#define OV9740_X_ADDR_END_HI   0x0348
 
#define OV9740_X_ADDR_END_LO   0x0349
 
#define OV9740_Y_ADDR_END_HI   0x034a
 
#define OV9740_Y_ADDR_END_LO   0x034b
 
#define OV9740_X_OUTPUT_SIZE_HI   0x034c
 
#define OV9740_X_OUTPUT_SIZE_LO   0x034d
 
#define OV9740_Y_OUTPUT_SIZE_HI   0x034e
 
#define OV9740_Y_OUTPUT_SIZE_LO   0x034f
 
#define OV9740_IO_CREL00   0x3002
 
#define OV9740_IO_CREL01   0x3004
 
#define OV9740_IO_CREL02   0x3005
 
#define OV9740_IO_OUTPUT_SEL01   0x3026
 
#define OV9740_IO_OUTPUT_SEL02   0x3027
 
#define OV9740_AWB_MANUAL_CTRL   0x3406
 
#define OV9740_ANALOG_CTRL01   0x3601
 
#define OV9740_ANALOG_CTRL02   0x3602
 
#define OV9740_ANALOG_CTRL03   0x3603
 
#define OV9740_ANALOG_CTRL04   0x3604
 
#define OV9740_ANALOG_CTRL10   0x3610
 
#define OV9740_ANALOG_CTRL12   0x3612
 
#define OV9740_ANALOG_CTRL15   0x3615
 
#define OV9740_ANALOG_CTRL20   0x3620
 
#define OV9740_ANALOG_CTRL21   0x3621
 
#define OV9740_ANALOG_CTRL22   0x3622
 
#define OV9740_ANALOG_CTRL30   0x3630
 
#define OV9740_ANALOG_CTRL31   0x3631
 
#define OV9740_ANALOG_CTRL32   0x3632
 
#define OV9740_ANALOG_CTRL33   0x3633
 
#define OV9740_SENSOR_CTRL03   0x3703
 
#define OV9740_SENSOR_CTRL04   0x3704
 
#define OV9740_SENSOR_CTRL05   0x3705
 
#define OV9740_SENSOR_CTRL07   0x3707
 
#define OV9740_TIMING_CTRL17   0x3817
 
#define OV9740_TIMING_CTRL19   0x3819
 
#define OV9740_TIMING_CTRL33   0x3833
 
#define OV9740_TIMING_CTRL35   0x3835
 
#define OV9740_AEC_MAXEXPO_60_H   0x3a02
 
#define OV9740_AEC_MAXEXPO_60_L   0x3a03
 
#define OV9740_AEC_B50_STEP_HI   0x3a08
 
#define OV9740_AEC_B50_STEP_LO   0x3a09
 
#define OV9740_AEC_B60_STEP_HI   0x3a0a
 
#define OV9740_AEC_B60_STEP_LO   0x3a0b
 
#define OV9740_AEC_CTRL0D   0x3a0d
 
#define OV9740_AEC_CTRL0E   0x3a0e
 
#define OV9740_AEC_MAXEXPO_50_H   0x3a14
 
#define OV9740_AEC_MAXEXPO_50_L   0x3a15
 
#define OV9740_AEC_ENABLE   0x3503
 
#define OV9740_GAIN_CEILING_01   0x3a18
 
#define OV9740_GAIN_CEILING_02   0x3a19
 
#define OV9740_AEC_HI_THRESHOLD   0x3a11
 
#define OV9740_AEC_3A1A   0x3a1a
 
#define OV9740_AEC_CTRL1B_WPT2   0x3a1b
 
#define OV9740_AEC_CTRL0F_WPT   0x3a0f
 
#define OV9740_AEC_CTRL10_BPT   0x3a10
 
#define OV9740_AEC_CTRL1E_BPT2   0x3a1e
 
#define OV9740_AEC_LO_THRESHOLD   0x3a1f
 
#define OV9740_BLC_AUTO_ENABLE   0x4002
 
#define OV9740_BLC_MODE   0x4005
 
#define OV9740_VFIFO_READ_START_HI   0x4608
 
#define OV9740_VFIFO_READ_START_LO   0x4609
 
#define OV9740_DVP_VSYNC_CTRL02   0x4702
 
#define OV9740_DVP_VSYNC_MODE   0x4704
 
#define OV9740_DVP_VSYNC_CTRL06   0x4706
 
#define OV9740_PLL_MODE_CTRL01   0x3104
 
#define OV9740_PRE_PLL_CLK_DIV   0x0305
 
#define OV9740_PLL_MULTIPLIER   0x0307
 
#define OV9740_VT_SYS_CLK_DIV   0x0303
 
#define OV9740_VT_PIX_CLK_DIV   0x0301
 
#define OV9740_PLL_CTRL3010   0x3010
 
#define OV9740_VFIFO_CTRL00   0x460e
 
#define OV9740_ISP_CTRL00   0x5000
 
#define OV9740_ISP_CTRL01   0x5001
 
#define OV9740_ISP_CTRL03   0x5003
 
#define OV9740_ISP_CTRL05   0x5005
 
#define OV9740_ISP_CTRL12   0x5012
 
#define OV9740_ISP_CTRL19   0x5019
 
#define OV9740_ISP_CTRL1A   0x501a
 
#define OV9740_ISP_CTRL1E   0x501e
 
#define OV9740_ISP_CTRL1F   0x501f
 
#define OV9740_ISP_CTRL20   0x5020
 
#define OV9740_ISP_CTRL21   0x5021
 
#define OV9740_AWB_CTRL00   0x5180
 
#define OV9740_AWB_CTRL01   0x5181
 
#define OV9740_AWB_CTRL02   0x5182
 
#define OV9740_AWB_CTRL03   0x5183
 
#define OV9740_AWB_ADV_CTRL01   0x5184
 
#define OV9740_AWB_ADV_CTRL02   0x5185
 
#define OV9740_AWB_ADV_CTRL03   0x5186
 
#define OV9740_AWB_ADV_CTRL04   0x5187
 
#define OV9740_AWB_ADV_CTRL05   0x5188
 
#define OV9740_AWB_ADV_CTRL06   0x5189
 
#define OV9740_AWB_ADV_CTRL07   0x518a
 
#define OV9740_AWB_ADV_CTRL08   0x518b
 
#define OV9740_AWB_ADV_CTRL09   0x518c
 
#define OV9740_AWB_ADV_CTRL10   0x518d
 
#define OV9740_AWB_ADV_CTRL11   0x518e
 
#define OV9740_AWB_CTRL0F   0x518f
 
#define OV9740_AWB_CTRL10   0x5190
 
#define OV9740_AWB_CTRL11   0x5191
 
#define OV9740_AWB_CTRL12   0x5192
 
#define OV9740_AWB_CTRL13   0x5193
 
#define OV9740_AWB_CTRL14   0x5194
 
#define OV9740_MIPI_CTRL00   0x4800
 
#define OV9740_MIPI_3837   0x3837
 
#define OV9740_MIPI_CTRL01   0x4801
 
#define OV9740_MIPI_CTRL03   0x4803
 
#define OV9740_MIPI_CTRL05   0x4805
 
#define OV9740_VFIFO_RD_CTRL   0x4601
 
#define OV9740_MIPI_CTRL_3012   0x3012
 
#define OV9740_SC_CMMM_MIPI_CTR   0x3014
 
#define OV9740_MAX_WIDTH   1280
 
#define OV9740_MAX_HEIGHT   720
 

Functions

 MODULE_DEVICE_TABLE (i2c, ov9740_id)
 
 module_i2c_driver (ov9740_i2c_driver)
 
 MODULE_DESCRIPTION ("SoC Camera driver for OmniVision OV9740")
 
 MODULE_AUTHOR ("Andrew Chew <[email protected]>")
 
 MODULE_LICENSE ("GPL v2")
 

Macro Definition Documentation

#define OV9740_AEC_3A1A   0x3a1a

Definition at line 112 of file ov9740.c.

#define OV9740_AEC_B50_STEP_HI   0x3a08

Definition at line 98 of file ov9740.c.

#define OV9740_AEC_B50_STEP_LO   0x3a09

Definition at line 99 of file ov9740.c.

#define OV9740_AEC_B60_STEP_HI   0x3a0a

Definition at line 100 of file ov9740.c.

#define OV9740_AEC_B60_STEP_LO   0x3a0b

Definition at line 101 of file ov9740.c.

#define OV9740_AEC_CTRL0D   0x3a0d

Definition at line 102 of file ov9740.c.

#define OV9740_AEC_CTRL0E   0x3a0e

Definition at line 103 of file ov9740.c.

#define OV9740_AEC_CTRL0F_WPT   0x3a0f

Definition at line 114 of file ov9740.c.

#define OV9740_AEC_CTRL10_BPT   0x3a10

Definition at line 115 of file ov9740.c.

#define OV9740_AEC_CTRL1B_WPT2   0x3a1b

Definition at line 113 of file ov9740.c.

#define OV9740_AEC_CTRL1E_BPT2   0x3a1e

Definition at line 116 of file ov9740.c.

#define OV9740_AEC_ENABLE   0x3503

Definition at line 108 of file ov9740.c.

#define OV9740_AEC_HI_THRESHOLD   0x3a11

Definition at line 111 of file ov9740.c.

#define OV9740_AEC_LO_THRESHOLD   0x3a1f

Definition at line 117 of file ov9740.c.

#define OV9740_AEC_MAXEXPO_50_H   0x3a14

Definition at line 104 of file ov9740.c.

#define OV9740_AEC_MAXEXPO_50_L   0x3a15

Definition at line 105 of file ov9740.c.

#define OV9740_AEC_MAXEXPO_60_H   0x3a02

Definition at line 96 of file ov9740.c.

#define OV9740_AEC_MAXEXPO_60_L   0x3a03

Definition at line 97 of file ov9740.c.

#define OV9740_ANALOG_CTRL01   0x3601

Definition at line 68 of file ov9740.c.

#define OV9740_ANALOG_CTRL02   0x3602

Definition at line 69 of file ov9740.c.

#define OV9740_ANALOG_CTRL03   0x3603

Definition at line 70 of file ov9740.c.

#define OV9740_ANALOG_CTRL04   0x3604

Definition at line 71 of file ov9740.c.

#define OV9740_ANALOG_CTRL10   0x3610

Definition at line 72 of file ov9740.c.

#define OV9740_ANALOG_CTRL12   0x3612

Definition at line 73 of file ov9740.c.

#define OV9740_ANALOG_CTRL15   0x3615

Definition at line 74 of file ov9740.c.

#define OV9740_ANALOG_CTRL20   0x3620

Definition at line 75 of file ov9740.c.

#define OV9740_ANALOG_CTRL21   0x3621

Definition at line 76 of file ov9740.c.

#define OV9740_ANALOG_CTRL22   0x3622

Definition at line 77 of file ov9740.c.

#define OV9740_ANALOG_CTRL30   0x3630

Definition at line 78 of file ov9740.c.

#define OV9740_ANALOG_CTRL31   0x3631

Definition at line 79 of file ov9740.c.

#define OV9740_ANALOG_CTRL32   0x3632

Definition at line 80 of file ov9740.c.

#define OV9740_ANALOG_CTRL33   0x3633

Definition at line 81 of file ov9740.c.

#define OV9740_AWB_ADV_CTRL01   0x5184

Definition at line 159 of file ov9740.c.

#define OV9740_AWB_ADV_CTRL02   0x5185

Definition at line 160 of file ov9740.c.

#define OV9740_AWB_ADV_CTRL03   0x5186

Definition at line 161 of file ov9740.c.

#define OV9740_AWB_ADV_CTRL04   0x5187

Definition at line 162 of file ov9740.c.

#define OV9740_AWB_ADV_CTRL05   0x5188

Definition at line 163 of file ov9740.c.

#define OV9740_AWB_ADV_CTRL06   0x5189

Definition at line 164 of file ov9740.c.

#define OV9740_AWB_ADV_CTRL07   0x518a

Definition at line 165 of file ov9740.c.

#define OV9740_AWB_ADV_CTRL08   0x518b

Definition at line 166 of file ov9740.c.

#define OV9740_AWB_ADV_CTRL09   0x518c

Definition at line 167 of file ov9740.c.

#define OV9740_AWB_ADV_CTRL10   0x518d

Definition at line 168 of file ov9740.c.

#define OV9740_AWB_ADV_CTRL11   0x518e

Definition at line 169 of file ov9740.c.

#define OV9740_AWB_CTRL00   0x5180

Definition at line 155 of file ov9740.c.

#define OV9740_AWB_CTRL01   0x5181

Definition at line 156 of file ov9740.c.

#define OV9740_AWB_CTRL02   0x5182

Definition at line 157 of file ov9740.c.

#define OV9740_AWB_CTRL03   0x5183

Definition at line 158 of file ov9740.c.

#define OV9740_AWB_CTRL0F   0x518f

Definition at line 170 of file ov9740.c.

#define OV9740_AWB_CTRL10   0x5190

Definition at line 171 of file ov9740.c.

#define OV9740_AWB_CTRL11   0x5191

Definition at line 172 of file ov9740.c.

#define OV9740_AWB_CTRL12   0x5192

Definition at line 173 of file ov9740.c.

#define OV9740_AWB_CTRL13   0x5193

Definition at line 174 of file ov9740.c.

#define OV9740_AWB_CTRL14   0x5194

Definition at line 175 of file ov9740.c.

#define OV9740_AWB_MANUAL_CTRL   0x3406

Definition at line 65 of file ov9740.c.

#define OV9740_BLC_AUTO_ENABLE   0x4002

Definition at line 120 of file ov9740.c.

#define OV9740_BLC_MODE   0x4005

Definition at line 121 of file ov9740.c.

#define OV9740_DVP_VSYNC_CTRL02   0x4702

Definition at line 128 of file ov9740.c.

#define OV9740_DVP_VSYNC_CTRL06   0x4706

Definition at line 130 of file ov9740.c.

#define OV9740_DVP_VSYNC_MODE   0x4704

Definition at line 129 of file ov9740.c.

#define OV9740_FRM_LENGTH_LN_HI   0x0340 /* VTS */

Definition at line 40 of file ov9740.c.

#define OV9740_FRM_LENGTH_LN_LO   0x0341 /* VTS */

Definition at line 41 of file ov9740.c.

#define OV9740_GAIN_CEILING_01   0x3a18

Definition at line 109 of file ov9740.c.

#define OV9740_GAIN_CEILING_02   0x3a19

Definition at line 110 of file ov9740.c.

#define OV9740_GRP_PARAM_HOLD   0x0104

Definition at line 36 of file ov9740.c.

#define OV9740_IMAGE_ORT   0x0101

Definition at line 34 of file ov9740.c.

#define OV9740_IO_CREL00   0x3002

Definition at line 58 of file ov9740.c.

#define OV9740_IO_CREL01   0x3004

Definition at line 59 of file ov9740.c.

#define OV9740_IO_CREL02   0x3005

Definition at line 60 of file ov9740.c.

#define OV9740_IO_OUTPUT_SEL01   0x3026

Definition at line 61 of file ov9740.c.

#define OV9740_IO_OUTPUT_SEL02   0x3027

Definition at line 62 of file ov9740.c.

#define OV9740_ISP_CTRL00   0x5000

Definition at line 142 of file ov9740.c.

#define OV9740_ISP_CTRL01   0x5001

Definition at line 143 of file ov9740.c.

#define OV9740_ISP_CTRL03   0x5003

Definition at line 144 of file ov9740.c.

#define OV9740_ISP_CTRL05   0x5005

Definition at line 145 of file ov9740.c.

#define OV9740_ISP_CTRL12   0x5012

Definition at line 146 of file ov9740.c.

#define OV9740_ISP_CTRL19   0x5019

Definition at line 147 of file ov9740.c.

#define OV9740_ISP_CTRL1A   0x501a

Definition at line 148 of file ov9740.c.

#define OV9740_ISP_CTRL1E   0x501e

Definition at line 149 of file ov9740.c.

#define OV9740_ISP_CTRL1F   0x501f

Definition at line 150 of file ov9740.c.

#define OV9740_ISP_CTRL20   0x5020

Definition at line 151 of file ov9740.c.

#define OV9740_ISP_CTRL21   0x5021

Definition at line 152 of file ov9740.c.

#define OV9740_LN_LENGTH_PCK_HI   0x0342 /* HTS */

Definition at line 42 of file ov9740.c.

#define OV9740_LN_LENGTH_PCK_LO   0x0343 /* HTS */

Definition at line 43 of file ov9740.c.

#define OV9740_MANUFACTURER_ID   0x0003

Definition at line 29 of file ov9740.c.

#define OV9740_MAX_HEIGHT   720

Definition at line 188 of file ov9740.c.

#define OV9740_MAX_WIDTH   1280

Definition at line 187 of file ov9740.c.

#define OV9740_MIPI_3837   0x3837

Definition at line 179 of file ov9740.c.

#define OV9740_MIPI_CTRL00   0x4800

Definition at line 178 of file ov9740.c.

#define OV9740_MIPI_CTRL01   0x4801

Definition at line 180 of file ov9740.c.

#define OV9740_MIPI_CTRL03   0x4803

Definition at line 181 of file ov9740.c.

#define OV9740_MIPI_CTRL05   0x4805

Definition at line 182 of file ov9740.c.

#define OV9740_MIPI_CTRL_3012   0x3012

Definition at line 184 of file ov9740.c.

#define OV9740_MODE_SELECT   0x0100

Definition at line 33 of file ov9740.c.

#define OV9740_MODEL_ID_HI   0x0000

Definition at line 26 of file ov9740.c.

#define OV9740_MODEL_ID_LO   0x0001

Definition at line 27 of file ov9740.c.

#define OV9740_MSK_CORRUP_FM   0x0105

Definition at line 37 of file ov9740.c.

#define OV9740_PLL_CTRL3010   0x3010

Definition at line 138 of file ov9740.c.

#define OV9740_PLL_MODE_CTRL01   0x3104

Definition at line 133 of file ov9740.c.

#define OV9740_PLL_MULTIPLIER   0x0307

Definition at line 135 of file ov9740.c.

#define OV9740_PRE_PLL_CLK_DIV   0x0305

Definition at line 134 of file ov9740.c.

#define OV9740_REVISION_NUMBER   0x0002

Definition at line 28 of file ov9740.c.

#define OV9740_SC_CMMM_MIPI_CTR   0x3014

Definition at line 185 of file ov9740.c.

#define OV9740_SENSOR_CTRL03   0x3703

Definition at line 84 of file ov9740.c.

#define OV9740_SENSOR_CTRL04   0x3704

Definition at line 85 of file ov9740.c.

#define OV9740_SENSOR_CTRL05   0x3705

Definition at line 86 of file ov9740.c.

#define OV9740_SENSOR_CTRL07   0x3707

Definition at line 87 of file ov9740.c.

#define OV9740_SMIA_VERSION   0x0004

Definition at line 30 of file ov9740.c.

#define OV9740_SOFTWARE_RESET   0x0103

Definition at line 35 of file ov9740.c.

#define OV9740_TIMING_CTRL17   0x3817

Definition at line 90 of file ov9740.c.

#define OV9740_TIMING_CTRL19   0x3819

Definition at line 91 of file ov9740.c.

#define OV9740_TIMING_CTRL33   0x3833

Definition at line 92 of file ov9740.c.

#define OV9740_TIMING_CTRL35   0x3835

Definition at line 93 of file ov9740.c.

#define OV9740_VFIFO_CTRL00   0x460e

Definition at line 139 of file ov9740.c.

#define OV9740_VFIFO_RD_CTRL   0x4601

Definition at line 183 of file ov9740.c.

#define OV9740_VFIFO_READ_START_HI   0x4608

Definition at line 124 of file ov9740.c.

#define OV9740_VFIFO_READ_START_LO   0x4609

Definition at line 125 of file ov9740.c.

#define OV9740_VT_PIX_CLK_DIV   0x0301

Definition at line 137 of file ov9740.c.

#define OV9740_VT_SYS_CLK_DIV   0x0303

Definition at line 136 of file ov9740.c.

#define OV9740_X_ADDR_END_HI   0x0348

Definition at line 48 of file ov9740.c.

#define OV9740_X_ADDR_END_LO   0x0349

Definition at line 49 of file ov9740.c.

#define OV9740_X_ADDR_START_HI   0x0344

Definition at line 44 of file ov9740.c.

#define OV9740_X_ADDR_START_LO   0x0345

Definition at line 45 of file ov9740.c.

#define OV9740_X_OUTPUT_SIZE_HI   0x034c

Definition at line 52 of file ov9740.c.

#define OV9740_X_OUTPUT_SIZE_LO   0x034d

Definition at line 53 of file ov9740.c.

#define OV9740_Y_ADDR_END_HI   0x034a

Definition at line 50 of file ov9740.c.

#define OV9740_Y_ADDR_END_LO   0x034b

Definition at line 51 of file ov9740.c.

#define OV9740_Y_ADDR_START_HI   0x0346

Definition at line 46 of file ov9740.c.

#define OV9740_Y_ADDR_START_LO   0x0347

Definition at line 47 of file ov9740.c.

#define OV9740_Y_OUTPUT_SIZE_HI   0x034e

Definition at line 54 of file ov9740.c.

#define OV9740_Y_OUTPUT_SIZE_LO   0x034f

Definition at line 55 of file ov9740.c.

#define to_ov9740 (   sd)    container_of(sd, struct ov9740_priv, subdev)

Definition at line 23 of file ov9740.c.

Function Documentation

MODULE_AUTHOR ( "Andrew Chew <[email protected]>"  )
MODULE_DESCRIPTION ( "SoC Camera driver for OmniVision OV9740"  )
MODULE_DEVICE_TABLE ( i2c  ,
ov9740_id   
)
module_i2c_driver ( ov9740_i2c_driver  )
MODULE_LICENSE ( "GPL v2 )