linux/drivers/media/video/mxc/capture/mt9v111.c File Reference

mt9v111 camera driver functions More...

Data Structures

struct  sensor

Functions

static int mt9v111_probe (struct i2c_client *client, const struct i2c_device_id *id)
static int mt9v111_remove (struct i2c_client *client)
static int mt9v111_write_reg (u8 reg, u16 val)
static u8 mt9v111_sensor_lib (mt9v111_coreReg *coreReg, mt9v111_IFPReg *ifpReg)
static void mt9v111_rate_cal (int *frame_rate, int mclk)
void mt9v111_config (void)
static int mt9v111_set_saturation (int saturation)
static int mt9v111_set_ae_mode (int ae_mode)
static void mt9v111_get_ae_mode (int *ae_mode)
static int ioctl_g_ifparm (struct v4l2_int_device *s, struct v4l2_ifparm *p)
static int ioctl_s_power (struct v4l2_int_device *s, int on)
static int ioctl_g_parm (struct v4l2_int_device *s, struct v4l2_streamparm *a)
static int ioctl_s_parm (struct v4l2_int_device *s, struct v4l2_streamparm *a)
static int ioctl_g_fmt_cap (struct v4l2_int_device *s, struct v4l2_format *f)
static int ioctl_queryctrl (struct v4l2_int_device *s, struct v4l2_queryctrl *qc)
static int ioctl_g_ctrl (struct v4l2_int_device *s, struct v4l2_control *vc)
static int ioctl_s_ctrl (struct v4l2_int_device *s, struct v4l2_control *vc)
static int ioctl_init (struct v4l2_int_device *s)
static int ioctl_dev_init (struct v4l2_int_device *s)
static __init int mt9v111_init (void)
static void __exit mt9v111_clean (void)

Variables

static int reset_frame_rate = MT9V111_FRAME_RATE
static struct v4l2_int_ioctl_desc mt9v111_ioctl_desc []

Detailed Description

mt9v111 camera driver functions


Function Documentation

static int ioctl_dev_init ( struct v4l2_int_device *  s  )  [static]

ioctl_dev_init - V4L2 sensor interface handler for vidioc_int_dev_init_num : pointer to standard V4L2 device structure

Initialise the device when slave attaches to the master.

References mt9v111_conf::coreReg, mt9v111_conf::ifpReg, mt9v111_rate_cal(), mt9v111_sensor_lib(), and reset_frame_rate.

static int ioctl_g_ctrl ( struct v4l2_int_device *  s,
struct v4l2_control *  vc 
) [static]

ioctl_g_ctrl - V4L2 sensor interface handler for VIDIOC_G_CTRL ioctl : pointer to standard V4L2 device structure : standard V4L2 VIDIOC_G_CTRL ioctl structure

If the requested control is supported, returns the control's current value from the video_control[] array. Otherwise, returns -EINVAL if the control is not supported.

static int ioctl_g_fmt_cap ( struct v4l2_int_device *  s,
struct v4l2_format *  f 
) [static]

ioctl_g_fmt_cap - V4L2 sensor interface handler for ioctl_g_fmt_cap : pointer to standard V4L2 device structure : pointer to standard V4L2 v4l2_format structure

Returns the sensor's current pixel format in the v4l2_format parameter.

static int ioctl_g_ifparm ( struct v4l2_int_device *  s,
struct v4l2_ifparm *  p 
) [static]

ioctl_g_ifparm - V4L2 sensor interface handler for vidioc_int_g_ifparm_num s: pointer to standard V4L2 device structure p: pointer to standard V4L2 vidioc_int_g_ifparm_num ioctl structure

Gets slave interface parameters. Calculates the required xclk value to support the requested clock parameters in p. This value is returned in the p parameter.

vidioc_int_g_ifparm returns platform-specific information about the interface settings used by the sensor.

Given the image capture format in pix, the nominal frame period in timeperframe, calculate the required xclk frequency.

Called on open.

static int ioctl_g_parm ( struct v4l2_int_device *  s,
struct v4l2_streamparm *  a 
) [static]

ioctl_g_parm - V4L2 sensor interface handler for VIDIOC_G_PARM ioctl : pointer to standard V4L2 device structure : pointer to standard V4L2 VIDIOC_G_PARM ioctl structure

Returns the sensor's video CAPTURE parameters.

static int ioctl_init ( struct v4l2_int_device *  s  )  [static]

ioctl_init - V4L2 sensor interface handler for VIDIOC_INT_INIT : pointer to standard V4L2 device structure

static int ioctl_queryctrl ( struct v4l2_int_device *  s,
struct v4l2_queryctrl *  qc 
) [static]

ioctl_queryctrl - V4L2 sensor interface handler for VIDIOC_QUERYCTRL ioctl : pointer to standard V4L2 device structure : standard V4L2 VIDIOC_QUERYCTRL ioctl structure

If the requested control is supported, returns the control information from the video_control[] array. Otherwise, returns -EINVAL if the control is not supported.

static int ioctl_s_ctrl ( struct v4l2_int_device *  s,
struct v4l2_control *  vc 
) [static]

ioctl_s_ctrl - V4L2 sensor interface handler for VIDIOC_S_CTRL ioctl : pointer to standard V4L2 device structure : standard V4L2 VIDIOC_S_CTRL ioctl structure

If the requested control is supported, sets the control's current value in HW (and updates the video_control[] array). Otherwise, returns -EINVAL if the control is not supported.

References mt9v111_set_ae_mode(), and mt9v111_set_saturation().

static int ioctl_s_parm ( struct v4l2_int_device *  s,
struct v4l2_streamparm *  a 
) [static]

ioctl_s_parm - V4L2 sensor interface handler for VIDIOC_S_PARM ioctl : pointer to standard V4L2 device structure : pointer to standard V4L2 VIDIOC_S_PARM ioctl structure

Configures the sensor to use the input parameters, if possible. If not possible, reverts to the old parameters and returns the appropriate error code.

static int ioctl_s_power ( struct v4l2_int_device *  s,
int  on 
) [static]

Sets the camera power.

s pointer to the camera device on if 1, power is to be turned on. 0 means power is to be turned off

ioctl_s_power - V4L2 sensor interface handler for vidioc_int_s_power_num : pointer to standard V4L2 device structure : power state to which device is to be set

Sets devices power state to requrested state, if possible. This is called on suspend and resume.

static void __exit mt9v111_clean ( void   )  [static]

MT9V111 cleanup function. Called on rmmod mt9v111_camera.ko

Returns:
Error code indicating success or failure

References mt9v111_conf::coreReg, and mt9v111_conf::ifpReg.

void mt9v111_config ( void   ) 
static void mt9v111_get_ae_mode ( int *  ae_mode  )  [static]

mt9v111 sensor get AE measurement window mode configuration

Parameters:
ae_mode int *
Returns:
None

References mt9v111_conf::ifpReg, and mt9v111_IFPReg::modeControl.

static __init int mt9v111_init ( void   )  [static]

MT9V111 init function. Called by insmod mt9v111_camera.ko.

Returns:
Error code indicating success or failure

References mt9v111_conf::coreReg, mt9v111_conf::ifpReg, and mt9v111_config().

static int mt9v111_probe ( struct i2c_client *  client,
const struct i2c_device_id *  id 
) [static]

mt9v111 I2C probe function Function set in i2c_driver struct. Called by insmod mt9v111_camera.ko.

Returns:
Error code indicating success or failure

References MT9V111_FRAME_RATE.

static void mt9v111_rate_cal ( int *  frame_rate,
int  mclk 
) [static]

MT9V111 frame rate calculate

Parameters:
frame_rate int *
mclk int
Returns:
None

References mt9v111_conf::coreReg, reset_frame_rate, and mt9v111_coreReg::verticalBlanking.

Referenced by ioctl_dev_init().

static int mt9v111_remove ( struct i2c_client *  client  )  [static]

Function set in i2c_driver struct. Called on rmmod mt9v111_camera.ko

static u8 mt9v111_sensor_lib ( mt9v111_coreReg coreReg,
mt9v111_IFPReg ifpReg 
) [static]
static int mt9v111_set_ae_mode ( int  ae_mode  )  [static]

mt9v111 sensor set Auto Exposure measurement window mode configuration

Parameters:
ae_mode int
Returns:
Error code of 0 (no Error)

References mt9v111_IFPReg::addrSpaceSel, mt9v111_conf::ifpReg, mt9v111_IFPReg::modeControl, mt9v111_write_reg(), and MT9V111I_ADDR_SPACE_SEL.

Referenced by ioctl_s_ctrl().

static int mt9v111_set_saturation ( int  saturation  )  [static]

mt9v111 sensor set saturtionn

Parameters:
saturation int
Returns:
Error code of 0.

References mt9v111_IFPReg::addrSpaceSel, mt9v111_IFPReg::awbSpeed, mt9v111_conf::ifpReg, mt9v111_write_reg(), and MT9V111I_ADDR_SPACE_SEL.

Referenced by ioctl_s_ctrl().

static int mt9v111_write_reg ( u8  reg,
u16  val 
) [inline, static]

Writes to the register via I2C.

Referenced by mt9v111_sensor_lib(), mt9v111_set_ae_mode(), and mt9v111_set_saturation().


Variable Documentation

struct v4l2_int_ioctl_desc mt9v111_ioctl_desc[] [static]
Initial value:
 {

        {vidioc_int_dev_init_num, (v4l2_int_ioctl_func *)ioctl_dev_init},

        


        {vidioc_int_s_power_num, (v4l2_int_ioctl_func *) ioctl_s_power},
        {vidioc_int_g_ifparm_num, (v4l2_int_ioctl_func *) ioctl_g_ifparm},


        {vidioc_int_init_num, (v4l2_int_ioctl_func *) ioctl_init},

        


        


        {vidioc_int_g_fmt_cap_num, (v4l2_int_ioctl_func *) ioctl_g_fmt_cap},

        


        {vidioc_int_g_parm_num, (v4l2_int_ioctl_func *) ioctl_g_parm},
        {vidioc_int_s_parm_num, (v4l2_int_ioctl_func *) ioctl_s_parm},

        {vidioc_int_g_ctrl_num, (v4l2_int_ioctl_func *) ioctl_g_ctrl},
        {vidioc_int_s_ctrl_num, (v4l2_int_ioctl_func *) ioctl_s_ctrl},
}

This structure defines all the ioctls for this module and links them to the enumeration.

int reset_frame_rate = MT9V111_FRAME_RATE [static]

Holds the current frame rate.

Referenced by ioctl_dev_init(), and mt9v111_rate_cal().

footer
©  Freescale Semiconductor, Inc., 2007.  All rights reserved.
Freescale Confidential Proprietary
NDA Required
doxygen