static int yacd5c1sbdbc_sensor_set_preview_fps(struct msm_sensor_ctrl_t *s_ctrl ,int8_t preview_fps)
{
	int rc = 0;

	CDBG("%s preview_fps=%d start \n",__func__,preview_fps);

	if(preview_fps < 5 || preview_fps > 31){
		SKYCERR("%s error. preview_fps=%d\n", __func__, preview_fps);
		return -EINVAL;
	}

	g_preview_fps = preview_fps;
	
	//if (preview_fps > 30) preview_fps = 30;
	
#if 1//CONFIG_PANTECH_CAMERA_YACD5C1SBDBC for VTS
    if(preview_fps == 24) {
        preview_24fps_for_motion_detect_check = 1;
    }else{
    	rc = msm_camera_i2c_write_tbl(
    		s_ctrl->sensor_i2c_client,
    		s_ctrl->msm_sensor_reg->preview_fps_cfg_settings[preview_fps-5], //original
		//s_ctrl->msm_sensor_reg->preview_fps_cfg_settings[10], //temporary
    		s_ctrl->msm_sensor_reg->preview_fps_cfg_settings_size,
    		s_ctrl->msm_sensor_reg->default_data_type);
    }
#else
	rc = msm_camera_i2c_write_tbl(
		s_ctrl->sensor_i2c_client,
		s_ctrl->msm_sensor_reg->preview_fps_cfg_settings[preview_fps],
		s_ctrl->msm_sensor_reg->preview_fps_cfg_settings_size,
		s_ctrl->msm_sensor_reg->default_data_type);
}
Exemple #2
0
static int32_t ov7736_set_frame_rate_range(struct msm_sensor_ctrl_t *s_ctrl,
		struct fps_range_t *fps_range)
{
	int32_t rc = 0;

	if (fps_range->max_fps != fps_range->min_fps) {
		pr_err("%s: FPS is incorrect\n", __func__);
		rc = -EINVAL;
		goto frame_rate_done;
	}

	if (fps_range->max_fps == 30) {
		rc = msm_camera_i2c_write_tbl(
				s_ctrl->sensor_i2c_client,
				ov7736_30_30_fps_settings,
				ARRAY_SIZE(ov7736_30_30_fps_settings),
				MSM_CAMERA_I2C_BYTE_DATA);
	} else if (fps_range->max_fps == 15) {
		rc = msm_camera_i2c_write_tbl(
				s_ctrl->sensor_i2c_client,
				ov7736_15_15_fps_settings,
				ARRAY_SIZE(ov7736_15_15_fps_settings),
				MSM_CAMERA_I2C_BYTE_DATA);
	} else {
		rc = -EINVAL;
		pr_err("%s: failed to set frame rate range (%d)\n", __func__,
				rc);
		goto frame_rate_done;
	}


frame_rate_done:
	return rc;
}
Exemple #3
0
static int vx6953_enable_edof(enum edof_mode_t edof_mode)
{
	int rc = 0;
	if (edof_mode == VX6953_EDOF_ESTIMATION) {
		/* EDof Estimation mode for preview */
		msm_camera_i2c_write_tbl(
			vx6953_s_ctrl.sensor_i2c_client,
			vx6953_edof_estimation,
			ARRAY_SIZE(vx6953_edof_estimation),
			vx6953_s_ctrl.msm_sensor_reg->default_data_type);
		CDBG("VX6953_EDOF_ESTIMATION");
	} else if (edof_mode == VX6953_EDOF_APPLICATION) {
		/* EDof Application mode for Capture */
		msm_camera_i2c_write_tbl(
			vx6953_s_ctrl.sensor_i2c_client,
			vx6953_edof_application,
			ARRAY_SIZE(vx6953_edof_application),
			vx6953_s_ctrl.msm_sensor_reg->default_data_type);
		CDBG("VX6953_EDOF_APPLICATION");
	} else {
		/* EDOF disabled */
		msm_camera_i2c_write_tbl(
			vx6953_s_ctrl.sensor_i2c_client,
			vx6953_edof_default,
			ARRAY_SIZE(vx6953_edof_default),
			vx6953_s_ctrl.msm_sensor_reg->default_data_type);
		CDBG("VX6953_EDOF_DISABLE");
	}
	return rc;
}
int32_t imx111_sensor_write_exp_gain1(struct msm_sensor_ctrl_t *s_ctrl,
		uint16_t gain, uint32_t line, int32_t luma_avg, uint16_t fgain)
{
	uint32_t fl_lines;
	uint8_t offset;
	fl_lines = s_ctrl->curr_frame_length_lines;
	fl_lines = (fl_lines * s_ctrl->fps_divider) / Q10;
	offset = s_ctrl->sensor_exp_gain_info->vert_offset;
	if (line > (fl_lines - offset))
		fl_lines = line + offset;

	CDBG("\n%s:Gain:%d, Linecount:%d\n", __func__, gain, line);
	if (s_ctrl->curr_res == 0) {
		msm_camera_i2c_write_tbl(s_ctrl->sensor_i2c_client,
			(struct msm_camera_i2c_reg_conf *)
			imx111_comm_confs[1].conf,
			imx111_comm_confs[1].size,
			imx111_comm_confs[1].data_type);

		msm_camera_i2c_write(s_ctrl->sensor_i2c_client,
			s_ctrl->sensor_output_reg_addr->frame_length_lines,
			fl_lines, MSM_CAMERA_I2C_WORD_DATA);
		msm_camera_i2c_write(s_ctrl->sensor_i2c_client,
			s_ctrl->sensor_exp_gain_info->coarse_int_time_addr,
			line, MSM_CAMERA_I2C_WORD_DATA);
		msm_camera_i2c_write(s_ctrl->sensor_i2c_client,
			s_ctrl->sensor_exp_gain_info->global_gain_addr, gain,
			MSM_CAMERA_I2C_WORD_DATA);

		msm_camera_i2c_write_tbl(s_ctrl->sensor_i2c_client,
			(struct msm_camera_i2c_reg_conf *)
			imx111_comm_confs[2].conf,
			imx111_comm_confs[2].size,
			imx111_comm_confs[2].data_type);


		v4l2_subdev_notify(&s_ctrl->sensor_v4l2_subdev,
			NOTIFY_PCLK_CHANGE, &s_ctrl->msm_sensor_reg->
			output_settings[s_ctrl->curr_res].op_pixel_clk);
//		s_ctrl->func_tbl->sensor_start_stream(s_ctrl);
	} else {
		s_ctrl->func_tbl->sensor_group_hold_on(s_ctrl);
		msm_camera_i2c_write(s_ctrl->sensor_i2c_client,
			s_ctrl->sensor_output_reg_addr->frame_length_lines,
			fl_lines, MSM_CAMERA_I2C_WORD_DATA);
		msm_camera_i2c_write(s_ctrl->sensor_i2c_client,
			s_ctrl->sensor_exp_gain_info->coarse_int_time_addr,
			line, MSM_CAMERA_I2C_WORD_DATA);
		msm_camera_i2c_write(s_ctrl->sensor_i2c_client,
			s_ctrl->sensor_exp_gain_info->global_gain_addr, gain,
			MSM_CAMERA_I2C_WORD_DATA);
		s_ctrl->func_tbl->sensor_group_hold_off(s_ctrl);
	}

	return 0;
}
/* msm_sensor_write_res_settings */
int32_t yacd5c1sbdbc_sensor_write_res_settings(struct msm_sensor_ctrl_t *s_ctrl,
	uint16_t res)
{
	int32_t rc = 0;
//CDBG("[F_PANTECH_CAMERA]%s: res=%d / check_zsl_flag=%d\n", __func__,res,check_zsl_flag);

    if((check_zsl_flag == 0) && (res == 0)) {
SKYCDBG("%s:[F_PANTECH_CAMERA] Write reg [AE, AWB Off SET]\n", __func__);        
        rc = msm_camera_i2c_write_tbl(
            s_ctrl->sensor_i2c_client,
            s_ctrl->msm_sensor_reg->checkzsl_cfg_settings[0],//[AE, AWB Off SET]
            s_ctrl->msm_sensor_reg->checkzsl_cfg_settings_size,
            s_ctrl->msm_sensor_reg->default_data_type);
    }

	rc = msm_sensor_write_conf_array(
		s_ctrl->sensor_i2c_client,
		s_ctrl->msm_sensor_reg->mode_settings, res);
	if (rc < 0)
		return rc;
#ifndef CONFIG_PANTECH_CAMERA_YACD5C1SBDBC
	rc = msm_sensor_write_output_settings(s_ctrl, res);
#endif
	return rc;
}
int32_t imx111_sensor_setting(struct msm_sensor_ctrl_t *s_ctrl,
			int update_type, int res)
{
	int32_t rc = 0;
	pr_err("[rafal47] %s: update: %d, res : %d : Change camera mode\n", __func__, update_type, res);
//	s_ctrl->func_tbl->sensor_stop_stream(s_ctrl);
//	msleep(30);
	if (update_type == MSM_SENSOR_REG_INIT) {
		msm_sensor_enable_debugfs(s_ctrl);
		msm_sensor_write_init_settings(s_ctrl);
	} else if (update_type == MSM_SENSOR_UPDATE_PERIODIC) {
		if (res == 0) {
			msm_camera_i2c_write_tbl(s_ctrl->sensor_i2c_client,
				(struct msm_camera_i2c_reg_conf *)
				imx111_comm_confs[0].conf,
				imx111_comm_confs[0].size,
				imx111_comm_confs[0].data_type);
         printk("[tykim] %s: csi_lane_assign not setting\n", __func__); /*                                                                     */
		} else {
			msm_sensor_write_res_settings(s_ctrl, res);
			v4l2_subdev_notify(&s_ctrl->sensor_v4l2_subdev,
				NOTIFY_PCLK_CHANGE, &s_ctrl->msm_sensor_reg->
				output_settings[res].op_pixel_clk);
		}
	}
	printk("%s: X", __func__);
	return rc;
}
Exemple #7
0
void msm_sensor_start_stream(struct msm_sensor_ctrl_t *s_ctrl)
{
	pr_err("%s: E\n", __func__); /*                                                              */
	msm_camera_i2c_write_tbl(
		s_ctrl->sensor_i2c_client,
		s_ctrl->msm_sensor_reg->start_stream_conf,
		s_ctrl->msm_sensor_reg->start_stream_conf_size,
		s_ctrl->msm_sensor_reg->default_data_type);

/*                                                       */
#ifdef LGIT_IEF_SWITCH_L1V
	if(system_state != SYSTEM_BOOTING){
		printk("[IEF_OFF] Camera \n");
		mipi_lgd_lcd_ief_off();
	}
#endif
/*                                                       */

/*                                                                                                */
#ifdef LGIT_IEF_SWITCH_VU2
	if(system_state != SYSTEM_BOOTING && sub_cam_id_for_keep_screen_on != -2733) {
		printk("[IEF_OFF] Camera \n");
		mipi_lgit_lcd_ief_off();
	}
#endif
/*                                                                                                */
}
static int as0260_sensor_set_preview_fps(struct msm_sensor_ctrl_t *s_ctrl ,int8_t preview_fps)
{
	int rc = 0;

	SKYCDBG("%s preview_fps=%d start \n",__func__,preview_fps); //SKYCDBG

	if(preview_fps < 5 || preview_fps > 31){
		SKYCERR("%s error. preview_fps=%d\n", __func__, preview_fps); //SKYCERR
		return -EINVAL;
	}

	rc = msm_camera_i2c_write_tbl(
		s_ctrl->sensor_i2c_client,
		s_ctrl->msm_sensor_reg->preview_fps_cfg_settings[preview_fps-5],
		s_ctrl->msm_sensor_reg->preview_fps_cfg_settings_size,
		s_ctrl->msm_sensor_reg->default_data_type);

	if (rc < 0)
	{
		SKYCERR("ERR:%s FAIL!!! rc=%d \n", __func__, rc); //SKYCERR
		return rc;
	}	
	SKYCDBG("%s rc=%d end \n",__func__,rc); //SKYCDBG
	
	return rc;
}
void msm_sensor_start_stream(struct msm_sensor_ctrl_t *s_ctrl)
{
	pr_err("%s: E\n", __func__); /* LGE_CHANGE, For debugging, 2012-07-03, [email protected] */
	msm_camera_i2c_write_tbl(
		s_ctrl->sensor_i2c_client,
		s_ctrl->msm_sensor_reg->start_stream_conf,
		s_ctrl->msm_sensor_reg->start_stream_conf_size,
		s_ctrl->msm_sensor_reg->default_data_type);

/* LGE_CHANGE_S, Turn IEF off in camera mode, 2012-10-23 */
#ifdef LGIT_IEF_SWITCH_L1V
	if(system_state != SYSTEM_BOOTING){
		printk("[IEF_OFF] Camera \n");
		mipi_lgd_lcd_ief_off();
	}
#endif
/* LGE_CHANGE_E, Turn IEF off in camera mode, 2012-10-23 */

/* LGE_CHANGE_S, Turn IEF off in camera mode except KeepScreenOn, 2012-09-13, [email protected] */
#ifdef LGIT_IEF_SWITCH_VU2
	if(system_state != SYSTEM_BOOTING && sub_cam_id_for_keep_screen_on != -2733) {
		printk("[IEF_OFF] Camera \n");
		mipi_lgit_lcd_ief_off();
	}
#endif
/* LGE_CHANGE_E, Turn IEF off in camera mode except KeepScreenOn, 2012-09-13, [email protected] */
}
static int as0260_sensor_set_wb(struct msm_sensor_ctrl_t *s_ctrl ,int8_t wb)
{
	int rc = 0;

	SKYCDBG("%s wb=%d start \n",__func__,wb); //SKYCDBG

	if(wb < 0 || wb > 6){
		SKYCERR("%s error. wb=%d\n", __func__, wb); //SKYCERR
		return -EINVAL;
	}

	rc = msm_camera_i2c_write_tbl(
		s_ctrl->sensor_i2c_client,
		s_ctrl->msm_sensor_reg->wb_cfg_settings[wb],
		s_ctrl->msm_sensor_reg->wb_cfg_settings_size,
		s_ctrl->msm_sensor_reg->default_data_type);

	if (rc < 0)
	{
		SKYCERR("ERR:%s FAIL!!! rc=%d \n", __func__, rc); //SKYCERR
		return rc;
	}	
	SKYCDBG("%s rc=%d end \n",__func__,rc); //SKYCDBG
	
	return rc;
}
int32_t mt9p017_write_init_settings(struct msm_sensor_ctrl_t *s_ctrl)
{
	int32_t rc=0, i;

	printk("%s is called !\n", __func__);
	
	for (i = 0; i < s_ctrl->msm_sensor_reg->init_size; i++) 
	{
		rc = msm_sensor_write_conf_array(
			s_ctrl->sensor_i2c_client, 
			s_ctrl->msm_sensor_reg->init_settings, i);
		if (rc < 0)
			break;
	}
#ifndef MT9P017_OTP_SUPPORT
	rc = msm_camera_i2c_write_tbl(
		s_ctrl->sensor_i2c_client,
		&mt9p017_recommend_settings_5[0],
		ARRAY_SIZE(mt9p017_recommend_settings_5), 
		MSM_CAMERA_I2C_WORD_DATA);
#else
	mt9p017_set_lc(s_ctrl);
#endif

	return rc;
}
static int as0260_sensor_set_reflect(struct msm_sensor_ctrl_t *s_ctrl ,int8_t reflect)
{
	int rc = 0;

	SKYCDBG("%s reflect=%d start \n",__func__,reflect); //SKYCDBG

	if(reflect < 0 || reflect > 3){
		SKYCERR("%s error. reflect=%d\n", __func__, reflect); //SKYCERR
		return -EINVAL;
	}

	rc = msm_camera_i2c_write_tbl(
		s_ctrl->sensor_i2c_client,
		s_ctrl->msm_sensor_reg->reflect_cfg_settings[reflect],
		s_ctrl->msm_sensor_reg->reflect_cfg_settings_size,
		s_ctrl->msm_sensor_reg->default_data_type);

	if (rc < 0)
	{
		SKYCERR("ERR:%s FAIL!!! rc=%d \n", __func__, rc); //SKYCERR
		return rc;
	}	
	SKYCDBG("%s rc=%d end \n",__func__,rc); //SKYCDBG
	
	return rc;
}
static int as0260_sensor_set_exposure_mode(struct msm_sensor_ctrl_t *s_ctrl ,int8_t exposure)
{
	int rc = 0;

	SKYCDBG("%s exposure=%d start \n",__func__,exposure); //SKYCDBG

	if(exposure < 0 || exposure > 3){
		SKYCERR("%s error. exposure=%d\n", __func__, exposure); //SKYCERR
		return -EINVAL;
	}

	rc = msm_camera_i2c_write_tbl(
		s_ctrl->sensor_i2c_client,
		s_ctrl->msm_sensor_reg->exposure_mode_cfg_settings[exposure],
		s_ctrl->msm_sensor_reg->exposure_mode_cfg_settings_size,
		s_ctrl->msm_sensor_reg->default_data_type);

	if (rc < 0)
	{
		SKYCERR("ERR:%s FAIL!!! rc=%d \n", __func__, rc); //SKYCERR
		return rc;
	}	
	SKYCDBG("%s rc=%d end \n",__func__,rc); //SKYCDBG
	
	return rc;
}
static int as0260_sensor_set_effect(struct msm_sensor_ctrl_t *s_ctrl ,int8_t effect)
{
	int rc = 0;

	SKYCDBG("%s effect=%d start \n",__func__,effect); //SKYCDBG
#if 0
	if(effect < CAMERA_EFFECT_OFF || effect >= CAMERA_EFFECT_MAX){
		SKYCERR("%s error. effect=%d\n", __func__, effect); //SKYCERR
		return -EINVAL;
	}
#endif
	rc = msm_camera_i2c_write_tbl(
		s_ctrl->sensor_i2c_client,
		s_ctrl->msm_sensor_reg->effect_cfg_settings[effect],
		s_ctrl->msm_sensor_reg->effect_cfg_settings_size,
		s_ctrl->msm_sensor_reg->default_data_type);

	if (rc < 0)
	{
		SKYCERR("ERR:%s FAIL!!! rc=%d \n", __func__, rc); //SKYCERR
		return rc;
	}	
	SKYCDBG("%s rc=%d end \n",__func__,rc); //SKYCDBG
	
	return rc;
}
static int as0260_sensor_set_brightness(struct msm_sensor_ctrl_t * s_ctrl,int8_t brightness)
{
	int rc = 0;

	SKYCDBG("%s brightness=%d start \n",__func__,brightness); //SKYCDBG

	if(brightness < 0 || brightness > 8){
		SKYCERR("%s error. brightness=%d\n", __func__, brightness); //SKYCERR
		return -EINVAL;
	}

	rc = msm_camera_i2c_write_tbl(
		s_ctrl->sensor_i2c_client,
		s_ctrl->msm_sensor_reg->bright_cfg_settings[brightness],
		s_ctrl->msm_sensor_reg->bright_cfg_settings_size,
		s_ctrl->msm_sensor_reg->default_data_type);

	if (rc < 0)
	{
		SKYCERR("ERR:%s FAIL!!! rc=%d \n", __func__, rc); //SKYCERR
		return rc;
	}	
	SKYCDBG("%s rc=%d end \n",__func__,rc); //SKYCDBG
	
	return rc;
}
Exemple #16
0
int32_t msm_sensor_write_output_settings(struct msm_sensor_ctrl_t *s_ctrl,
        uint16_t res)
{
    int32_t rc = -EFAULT;
    struct msm_camera_i2c_reg_conf dim_settings[] = {
        {   s_ctrl->sensor_output_reg_addr->x_output,
            s_ctrl->msm_sensor_reg->
            output_settings[res].x_output
        },
        {   s_ctrl->sensor_output_reg_addr->y_output,
            s_ctrl->msm_sensor_reg->
            output_settings[res].y_output
        },
        {   s_ctrl->sensor_output_reg_addr->line_length_pclk,
            s_ctrl->msm_sensor_reg->
            output_settings[res].line_length_pclk
        },
        {   s_ctrl->sensor_output_reg_addr->frame_length_lines,
            s_ctrl->msm_sensor_reg->
            output_settings[res].frame_length_lines
        },
    };

    rc = msm_camera_i2c_write_tbl(s_ctrl->sensor_i2c_client, dim_settings,
                                  ARRAY_SIZE(dim_settings), MSM_CAMERA_I2C_WORD_DATA);
    return rc;
}
Exemple #17
0
void msm_sensor_stop_stream(struct msm_sensor_ctrl_t *s_ctrl)
{
	msm_camera_i2c_write_tbl(
		s_ctrl->sensor_i2c_client,
		s_ctrl->msm_sensor_reg->stop_stream_conf,
		s_ctrl->msm_sensor_reg->stop_stream_conf_size,
		s_ctrl->msm_sensor_reg->default_data_type);
}
Exemple #18
0
void msm_sensor_group_hold_off(struct msm_sensor_ctrl_t *s_ctrl)
{
	msm_camera_i2c_write_tbl(
		s_ctrl->sensor_i2c_client,
		s_ctrl->msm_sensor_reg->group_hold_off_conf,
		s_ctrl->msm_sensor_reg->group_hold_off_conf_size,
		s_ctrl->msm_sensor_reg->default_data_type);
}
Exemple #19
0
void msm_sensor_group_hold_off(struct msm_sensor_ctrl_t *s_ctrl)
{
	pr_err("%s: E\n", __func__); /*                                                              */
	msm_camera_i2c_write_tbl(
		s_ctrl->sensor_i2c_client,
		s_ctrl->msm_sensor_reg->group_hold_off_conf,
		s_ctrl->msm_sensor_reg->group_hold_off_conf_size,
		s_ctrl->msm_sensor_reg->default_data_type);
}
void msm_sensor_group_hold_off(struct msm_sensor_ctrl_t *s_ctrl)
{
	pr_err("%s: E\n", __func__); /* LGE_CHANGE, For debugging, 2012-07-03, [email protected] */
	msm_camera_i2c_write_tbl(
		s_ctrl->sensor_i2c_client,
		s_ctrl->msm_sensor_reg->group_hold_off_conf,
		s_ctrl->msm_sensor_reg->group_hold_off_conf_size,
		s_ctrl->msm_sensor_reg->default_data_type);
}
Exemple #21
0
/* MM-UW-Fix MMS can't record 23s-00+{ */
int32_t hm03d5_set_fps(struct msm_sensor_ctrl_t *s_ctrl,
                       struct fps_cfg *fps)
{
    int32_t rc = 0;

    if(fps->fps_div > 2000)
    {
        rc = msm_camera_i2c_write_tbl(s_ctrl->sensor_i2c_client, hm03d5_fps_10_14,
                                      ARRAY_SIZE(hm03d5_fps_10_14), MSM_CAMERA_I2C_BYTE_DATA);
    } else
    {
        rc = msm_camera_i2c_write_tbl(s_ctrl->sensor_i2c_client, hm03d5_fps_15_30,
                                      ARRAY_SIZE(hm03d5_fps_15_30), MSM_CAMERA_I2C_BYTE_DATA);
    }

    pr_err("%s: fps_divider =%d\n", __func__, s_ctrl->fps_divider);

    return rc;
}
Exemple #22
0
void msm_sensor_start_stream(struct msm_sensor_ctrl_t *s_ctrl)
{
	pr_info("%s\n", __func__);

	msm_camera_i2c_write_tbl(
		s_ctrl->sensor_i2c_client,
		s_ctrl->msm_sensor_reg->start_stream_conf,
		s_ctrl->msm_sensor_reg->start_stream_conf_size,
		s_ctrl->msm_sensor_reg->default_data_type);
}
int32_t imx111_sensor_setting(struct msm_sensor_ctrl_t *s_ctrl,
			int update_type, int res)
{
	int32_t rc = 0;

	printk("%s: E: update_type=%d, res=%d\n", __func__, update_type, res);

	s_ctrl->func_tbl->sensor_stop_stream(s_ctrl);
	msleep(30);
	if (update_type == MSM_SENSOR_REG_INIT) {
		s_ctrl->curr_csi_params = NULL;
		msm_sensor_enable_debugfs(s_ctrl);
		msm_sensor_write_init_settings(s_ctrl);
	} else if (update_type == MSM_SENSOR_UPDATE_PERIODIC) {
		if (res == 0) {
			msm_camera_i2c_write_tbl(s_ctrl->sensor_i2c_client,
				(struct msm_camera_i2c_reg_conf *)
				imx111_comm_confs[0].conf,
				imx111_comm_confs[0].size,
				imx111_comm_confs[0].data_type);
		} else {
			msm_sensor_write_res_settings(s_ctrl, res);
			if (s_ctrl->curr_csi_params != s_ctrl->csi_params[res]) {
				s_ctrl->curr_csi_params = s_ctrl->csi_params[res];
				s_ctrl->curr_csi_params->csid_params.lane_assign =
					s_ctrl->sensordata->sensor_platform_info->
					csi_lane_params->csi_lane_assign;
				s_ctrl->curr_csi_params->csiphy_params.lane_mask =
					s_ctrl->sensordata->sensor_platform_info->
					csi_lane_params->csi_lane_mask;
				v4l2_subdev_notify(&s_ctrl->sensor_v4l2_subdev,
					NOTIFY_CSID_CFG,
					&s_ctrl->curr_csi_params->csid_params);
				mb();
				v4l2_subdev_notify(&s_ctrl->sensor_v4l2_subdev,
					NOTIFY_CSIPHY_CFG,
					&s_ctrl->curr_csi_params->csiphy_params);
				mb();
				msleep(20);
			}

			v4l2_subdev_notify(&s_ctrl->sensor_v4l2_subdev,
				NOTIFY_PCLK_CHANGE, &s_ctrl->msm_sensor_reg->
				output_settings[res].op_pixel_clk);
			s_ctrl->func_tbl->sensor_start_stream(s_ctrl);
			msleep(30);
		}
	}
	printk("%s: X", __func__);
	return rc;
}
static int as0260_set_aec_lock(struct msm_sensor_ctrl_t *s_ctrl ,int8_t is_lock)
{
	int rc =0;

	SKYCDBG("%s is_lock=%d start \n",__func__,is_lock); //SKYCDBG
	
    rc = msm_camera_i2c_write_tbl(
		s_ctrl->sensor_i2c_client,
		s_ctrl->msm_sensor_reg->set_aec_lock[is_lock],
		s_ctrl->msm_sensor_reg->set_aec_lock_size,
		s_ctrl->msm_sensor_reg->default_data_type);
	SKYCDBG("%s rc=%d end \n",__func__,rc); //SKYCDBG
    return rc;
}
int s5k5ca_set_fps(struct msm_sensor_ctrl_t *s_ctrl,	struct fps_cfg *fps)
{
	//printk(" s5k5ca_set_fps() fps_divider:%d fps_div:%d \n",s_ctrl->fps_divider,fps->fps_div);
	s_ctrl->fps_divider = fps->fps_div;
      if(fps->fps_div<7680)
     {
	 	
   	msm_camera_i2c_write_tbl(
			s5k5ca_s_ctrl.sensor_i2c_client,
			s5k5ca_fps_15,
			ARRAY_SIZE(s5k5ca_fps_15),
			s5k5ca_s_ctrl.msm_sensor_reg->default_data_type);   
      }
      else
      	{
       msm_camera_i2c_write_tbl(
			s5k5ca_s_ctrl.sensor_i2c_client,
			s5k5ca_fps_30,
			ARRAY_SIZE(s5k5ca_fps_30),
			s5k5ca_s_ctrl.msm_sensor_reg->default_data_type);
      	}
	return 0;

}
static int32_t ov10820_check_i2c_configuration(struct msm_sensor_ctrl_t *s_ctrl)
{
	int32_t rc = 0;
	uint16_t chipid = 0;


	ov660_set_i2c_bypass(0);

	rc = msm_camera_i2c_read(
			s_ctrl->sensor_i2c_client,
			s_ctrl->sensor_id_info->sensor_id_reg_addr, &chipid,
			MSM_CAMERA_I2C_BYTE_DATA);

	if (rc < 0) {
		pr_info("%s: I2C is configured through ASIC.\n", __func__);
		allow_asic_control = true;

		rc = ov660_add_blc_firmware(s_ctrl->sensor_i2c_addr);
		if (rc < 0)
			pr_err("%s: Unable to set blc firmware!\n", __func__);

	} else {
		pr_info("%s: I2C is configured around ASIC.\n", __func__);
		allow_asic_control = false;
		rc = ov660_use_work_around_blc();

		if (rc < 0)
			pr_err("%s: unable to set ov660 blc workaround!\n",
					__func__);

		rc = msm_camera_i2c_write_tbl(s_ctrl->sensor_i2c_client,
				ov10820_BLC_work_around_settings,
				ARRAY_SIZE(ov10820_BLC_work_around_settings),
				MSM_CAMERA_I2C_BYTE_DATA);
		if (rc < 0)
			pr_err("%s: unable to write 10MP blc workaround!\n",
					__func__);
	}

	ov660_set_i2c_bypass(1);
	return 0;
}
Exemple #27
0
int32_t mt9t113_sensor_set_effect(struct msm_sensor_ctrl_t *s_ctrl, int effect)
{
	struct msm_camera_i2c_reg_conf *reg_conf_tbl = NULL;
	uint16_t num_of_items_in_table = 0;
	int rc = 0;

	printk("%s, to set effect = %d \n", __func__,effect);
	switch (effect)
	{
		case CAMERA_EFFECT_OFF:
			reg_conf_tbl = &mt9t113_effect_off_reg_config[0];
			num_of_items_in_table = ARRAY_SIZE(mt9t113_effect_off_reg_config);
			break;
		case CAMERA_EFFECT_MONO:
			reg_conf_tbl = &mt9t113_effect_mono_reg_config[0];
			num_of_items_in_table = ARRAY_SIZE(mt9t113_effect_mono_reg_config);
			break;
		case CAMERA_EFFECT_NEGATIVE:
			reg_conf_tbl = &mt9t113_effect_negative_reg_config[0];
			num_of_items_in_table = ARRAY_SIZE(mt9t113_effect_negative_reg_config);
			break;
		case CAMERA_EFFECT_SEPIA:
			reg_conf_tbl = &mt9t113_effect_sepia_reg_config[0];
			num_of_items_in_table = ARRAY_SIZE(mt9t113_effect_sepia_reg_config);
			break;
		case CAMERA_EFFECT_AQUA:
			reg_conf_tbl = &mt9t113_effect_aqua_reg_config[0];
			num_of_items_in_table = ARRAY_SIZE(mt9t113_effect_aqua_reg_config);
			break;
		default:
			return 0;
	}
	
	rc = msm_camera_i2c_write_tbl(
		s_ctrl->sensor_i2c_client,
		reg_conf_tbl,
		num_of_items_in_table, 
		MSM_CAMERA_I2C_WORD_DATA);

	return rc;
}
Exemple #28
0
int32_t mt9t113_sensor_set_wb(struct msm_sensor_ctrl_t *s_ctrl, int wb)
{
	struct msm_camera_i2c_reg_conf *reg_conf_tbl = NULL;
	uint16_t num_of_items_in_table = 0;
	int rc = 0;

	printk("%s, to set wb = %d \n", __func__,wb);
	switch (wb)
	{
		case CAMERA_WB_AUTO:
			reg_conf_tbl = &mt9t113_wb_auto_reg_config[0];
			num_of_items_in_table = ARRAY_SIZE(mt9t113_wb_auto_reg_config);
			break;
		case CAMERA_WB_INCANDESCENT:
			reg_conf_tbl = &mt9t113_wb_incandescent_reg_config[0];
			num_of_items_in_table = ARRAY_SIZE(mt9t113_wb_incandescent_reg_config);
			break;
		case CAMERA_WB_FLUORESCENT:
			reg_conf_tbl = &mt9t113_wb_fluorescent_reg_config[0];
			num_of_items_in_table = ARRAY_SIZE(mt9t113_wb_fluorescent_reg_config);
			break;
		case CAMERA_WB_DAYLIGHT:
			reg_conf_tbl = &mt9t113_wb_daylight_reg_config[0];
			num_of_items_in_table = ARRAY_SIZE(mt9t113_wb_daylight_reg_config);
			break;
		case CAMERA_WB_CLOUDY_DAYLIGHT:
			reg_conf_tbl = &mt9t113_wb_cloudy_reg_config[0];
			num_of_items_in_table = ARRAY_SIZE(mt9t113_wb_cloudy_reg_config);
			break;
		default:
			return 0;
	}
	
	rc = msm_camera_i2c_write_tbl(
		s_ctrl->sensor_i2c_client,
		reg_conf_tbl,
		num_of_items_in_table, 
		MSM_CAMERA_I2C_WORD_DATA);

	return rc;
}
int32_t msm_sensor_match_id(struct msm_sensor_ctrl_t *s_ctrl)
{
	int32_t rc = 0;
	uint16_t chipid = 0;
       if(s_ctrl->sensor_id_info->sensor_id_reg_addr_ext)
       	{
	rc = msm_camera_i2c_write_tbl(s_ctrl->sensor_i2c_client,
		s_ctrl->sensor_id_info->sensor_id_reg_addr_ext->conf,
		s_ctrl->sensor_id_info->sensor_id_reg_addr_ext->size,
		s_ctrl->sensor_id_info->sensor_id_reg_addr_ext->data_type);
	if (rc < 0) {
		CDBG("%s: read id first failed\n", __func__);
		return rc;
	       }
	}
	   
#if 0 
	rc = msm_camera_i2c_read(
			s_ctrl->sensor_i2c_client,
			s_ctrl->sensor_id_info->sensor_id_reg_addr, &chipid,
			MSM_CAMERA_I2C_WORD_DATA);
#else
	rc = msm_camera_i2c_read(
			s_ctrl->sensor_i2c_client,
			s_ctrl->sensor_id_info->sensor_id_reg_addr, &chipid,
			s_ctrl->msm_sensor_reg->default_data_type);
#endif
	if (rc < 0) {
		pr_err("%s: %s: read id failed\n", __func__,
			s_ctrl->sensordata->sensor_name);
		return rc;
	}

	printk("msm_sensor id: 0x%x  0x%x\n", chipid, s_ctrl->sensor_id_info->sensor_id);
	if (chipid != s_ctrl->sensor_id_info->sensor_id) {
		pr_err("msm_sensor_match_id chip id doesnot match\n");
		return -ENODEV;
	}
	return rc;
}
static int32_t ov10820_read_otp(struct msm_sensor_ctrl_t *s_ctrl)
{
	int32_t rc = 0;

	if (is_ov10820_otp_read == 1)
		return rc;

	/* Send PLL settings and stream on commmand */
	rc = msm_camera_i2c_write_tbl(s_ctrl->sensor_i2c_client,
			ov10820_read_otp_settings,
			ARRAY_SIZE(ov10820_read_otp_settings),
			MSM_CAMERA_I2C_BYTE_DATA);
	if (rc < 0) {
		pr_err("%s: Unable to setup for otp read.\n", __func__);
		return rc;
	}

	usleep_range(5000, 5500);

	/* Read the otp */
	rc = msm_camera_i2c_read_seq(s_ctrl->sensor_i2c_client,
			OV10820_OTP_ADDR, (uint8_t *)ov10820_otp,
			OV10820_OTP_SIZE);
	if (rc < 0) {
		pr_err("%s: Unable to read i2c seq!\n", __func__);
		goto exit;
	}

	is_ov10820_otp_read = 1;

exit:
	/* Stop Streaming */
	rc = msm_camera_i2c_write(s_ctrl->sensor_i2c_client,
			0x0100, 0x00, MSM_CAMERA_I2C_BYTE_DATA);
	if (rc < 0)
		pr_err("%s: Unable to stop streaming of imager\n", __func__);

	return rc;
}