int32_t imx175_sensor_setting(struct msm_sensor_ctrl_t *s_ctrl,
			int update_type, int res) {

	int rc = 0;
	pr_info("[CAM] %s\n", __func__);

#if ((defined CONFIG_I2C_CPLD) && ((defined CONFIG_MACH_DUMMY) || (defined CONFIG_MACH_DUMMY) || (defined CONFIG_MACH_DUMMY) || (defined CONFIG_MACH_DUMMY)))
	rc = msm_sensor_setting_parallel1(s_ctrl, update_type, res);
#else
	rc = msm_sensor_setting1(s_ctrl, update_type, res);
#endif

	if (update_type == MSM_SENSOR_UPDATE_PERIODIC) {
		imx175_mirror_flip_setting();
	}

	return rc;
}
Example #2
0
int32_t ov5693_sensor_setting(struct msm_sensor_ctrl_t *s_ctrl,
			int update_type, int res) {

	int rc = 0;
	int rc1 = 0, rc2 = 0;
	unsigned short f_value = 0;	
	unsigned short m_value = 0;	
	struct msm_camera_sensor_info *sdata = NULL;
	pr_info("[CAM] %s\n", __func__);

	if (s_ctrl && s_ctrl->sensordata)
		sdata = s_ctrl->sensordata;
	else {
		pr_err("[CAM] %s: s_ctrl sensordata NULL\n", __func__);
		return (-1);
	}

	rc = msm_sensor_setting1(s_ctrl, update_type, res);

	if (update_type == MSM_SENSOR_UPDATE_PERIODIC) {
		ov5693_s_ctrl.mirror_flip = sdata->sensor_platform_info->mirror_flip;

		
		rc1 = msm_camera_i2c_read_b(ov5693_s_ctrl.sensor_i2c_client, OV5693_REG_FLIP, &f_value);
		if (rc1 < 0)
			pr_info("[CAM]%s: msm_camera_i2c_read_b 0x%x fail\n", __func__, OV5693_REG_FLIP);
		rc2 = msm_camera_i2c_read_b(ov5693_s_ctrl.sensor_i2c_client, OV5693_REG_MIRROR, &m_value);
		if (rc2 < 0)
			pr_info("[CAM]%s: msm_camera_i2c_read_b 0x%x fail\n", __func__, OV5693_REG_MIRROR);

		pr_info("[CAM] f_value = 0x%x m_value = 0x%x", f_value, m_value);

		
		if (ov5693_s_ctrl.mirror_flip == CAMERA_SENSOR_MIRROR_FLIP) {
			pr_info("[CAM] CAMERA_SENSOR_MIRROR_FLIP");
			f_value |= OV5693_FLIP;
			m_value |= OV5693_MIRROR;
		} else if (ov5693_s_ctrl.mirror_flip == CAMERA_SENSOR_MIRROR) {
			pr_info("[CAM] CAMERA_SENSOR_MIRROR");
			f_value &= OV5693_FLIP_NORMAL;
			m_value |= OV5693_MIRROR;
		} else if (ov5693_s_ctrl.mirror_flip == CAMERA_SENSOR_FLIP) {
			pr_info("[CAM] CAMERA_SENSOR_FLIP");
			f_value |= OV5693_FLIP;
			m_value &= OV5693_MIRROR_NORMAL;
		} else {
			pr_info("[CAM] CAMERA_SENSOR_NONE");
			f_value &= OV5693_FLIP_NORMAL;
			m_value &= OV5693_MIRROR_NORMAL;
		}

		pr_info("[CAM] New f_value = 0x%x m_value = 0x%x", f_value, m_value);

		rc1 = msm_camera_i2c_write_b(ov5693_s_ctrl.sensor_i2c_client, OV5693_REG_FLIP, f_value);
		if (rc1 < 0)
			pr_info("[CAM]%s: msm_camera_i2c_read_b 0x%x fail\n", __func__, OV5693_REG_FLIP);

		rc2 = msm_camera_i2c_write_b(ov5693_s_ctrl.sensor_i2c_client, OV5693_REG_MIRROR, m_value);
		if (rc2 < 0)
			pr_info("[CAM]%s: msm_camera_i2c_read_b 0x%x fail\n", __func__, OV5693_REG_MIRROR);

		msleep(30); 
	}

	return rc;
}