Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
ov6650.c File Reference
#include <linux/bitops.h>
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/v4l2-mediabus.h>
#include <linux/module.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  ov6650_reg
 
struct  ov6650
 

Macros

#define REG_GAIN   0x00 /* range 00 - 3F */
 
#define REG_BLUE   0x01
 
#define REG_RED   0x02
 
#define REG_SAT   0x03 /* [7:4] saturation [0:3] reserved */
 
#define REG_HUE   0x04 /* [7:6] rsrvd [5] hue en [4:0] hue */
 
#define REG_BRT   0x06
 
#define REG_PIDH   0x0a
 
#define REG_PIDL   0x0b
 
#define REG_AECH   0x10
 
#define REG_CLKRC   0x11 /* Data Format and Internal Clock */
 
#define REG_COMA   0x12 /* [7] Reset */
 
#define REG_COMB   0x13
 
#define REG_COMC   0x14
 
#define REG_COMD   0x15
 
#define REG_COML   0x16
 
#define REG_HSTRT   0x17
 
#define REG_HSTOP   0x18
 
#define REG_VSTRT   0x19
 
#define REG_VSTOP   0x1a
 
#define REG_PSHFT   0x1b
 
#define REG_MIDH   0x1c
 
#define REG_MIDL   0x1d
 
#define REG_HSYNS   0x1e
 
#define REG_HSYNE   0x1f
 
#define REG_COME   0x20
 
#define REG_YOFF   0x21
 
#define REG_UOFF   0x22
 
#define REG_VOFF   0x23
 
#define REG_AEW   0x24
 
#define REG_AEB   0x25
 
#define REG_COMF   0x26
 
#define REG_COMG   0x27
 
#define REG_COMH   0x28
 
#define REG_COMI   0x29
 
#define REG_FRARL   0x2b
 
#define REG_COMJ   0x2c
 
#define REG_COMK   0x2d
 
#define REG_AVGY   0x2e
 
#define REG_REF0   0x2f
 
#define REG_REF1   0x30
 
#define REG_REF2   0x31
 
#define REG_FRAJH   0x32
 
#define REG_FRAJL   0x33
 
#define REG_FACT   0x34
 
#define REG_L1AEC   0x35
 
#define REG_AVGU   0x36
 
#define REG_AVGV   0x37
 
#define REG_SPCB   0x60
 
#define REG_SPCC   0x61
 
#define REG_GAM1   0x62
 
#define REG_GAM2   0x63
 
#define REG_GAM3   0x64
 
#define REG_SPCD   0x65
 
#define REG_SPCE   0x68
 
#define REG_ADCL   0x69
 
#define REG_RMCO   0x6c
 
#define REG_GMCO   0x6d
 
#define REG_BMCO   0x6e
 
#define OV6650_PIDH   0x66 /* high byte of product ID number */
 
#define OV6650_PIDL   0x50 /* low byte of product ID number */
 
#define OV6650_MIDH   0x7F /* high byte of mfg ID */
 
#define OV6650_MIDL   0xA2 /* low byte of mfg ID */
 
#define DEF_GAIN   0x00
 
#define DEF_BLUE   0x80
 
#define DEF_RED   0x80
 
#define SAT_SHIFT   4
 
#define SAT_MASK   (0xf << SAT_SHIFT)
 
#define SET_SAT(x)   (((x) << SAT_SHIFT) & SAT_MASK)
 
#define HUE_EN   BIT(5)
 
#define HUE_MASK   0x1f
 
#define DEF_HUE   0x10
 
#define SET_HUE(x)   (HUE_EN | ((x) & HUE_MASK))
 
#define DEF_AECH   0x4D
 
#define CLKRC_6MHz   0x00
 
#define CLKRC_12MHz   0x40
 
#define CLKRC_16MHz   0x80
 
#define CLKRC_24MHz   0xc0
 
#define CLKRC_DIV_MASK   0x3f
 
#define GET_CLKRC_DIV(x)   (((x) & CLKRC_DIV_MASK) + 1)
 
#define COMA_RESET   BIT(7)
 
#define COMA_QCIF   BIT(5)
 
#define COMA_RAW_RGB   BIT(4)
 
#define COMA_RGB   BIT(3)
 
#define COMA_BW   BIT(2)
 
#define COMA_WORD_SWAP   BIT(1)
 
#define COMA_BYTE_SWAP   BIT(0)
 
#define DEF_COMA   0x00
 
#define COMB_FLIP_V   BIT(7)
 
#define COMB_FLIP_H   BIT(5)
 
#define COMB_BAND_FILTER   BIT(4)
 
#define COMB_AWB   BIT(2)
 
#define COMB_AGC   BIT(1)
 
#define COMB_AEC   BIT(0)
 
#define DEF_COMB   0x5f
 
#define COML_ONE_CHANNEL   BIT(7)
 
#define DEF_HSTRT   0x24
 
#define DEF_HSTOP   0xd4
 
#define DEF_VSTRT   0x04
 
#define DEF_VSTOP   0x94
 
#define COMF_HREF_LOW   BIT(4)
 
#define COMJ_PCLK_RISING   BIT(4)
 
#define COMJ_VSYNC_HIGH   BIT(0)
 
#define W_QCIF   (DEF_HSTOP - DEF_HSTRT)
 
#define W_CIF   (W_QCIF << 1)
 
#define H_QCIF   (DEF_VSTOP - DEF_VSTRT)
 
#define H_CIF   (H_QCIF << 1)
 
#define FRAME_RATE_MAX   30
 

Functions

 MODULE_DEVICE_TABLE (i2c, ov6650_id)
 
 module_i2c_driver (ov6650_i2c_driver)
 
 MODULE_DESCRIPTION ("SoC Camera driver for OmniVision OV6650")
 
 MODULE_AUTHOR ("Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>")
 
 MODULE_LICENSE ("GPL v2")
 

Macro Definition Documentation

#define CLKRC_12MHz   0x40

Definition at line 131 of file ov6650.c.

#define CLKRC_16MHz   0x80

Definition at line 132 of file ov6650.c.

#define CLKRC_24MHz   0xc0

Definition at line 133 of file ov6650.c.

#define CLKRC_6MHz   0x00

Definition at line 130 of file ov6650.c.

#define CLKRC_DIV_MASK   0x3f

Definition at line 134 of file ov6650.c.

#define COMA_BW   BIT(2)

Definition at line 141 of file ov6650.c.

#define COMA_BYTE_SWAP   BIT(0)

Definition at line 143 of file ov6650.c.

#define COMA_QCIF   BIT(5)

Definition at line 138 of file ov6650.c.

#define COMA_RAW_RGB   BIT(4)

Definition at line 139 of file ov6650.c.

#define COMA_RESET   BIT(7)

Definition at line 137 of file ov6650.c.

#define COMA_RGB   BIT(3)

Definition at line 140 of file ov6650.c.

#define COMA_WORD_SWAP   BIT(1)

Definition at line 142 of file ov6650.c.

#define COMB_AEC   BIT(0)

Definition at line 151 of file ov6650.c.

#define COMB_AGC   BIT(1)

Definition at line 150 of file ov6650.c.

#define COMB_AWB   BIT(2)

Definition at line 149 of file ov6650.c.

#define COMB_BAND_FILTER   BIT(4)

Definition at line 148 of file ov6650.c.

#define COMB_FLIP_H   BIT(5)

Definition at line 147 of file ov6650.c.

#define COMB_FLIP_V   BIT(7)

Definition at line 146 of file ov6650.c.

#define COMF_HREF_LOW   BIT(4)

Definition at line 161 of file ov6650.c.

#define COMJ_PCLK_RISING   BIT(4)

Definition at line 163 of file ov6650.c.

#define COMJ_VSYNC_HIGH   BIT(0)

Definition at line 164 of file ov6650.c.

#define COML_ONE_CHANNEL   BIT(7)

Definition at line 154 of file ov6650.c.

#define DEF_AECH   0x4D

Definition at line 128 of file ov6650.c.

#define DEF_BLUE   0x80

Definition at line 116 of file ov6650.c.

#define DEF_COMA   0x00

Definition at line 144 of file ov6650.c.

#define DEF_COMB   0x5f

Definition at line 152 of file ov6650.c.

#define DEF_GAIN   0x00

Definition at line 115 of file ov6650.c.

#define DEF_HSTOP   0xd4

Definition at line 157 of file ov6650.c.

#define DEF_HSTRT   0x24

Definition at line 156 of file ov6650.c.

#define DEF_HUE   0x10

Definition at line 125 of file ov6650.c.

#define DEF_RED   0x80

Definition at line 117 of file ov6650.c.

#define DEF_VSTOP   0x94

Definition at line 159 of file ov6650.c.

#define DEF_VSTRT   0x04

Definition at line 158 of file ov6650.c.

#define FRAME_RATE_MAX   30

Definition at line 172 of file ov6650.c.

#define GET_CLKRC_DIV (   x)    (((x) & CLKRC_DIV_MASK) + 1)

Definition at line 135 of file ov6650.c.

#define H_CIF   (H_QCIF << 1)

Definition at line 170 of file ov6650.c.

#define H_QCIF   (DEF_VSTOP - DEF_VSTRT)

Definition at line 169 of file ov6650.c.

#define HUE_EN   BIT(5)

Definition at line 123 of file ov6650.c.

#define HUE_MASK   0x1f

Definition at line 124 of file ov6650.c.

#define OV6650_MIDH   0x7F /* high byte of mfg ID */

Definition at line 112 of file ov6650.c.

#define OV6650_MIDL   0xA2 /* low byte of mfg ID */

Definition at line 113 of file ov6650.c.

#define OV6650_PIDH   0x66 /* high byte of product ID number */

Definition at line 110 of file ov6650.c.

#define OV6650_PIDL   0x50 /* low byte of product ID number */

Definition at line 111 of file ov6650.c.

#define REG_ADCL   0x69

Definition at line 102 of file ov6650.c.

#define REG_AEB   0x25

Definition at line 74 of file ov6650.c.

#define REG_AECH   0x10

Definition at line 50 of file ov6650.c.

#define REG_AEW   0x24

Definition at line 73 of file ov6650.c.

#define REG_AVGU   0x36

Definition at line 91 of file ov6650.c.

#define REG_AVGV   0x37

Definition at line 92 of file ov6650.c.

#define REG_AVGY   0x2e

Definition at line 83 of file ov6650.c.

#define REG_BLUE   0x01

Definition at line 40 of file ov6650.c.

#define REG_BMCO   0x6e

Definition at line 106 of file ov6650.c.

#define REG_BRT   0x06

Definition at line 45 of file ov6650.c.

#define REG_CLKRC   0x11 /* Data Format and Internal Clock */

Definition at line 51 of file ov6650.c.

#define REG_COMA   0x12 /* [7] Reset */

Definition at line 55 of file ov6650.c.

#define REG_COMB   0x13

Definition at line 56 of file ov6650.c.

#define REG_COMC   0x14

Definition at line 57 of file ov6650.c.

#define REG_COMD   0x15

Definition at line 58 of file ov6650.c.

#define REG_COME   0x20

Definition at line 69 of file ov6650.c.

#define REG_COMF   0x26

Definition at line 75 of file ov6650.c.

#define REG_COMG   0x27

Definition at line 76 of file ov6650.c.

#define REG_COMH   0x28

Definition at line 77 of file ov6650.c.

#define REG_COMI   0x29

Definition at line 78 of file ov6650.c.

#define REG_COMJ   0x2c

Definition at line 81 of file ov6650.c.

#define REG_COMK   0x2d

Definition at line 82 of file ov6650.c.

#define REG_COML   0x16

Definition at line 59 of file ov6650.c.

#define REG_FACT   0x34

Definition at line 89 of file ov6650.c.

#define REG_FRAJH   0x32

Definition at line 87 of file ov6650.c.

#define REG_FRAJL   0x33

Definition at line 88 of file ov6650.c.

#define REG_FRARL   0x2b

Definition at line 80 of file ov6650.c.

#define REG_GAIN   0x00 /* range 00 - 3F */

Definition at line 39 of file ov6650.c.

#define REG_GAM1   0x62

Definition at line 96 of file ov6650.c.

#define REG_GAM2   0x63

Definition at line 97 of file ov6650.c.

#define REG_GAM3   0x64

Definition at line 98 of file ov6650.c.

#define REG_GMCO   0x6d

Definition at line 105 of file ov6650.c.

#define REG_HSTOP   0x18

Definition at line 61 of file ov6650.c.

#define REG_HSTRT   0x17

Definition at line 60 of file ov6650.c.

#define REG_HSYNE   0x1f

Definition at line 68 of file ov6650.c.

#define REG_HSYNS   0x1e

Definition at line 67 of file ov6650.c.

#define REG_HUE   0x04 /* [7:6] rsrvd [5] hue en [4:0] hue */

Definition at line 43 of file ov6650.c.

#define REG_L1AEC   0x35

Definition at line 90 of file ov6650.c.

#define REG_MIDH   0x1c

Definition at line 65 of file ov6650.c.

#define REG_MIDL   0x1d

Definition at line 66 of file ov6650.c.

#define REG_PIDH   0x0a

Definition at line 47 of file ov6650.c.

#define REG_PIDL   0x0b

Definition at line 48 of file ov6650.c.

#define REG_PSHFT   0x1b

Definition at line 64 of file ov6650.c.

#define REG_RED   0x02

Definition at line 41 of file ov6650.c.

#define REG_REF0   0x2f

Definition at line 84 of file ov6650.c.

#define REG_REF1   0x30

Definition at line 85 of file ov6650.c.

#define REG_REF2   0x31

Definition at line 86 of file ov6650.c.

#define REG_RMCO   0x6c

Definition at line 104 of file ov6650.c.

#define REG_SAT   0x03 /* [7:4] saturation [0:3] reserved */

Definition at line 42 of file ov6650.c.

#define REG_SPCB   0x60

Definition at line 94 of file ov6650.c.

#define REG_SPCC   0x61

Definition at line 95 of file ov6650.c.

#define REG_SPCD   0x65

Definition at line 99 of file ov6650.c.

#define REG_SPCE   0x68

Definition at line 101 of file ov6650.c.

#define REG_UOFF   0x22

Definition at line 71 of file ov6650.c.

#define REG_VOFF   0x23

Definition at line 72 of file ov6650.c.

#define REG_VSTOP   0x1a

Definition at line 63 of file ov6650.c.

#define REG_VSTRT   0x19

Definition at line 62 of file ov6650.c.

#define REG_YOFF   0x21

Definition at line 70 of file ov6650.c.

#define SAT_MASK   (0xf << SAT_SHIFT)

Definition at line 120 of file ov6650.c.

#define SAT_SHIFT   4

Definition at line 119 of file ov6650.c.

#define SET_HUE (   x)    (HUE_EN | ((x) & HUE_MASK))

Definition at line 126 of file ov6650.c.

#define SET_SAT (   x)    (((x) << SAT_SHIFT) & SAT_MASK)

Definition at line 121 of file ov6650.c.

#define W_CIF   (W_QCIF << 1)

Definition at line 168 of file ov6650.c.

#define W_QCIF   (DEF_HSTOP - DEF_HSTRT)

Definition at line 167 of file ov6650.c.

Function Documentation

MODULE_AUTHOR ( "Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>"  )
MODULE_DESCRIPTION ( "SoC Camera driver for OmniVision OV6650"  )
MODULE_DEVICE_TABLE ( i2c  ,
ov6650_id   
)
module_i2c_driver ( ov6650_i2c_driver  )
MODULE_LICENSE ( "GPL v2 )