Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
m5mols.h File Reference
#include <linux/sizes.h>
#include <media/v4l2-subdev.h>
#include "m5mols_reg.h"

Go to the source code of this file.

Data Structures

struct  m5mols_resolution
 
struct  m5mols_exif
 
struct  m5mols_capture
 
struct  m5mols_scenemode
 
struct  m5mols_version
 
struct  m5mols_info
 

Macros

#define M5MOLS_JPEG_TAGS_SIZE   0x20000
 
#define M5MOLS_MAIN_JPEG_SIZE_MAX   (5 * SZ_1M)
 
#define VERSION_STRING_SIZE   22
 
#define is_available_af(__info)   (__info->ver.af)
 
#define is_code(__code, __type)   (__code == m5mols_default_ffmt[__type].code)
 
#define is_manufacturer(__info, __manufacturer)
 
#define M5MOLS_I2C_RDY_WAIT_FL   (1 << 16)
 
#define M5MOLS_MODE_CHANGE_TIMEOUT   200
 
#define M5MOLS_BUSY_WAIT_DEF_TIMEOUT   250
 

Enumerations

enum  m5mols_restype { M5MOLS_RESTYPE_MONITOR, M5MOLS_RESTYPE_CAPTURE, M5MOLS_RESTYPE_MAX }
 

Functions

int m5mols_read_u8 (struct v4l2_subdev *sd, u32 reg_comb, u8 *val)
 
int m5mols_read_u16 (struct v4l2_subdev *sd, u32 reg_comb, u16 *val)
 
int m5mols_read_u32 (struct v4l2_subdev *sd, u32 reg_comb, u32 *val)
 
int m5mols_write (struct v4l2_subdev *sd, u32 reg_comb, u32 val)
 
int m5mols_busy_wait (struct v4l2_subdev *sd, u32 reg, u32 value, u32 mask, int timeout)
 
int m5mols_set_mode (struct m5mols_info *info, u8 mode)
 
int m5mols_enable_interrupt (struct v4l2_subdev *sd, u8 reg)
 
int m5mols_wait_interrupt (struct v4l2_subdev *sd, u8 condition, u32 timeout)
 
int m5mols_restore_controls (struct m5mols_info *info)
 
int m5mols_start_capture (struct m5mols_info *info)
 
int m5mols_do_scenemode (struct m5mols_info *info, u8 mode)
 
int m5mols_lock_3a (struct m5mols_info *info, bool lock)
 
int m5mols_set_ctrl (struct v4l2_ctrl *ctrl)
 
int m5mols_init_controls (struct v4l2_subdev *sd)
 
int m5mols_update_fw (struct v4l2_subdev *sd, int(*set_power)(struct m5mols_info *, bool))
 

Variables

int m5mols_debug
 

Macro Definition Documentation

#define is_available_af (   __info)    (__info->ver.af)

Definition at line 246 of file m5mols.h.

#define is_code (   __code,
  __type 
)    (__code == m5mols_default_ffmt[__type].code)

Definition at line 247 of file m5mols.h.

#define is_manufacturer (   __info,
  __manufacturer 
)
Value:
(__info->ver.str[0] == __manufacturer[0] && \
__info->ver.str[1] == __manufacturer[1])

Definition at line 248 of file m5mols.h.

#define M5MOLS_BUSY_WAIT_DEF_TIMEOUT   250

Definition at line 288 of file m5mols.h.

#define M5MOLS_I2C_RDY_WAIT_FL   (1 << 16)

Definition at line 285 of file m5mols.h.

#define M5MOLS_JPEG_TAGS_SIZE   0x20000

Definition at line 27 of file m5mols.h.

#define M5MOLS_MAIN_JPEG_SIZE_MAX   (5 * SZ_1M)

Definition at line 28 of file m5mols.h.

#define M5MOLS_MODE_CHANGE_TIMEOUT   200

Definition at line 287 of file m5mols.h.

#define VERSION_STRING_SIZE   22

struct m5mols_version - firmware version information : customer information : version of project information according to customer : firmware revision : hardware revision

Parameters
version of the parameter : Auto WhiteBalance algorithm version : information about manufacturer and packaging vendor : Auto Focus version

The register offset starts the customer version at 0x0, and it ends the awb version at 0x09. The customer, project information occupies 1 bytes each. And also the fw, hw, param, awb each requires 2 bytes. The str is unique string associated with firmware's version. It includes information about manufacturer and the vendor of the sensor's packaging. The least significant 2 bytes of the string indicate packaging manufacturer.

Definition at line 151 of file m5mols.h.

Enumeration Type Documentation

Enumerator:
M5MOLS_RESTYPE_MONITOR 
M5MOLS_RESTYPE_CAPTURE 
M5MOLS_RESTYPE_MAX 

Definition at line 32 of file m5mols.h.

Function Documentation

int m5mols_busy_wait ( struct v4l2_subdev sd,
u32  reg,
u32  value,
u32  mask,
int  timeout 
)

m5mols_busy_wait - Busy waiting with I2C register polling : the I2C_REG() address of an 8-bit status register to check : expected status register value : bit mask for the read status register value : timeout in miliseconds, or -1 for default timeout

The register value is ORed with before comparing with .

Return: 0 if the requested condition became true within less than ms, or else negative errno.

Definition at line 296 of file m5mols_core.c.

int m5mols_do_scenemode ( struct m5mols_info info,
u8  mode 
)

m5mols_do_scenemode() - Change current scenemode : Desired mode of the scenemode

WARNING: The execution order is important. Do not change the order.

Definition at line 133 of file m5mols_controls.c.

int m5mols_enable_interrupt ( struct v4l2_subdev sd,
u8  reg 
)

m5mols_enable_interrupt - Clear interrupt pending bits and unmask interrupts

Before writing desired interrupt value the INT_FACTOR register should be read to clear pending interrupts.

Definition at line 322 of file m5mols_core.c.

int m5mols_init_controls ( struct v4l2_subdev sd)

Definition at line 540 of file m5mols_controls.c.

int m5mols_lock_3a ( struct m5mols_info info,
bool  lock 
)
int m5mols_read_u16 ( struct v4l2_subdev sd,
u32  reg_comb,
u16 val 
)

Definition at line 205 of file m5mols_core.c.

int m5mols_read_u32 ( struct v4l2_subdev sd,
u32  reg_comb,
u32 val 
)

Definition at line 223 of file m5mols_core.c.

int m5mols_read_u8 ( struct v4l2_subdev sd,
u32  reg_comb,
u8 val 
)

Definition at line 187 of file m5mols_core.c.

int m5mols_restore_controls ( struct m5mols_info info)
int m5mols_set_ctrl ( struct v4l2_ctrl ctrl)
int m5mols_set_mode ( struct m5mols_info info,
u8  mode 
)

m5mols_set_mode - set the M-5MOLS controller mode : the required operation mode

The commands of M-5MOLS are grouped into specific modes. Each functionality can be guaranteed only when the sensor is operating in mode which a command belongs to.

Definition at line 372 of file m5mols_core.c.

int m5mols_start_capture ( struct m5mols_info info)

Definition at line 106 of file m5mols_capture.c.

int m5mols_update_fw ( struct v4l2_subdev sd,
int(*)(struct m5mols_info *, bool set_power 
)
int m5mols_wait_interrupt ( struct v4l2_subdev sd,
u8  condition,
u32  timeout 
)

Definition at line 335 of file m5mols_core.c.

int m5mols_write ( struct v4l2_subdev sd,
u32  reg,
u32  val 
)

m5mols_write - I2C command write function : combination of size, category and command for the I2C packet : value to write

Returns 0 on success, or else negative errno.

Definition at line 240 of file m5mols_core.c.

Variable Documentation

int m5mols_debug

Definition at line 33 of file m5mols_core.c.