Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
s5k6aa.c File Reference
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/gpio.h>
#include <linux/i2c.h>
#include <linux/media.h>
#include <linux/module.h>
#include <linux/regulator/consumer.h>
#include <linux/slab.h>
#include <media/media-entity.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
#include <media/v4l2-subdev.h>
#include <media/v4l2-mediabus.h>
#include <media/s5k6aa.h>

Go to the source code of this file.

Data Structures

struct  s5k6aa_regval
 
struct  s5k6aa_pixfmt
 
struct  s5k6aa_preset
 
struct  s5k6aa_ctrls
 
struct  s5k6aa_interval
 
struct  s5k6aa
 

Macros

#define DRIVER_NAME   "S5K6AA"
 
#define S5K6AA_TERM   0xffff
 
#define S5K6AA_OUT_WIDTH_DEF   640
 
#define S5K6AA_OUT_HEIGHT_DEF   480
 
#define S5K6AA_WIN_WIDTH_MAX   1280
 
#define S5K6AA_WIN_HEIGHT_MAX   1024
 
#define S5K6AA_WIN_WIDTH_MIN   8
 
#define S5K6AA_WIN_HEIGHT_MIN   8
 
#define AHB_MSB_ADDR_PTR   0xfcfc
 
#define GEN_REG_OFFSH   0xd000
 
#define REG_CMDWR_ADDRH   0x0028
 
#define REG_CMDWR_ADDRL   0x002a
 
#define REG_CMDRD_ADDRH   0x002c
 
#define REG_CMDRD_ADDRL   0x002e
 
#define REG_CMDBUF0_ADDR   0x0f12
 
#define REG_CMDBUF1_ADDR   0x0f10
 
#define HOST_SWIF_OFFSH   0x7000
 
#define REG_I_INCLK_FREQ_L   0x01b8
 
#define REG_I_INCLK_FREQ_H   0x01ba
 
#define MIN_MCLK_FREQ_KHZ   6000U
 
#define MAX_MCLK_FREQ_KHZ   27000U
 
#define REG_I_USE_NPVI_CLOCKS   0x01c6
 
#define REG_I_USE_NMIPI_CLOCKS   0x01c8
 
#define REG_I_OPCLK_4KHZ(n)   ((n) * 6 + 0x01cc)
 
#define REG_I_MIN_OUTRATE_4KHZ(n)   ((n) * 6 + 0x01ce)
 
#define REG_I_MAX_OUTRATE_4KHZ(n)   ((n) * 6 + 0x01d0)
 
#define SYS_PLL_OUT_FREQ   (48000000 / 4000)
 
#define PCLK_FREQ_MIN   (24000000 / 4000)
 
#define PCLK_FREQ_MAX   (48000000 / 4000)
 
#define REG_I_INIT_PARAMS_UPDATED   0x01e0
 
#define REG_I_ERROR_INFO   0x01e2
 
#define REG_USER_BRIGHTNESS   0x01e4
 
#define REG_USER_CONTRAST   0x01e6
 
#define REG_USER_SATURATION   0x01e8
 
#define REG_USER_SHARPBLUR   0x01ea
 
#define REG_G_SPEC_EFFECTS   0x01ee
 
#define REG_G_ENABLE_PREV   0x01f0
 
#define REG_G_ENABLE_PREV_CHG   0x01f2
 
#define REG_G_NEW_CFG_SYNC   0x01f8
 
#define REG_G_PREVZOOM_IN_WIDTH   0x020a
 
#define REG_G_PREVZOOM_IN_HEIGHT   0x020c
 
#define REG_G_PREVZOOM_IN_XOFFS   0x020e
 
#define REG_G_PREVZOOM_IN_YOFFS   0x0210
 
#define REG_G_INPUTS_CHANGE_REQ   0x021a
 
#define REG_G_ACTIVE_PREV_CFG   0x021c
 
#define REG_G_PREV_CFG_CHG   0x021e
 
#define REG_G_PREV_OPEN_AFTER_CH   0x0220
 
#define REG_G_PREV_CFG_ERROR   0x0222
 
#define PREG(n, x)   ((n) * 0x26 + x)
 
#define REG_P_OUT_WIDTH(n)   PREG(n, 0x0242)
 
#define REG_P_OUT_HEIGHT(n)   PREG(n, 0x0244)
 
#define REG_P_FMT(n)   PREG(n, 0x0246)
 
#define REG_P_MAX_OUT_RATE(n)   PREG(n, 0x0248)
 
#define REG_P_MIN_OUT_RATE(n)   PREG(n, 0x024a)
 
#define REG_P_PVI_MASK(n)   PREG(n, 0x024c)
 
#define REG_P_CLK_INDEX(n)   PREG(n, 0x024e)
 
#define REG_P_FR_RATE_TYPE(n)   PREG(n, 0x0250)
 
#define FR_RATE_DYNAMIC   0
 
#define FR_RATE_FIXED   1
 
#define FR_RATE_FIXED_ACCURATE   2
 
#define REG_P_FR_RATE_Q_TYPE(n)   PREG(n, 0x0252)
 
#define FR_RATE_Q_BEST_FRRATE   1 /* Binning enabled */
 
#define FR_RATE_Q_BEST_QUALITY   2 /* Binning disabled */
 
#define REG_P_MAX_FR_TIME(n)   PREG(n, 0x0254)
 
#define REG_P_MIN_FR_TIME(n)   PREG(n, 0x0256)
 
#define US_TO_FR_TIME(__t)   ((__t) / 100)
 
#define S5K6AA_MIN_FR_TIME   33300 /* us */
 
#define S5K6AA_MAX_FR_TIME   650000 /* us */
 
#define S5K6AA_MAX_HIGHRES_FR_TIME   666 /* x100 us */
 
#define REG_P_COLORTEMP(n)   PREG(n, 0x025e)
 
#define REG_P_PREV_MIRROR(n)   PREG(n, 0x0262)
 
#define REG_SF_USR_EXPOSURE_L   0x03c6
 
#define REG_SF_USR_EXPOSURE_H   0x03c8
 
#define REG_SF_USR_EXPOSURE_CHG   0x03ca
 
#define REG_SF_USR_TOT_GAIN   0x03cc
 
#define REG_SF_USR_TOT_GAIN_CHG   0x03ce
 
#define REG_SF_RGAIN   0x03d0
 
#define REG_SF_RGAIN_CHG   0x03d2
 
#define REG_SF_GGAIN   0x03d4
 
#define REG_SF_GGAIN_CHG   0x03d6
 
#define REG_SF_BGAIN   0x03d8
 
#define REG_SF_BGAIN_CHG   0x03da
 
#define REG_SF_FLICKER_QUANT   0x03dc
 
#define REG_SF_FLICKER_QUANT_CHG   0x03de
 
#define REG_OIF_EN_MIPI_LANES   0x03fa
 
#define REG_OIF_EN_PACKETS   0x03fc
 
#define REG_OIF_CFG_CHG   0x03fe
 
#define REG_DBG_AUTOALG_EN   0x0400
 
#define AALG_ALL_EN_MASK   (1 << 0)
 
#define AALG_AE_EN_MASK   (1 << 1)
 
#define AALG_DIVLEI_EN_MASK   (1 << 2)
 
#define AALG_WB_EN_MASK   (1 << 3)
 
#define AALG_FLICKER_EN_MASK   (1 << 5)
 
#define AALG_FIT_EN_MASK   (1 << 6)
 
#define AALG_WRHW_EN_MASK   (1 << 7)
 
#define REG_FW_APIVER   0x012e
 
#define S5K6AAFX_FW_APIVER   0x0001
 
#define REG_FW_REVISION   0x0130
 
#define S5K6AA_MAX_PRESETS   1
 
#define S5K6AA_NUM_SUPPLIES   ARRAY_SIZE(s5k6aa_supply_names)
 
#define S5K6AA_INTERVAL_DEF_INDEX   1 /* 15 fps */
 
#define V4L2_CID_RED_GAIN   (V4L2_CTRL_CLASS_CAMERA | 0x1001)
 
#define V4L2_CID_GREEN_GAIN   (V4L2_CTRL_CLASS_CAMERA | 0x1002)
 
#define V4L2_CID_BLUE_GAIN   (V4L2_CTRL_CLASS_CAMERA | 0x1003)
 

Enumerations

enum  s5k6aa_gpio_id { STBY, RST, GPIO_NUM }
 

Functions

 module_param (debug, int, 0644)
 
 MODULE_DEVICE_TABLE (i2c, s5k6aa_id)
 
 module_i2c_driver (s5k6aa_i2c_driver)
 
 MODULE_DESCRIPTION ("Samsung S5K6AA(FX) SXGA camera driver")
 
 MODULE_AUTHOR ("Sylwester Nawrocki <[email protected]>")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define AALG_AE_EN_MASK   (1 << 1)

Definition at line 157 of file s5k6aa.c.

#define AALG_ALL_EN_MASK   (1 << 0)

Definition at line 156 of file s5k6aa.c.

#define AALG_DIVLEI_EN_MASK   (1 << 2)

Definition at line 158 of file s5k6aa.c.

#define AALG_FIT_EN_MASK   (1 << 6)

Definition at line 161 of file s5k6aa.c.

#define AALG_FLICKER_EN_MASK   (1 << 5)

Definition at line 160 of file s5k6aa.c.

#define AALG_WB_EN_MASK   (1 << 3)

Definition at line 159 of file s5k6aa.c.

#define AALG_WRHW_EN_MASK   (1 << 7)

Definition at line 162 of file s5k6aa.c.

#define AHB_MSB_ADDR_PTR   0xfcfc

Definition at line 50 of file s5k6aa.c.

#define DRIVER_NAME   "S5K6AA"

Definition at line 36 of file s5k6aa.c.

#define FR_RATE_DYNAMIC   0

Definition at line 115 of file s5k6aa.c.

#define FR_RATE_FIXED   1

Definition at line 116 of file s5k6aa.c.

#define FR_RATE_FIXED_ACCURATE   2

Definition at line 117 of file s5k6aa.c.

#define FR_RATE_Q_BEST_FRRATE   1 /* Binning enabled */

Definition at line 119 of file s5k6aa.c.

#define FR_RATE_Q_BEST_QUALITY   2 /* Binning disabled */

Definition at line 120 of file s5k6aa.c.

#define GEN_REG_OFFSH   0xd000

Definition at line 51 of file s5k6aa.c.

#define HOST_SWIF_OFFSH   0x7000

Definition at line 64 of file s5k6aa.c.

#define MAX_MCLK_FREQ_KHZ   27000U

Definition at line 71 of file s5k6aa.c.

#define MIN_MCLK_FREQ_KHZ   6000U

Definition at line 70 of file s5k6aa.c.

#define PCLK_FREQ_MAX   (48000000 / 4000)

Definition at line 81 of file s5k6aa.c.

#define PCLK_FREQ_MIN   (24000000 / 4000)

Definition at line 80 of file s5k6aa.c.

#define PREG (   n,
  x 
)    ((n) * 0x26 + x)

Definition at line 106 of file s5k6aa.c.

#define REG_CMDBUF0_ADDR   0x0f12

Definition at line 56 of file s5k6aa.c.

#define REG_CMDBUF1_ADDR   0x0f10

Definition at line 57 of file s5k6aa.c.

#define REG_CMDRD_ADDRH   0x002c

Definition at line 54 of file s5k6aa.c.

#define REG_CMDRD_ADDRL   0x002e

Definition at line 55 of file s5k6aa.c.

#define REG_CMDWR_ADDRH   0x0028

Definition at line 52 of file s5k6aa.c.

#define REG_CMDWR_ADDRL   0x002a

Definition at line 53 of file s5k6aa.c.

#define REG_DBG_AUTOALG_EN   0x0400

Definition at line 155 of file s5k6aa.c.

#define REG_FW_APIVER   0x012e

Definition at line 165 of file s5k6aa.c.

#define REG_FW_REVISION   0x0130

Definition at line 167 of file s5k6aa.c.

#define REG_G_ACTIVE_PREV_CFG   0x021c

Definition at line 100 of file s5k6aa.c.

#define REG_G_ENABLE_PREV   0x01f0

Definition at line 92 of file s5k6aa.c.

#define REG_G_ENABLE_PREV_CHG   0x01f2

Definition at line 93 of file s5k6aa.c.

#define REG_G_INPUTS_CHANGE_REQ   0x021a

Definition at line 99 of file s5k6aa.c.

#define REG_G_NEW_CFG_SYNC   0x01f8

Definition at line 94 of file s5k6aa.c.

#define REG_G_PREV_CFG_CHG   0x021e

Definition at line 101 of file s5k6aa.c.

#define REG_G_PREV_CFG_ERROR   0x0222

Definition at line 103 of file s5k6aa.c.

#define REG_G_PREV_OPEN_AFTER_CH   0x0220

Definition at line 102 of file s5k6aa.c.

#define REG_G_PREVZOOM_IN_HEIGHT   0x020c

Definition at line 96 of file s5k6aa.c.

#define REG_G_PREVZOOM_IN_WIDTH   0x020a

Definition at line 95 of file s5k6aa.c.

#define REG_G_PREVZOOM_IN_XOFFS   0x020e

Definition at line 97 of file s5k6aa.c.

#define REG_G_PREVZOOM_IN_YOFFS   0x0210

Definition at line 98 of file s5k6aa.c.

#define REG_G_SPEC_EFFECTS   0x01ee

Definition at line 91 of file s5k6aa.c.

#define REG_I_ERROR_INFO   0x01e2

Definition at line 83 of file s5k6aa.c.

#define REG_I_INCLK_FREQ_H   0x01ba

Definition at line 69 of file s5k6aa.c.

#define REG_I_INCLK_FREQ_L   0x01b8

Definition at line 68 of file s5k6aa.c.

#define REG_I_INIT_PARAMS_UPDATED   0x01e0

Definition at line 82 of file s5k6aa.c.

#define REG_I_MAX_OUTRATE_4KHZ (   n)    ((n) * 6 + 0x01d0)

Definition at line 78 of file s5k6aa.c.

#define REG_I_MIN_OUTRATE_4KHZ (   n)    ((n) * 6 + 0x01ce)

Definition at line 77 of file s5k6aa.c.

#define REG_I_OPCLK_4KHZ (   n)    ((n) * 6 + 0x01cc)

Definition at line 76 of file s5k6aa.c.

#define REG_I_USE_NMIPI_CLOCKS   0x01c8

Definition at line 73 of file s5k6aa.c.

#define REG_I_USE_NPVI_CLOCKS   0x01c6

Definition at line 72 of file s5k6aa.c.

#define REG_OIF_CFG_CHG   0x03fe

Definition at line 152 of file s5k6aa.c.

#define REG_OIF_EN_MIPI_LANES   0x03fa

Definition at line 150 of file s5k6aa.c.

#define REG_OIF_EN_PACKETS   0x03fc

Definition at line 151 of file s5k6aa.c.

#define REG_P_CLK_INDEX (   n)    PREG(n, 0x024e)

Definition at line 113 of file s5k6aa.c.

#define REG_P_COLORTEMP (   n)    PREG(n, 0x025e)

Definition at line 130 of file s5k6aa.c.

#define REG_P_FMT (   n)    PREG(n, 0x0246)

Definition at line 109 of file s5k6aa.c.

#define REG_P_FR_RATE_Q_TYPE (   n)    PREG(n, 0x0252)

Definition at line 118 of file s5k6aa.c.

#define REG_P_FR_RATE_TYPE (   n)    PREG(n, 0x0250)

Definition at line 114 of file s5k6aa.c.

#define REG_P_MAX_FR_TIME (   n)    PREG(n, 0x0254)

Definition at line 122 of file s5k6aa.c.

#define REG_P_MAX_OUT_RATE (   n)    PREG(n, 0x0248)

Definition at line 110 of file s5k6aa.c.

#define REG_P_MIN_FR_TIME (   n)    PREG(n, 0x0256)

Definition at line 123 of file s5k6aa.c.

#define REG_P_MIN_OUT_RATE (   n)    PREG(n, 0x024a)

Definition at line 111 of file s5k6aa.c.

#define REG_P_OUT_HEIGHT (   n)    PREG(n, 0x0244)

Definition at line 108 of file s5k6aa.c.

#define REG_P_OUT_WIDTH (   n)    PREG(n, 0x0242)

Definition at line 107 of file s5k6aa.c.

#define REG_P_PREV_MIRROR (   n)    PREG(n, 0x0262)

Definition at line 131 of file s5k6aa.c.

#define REG_P_PVI_MASK (   n)    PREG(n, 0x024c)

Definition at line 112 of file s5k6aa.c.

#define REG_SF_BGAIN   0x03d8

Definition at line 144 of file s5k6aa.c.

#define REG_SF_BGAIN_CHG   0x03da

Definition at line 145 of file s5k6aa.c.

#define REG_SF_FLICKER_QUANT   0x03dc

Definition at line 146 of file s5k6aa.c.

#define REG_SF_FLICKER_QUANT_CHG   0x03de

Definition at line 147 of file s5k6aa.c.

#define REG_SF_GGAIN   0x03d4

Definition at line 142 of file s5k6aa.c.

#define REG_SF_GGAIN_CHG   0x03d6

Definition at line 143 of file s5k6aa.c.

#define REG_SF_RGAIN   0x03d0

Definition at line 140 of file s5k6aa.c.

#define REG_SF_RGAIN_CHG   0x03d2

Definition at line 141 of file s5k6aa.c.

#define REG_SF_USR_EXPOSURE_CHG   0x03ca

Definition at line 137 of file s5k6aa.c.

#define REG_SF_USR_EXPOSURE_H   0x03c8

Definition at line 136 of file s5k6aa.c.

#define REG_SF_USR_EXPOSURE_L   0x03c6

Definition at line 135 of file s5k6aa.c.

#define REG_SF_USR_TOT_GAIN   0x03cc

Definition at line 138 of file s5k6aa.c.

#define REG_SF_USR_TOT_GAIN_CHG   0x03ce

Definition at line 139 of file s5k6aa.c.

#define REG_USER_BRIGHTNESS   0x01e4

Definition at line 86 of file s5k6aa.c.

#define REG_USER_CONTRAST   0x01e6

Definition at line 87 of file s5k6aa.c.

#define REG_USER_SATURATION   0x01e8

Definition at line 88 of file s5k6aa.c.

#define REG_USER_SHARPBLUR   0x01ea

Definition at line 89 of file s5k6aa.c.

#define S5K6AA_INTERVAL_DEF_INDEX   1 /* 15 fps */

Definition at line 302 of file s5k6aa.c.

#define S5K6AA_MAX_FR_TIME   650000 /* us */

Definition at line 127 of file s5k6aa.c.

#define S5K6AA_MAX_HIGHRES_FR_TIME   666 /* x100 us */

Definition at line 128 of file s5k6aa.c.

#define S5K6AA_MAX_PRESETS   1

Definition at line 170 of file s5k6aa.c.

#define S5K6AA_MIN_FR_TIME   33300 /* us */

Definition at line 126 of file s5k6aa.c.

#define S5K6AA_NUM_SUPPLIES   ARRAY_SIZE(s5k6aa_supply_names)

Definition at line 180 of file s5k6aa.c.

#define S5K6AA_OUT_HEIGHT_DEF   480

Definition at line 41 of file s5k6aa.c.

#define S5K6AA_OUT_WIDTH_DEF   640

Definition at line 40 of file s5k6aa.c.

#define S5K6AA_TERM   0xffff

Definition at line 39 of file s5k6aa.c.

#define S5K6AA_WIN_HEIGHT_MAX   1024

Definition at line 43 of file s5k6aa.c.

#define S5K6AA_WIN_HEIGHT_MIN   8

Definition at line 45 of file s5k6aa.c.

#define S5K6AA_WIN_WIDTH_MAX   1280

Definition at line 42 of file s5k6aa.c.

#define S5K6AA_WIN_WIDTH_MIN   8

Definition at line 44 of file s5k6aa.c.

#define S5K6AAFX_FW_APIVER   0x0001

Definition at line 166 of file s5k6aa.c.

#define SYS_PLL_OUT_FREQ   (48000000 / 4000)

Definition at line 79 of file s5k6aa.c.

#define US_TO_FR_TIME (   __t)    ((__t) / 100)

Definition at line 125 of file s5k6aa.c.

#define V4L2_CID_BLUE_GAIN   (V4L2_CTRL_CLASS_CAMERA | 0x1003)

Definition at line 1324 of file s5k6aa.c.

#define V4L2_CID_GREEN_GAIN   (V4L2_CTRL_CLASS_CAMERA | 0x1002)

Definition at line 1323 of file s5k6aa.c.

#define V4L2_CID_RED_GAIN   (V4L2_CTRL_CLASS_CAMERA | 0x1001)

Definition at line 1322 of file s5k6aa.c.

Enumeration Type Documentation

Enumerator:
STBY 
RST 
GPIO_NUM 

Definition at line 182 of file s5k6aa.c.

Function Documentation

MODULE_AUTHOR ( "Sylwester Nawrocki <[email protected]>"  )
MODULE_DESCRIPTION ( "Samsung S5K6AA(FX) SXGA camera driver )
MODULE_DEVICE_TABLE ( i2c  ,
s5k6aa_id   
)
module_i2c_driver ( s5k6aa_i2c_driver  )
MODULE_LICENSE ( "GPL"  )
module_param ( debug  ,
int  ,
0644   
)