Loading drivers/media/platform/msm/camera_v2/sensor/actuator/msm_actuator.c +19 −3 Original line number Diff line number Diff line Loading @@ -56,6 +56,11 @@ static int32_t msm_actuator_piezo_set_default_focus( struct msm_camera_i2c_reg_setting reg_setting; CDBG("Enter\n"); if (a_ctrl->i2c_reg_tbl == NULL) { pr_err("failed. i2c reg tabl is NULL"); return -EFAULT; } if (a_ctrl->curr_step_pos != 0) { a_ctrl->i2c_tbl_index = 0; a_ctrl->func_tbl->actuator_parse_i2c_params(a_ctrl, Loading Loading @@ -533,6 +538,11 @@ static int32_t msm_actuator_piezo_move_focus( return -EFAULT; } if (a_ctrl->i2c_reg_tbl == NULL) { pr_err("failed. i2c reg tabl is NULL"); return -EFAULT; } if (dest_step_position > a_ctrl->total_steps) { pr_err("Step pos greater than total steps = %d\n", dest_step_position); Loading Loading @@ -590,6 +600,10 @@ static int32_t msm_actuator_move_focus( pr_err("Invalid direction = %d\n", dir); return -EFAULT; } if (a_ctrl->i2c_reg_tbl == NULL) { pr_err("failed. i2c reg tabl is NULL"); return -EFAULT; } if (dest_step_pos > a_ctrl->total_steps) { pr_err("Step pos greater than total steps = %d\n", dest_step_pos); Loading Loading @@ -1169,7 +1183,8 @@ static int32_t msm_actuator_set_position( } if (!a_ctrl || !a_ctrl->func_tbl || !a_ctrl->func_tbl->actuator_parse_i2c_params) { !a_ctrl->func_tbl->actuator_parse_i2c_params || !a_ctrl->i2c_reg_tbl) { pr_err("failed. NULL actuator pointers."); return -EFAULT; } Loading Loading @@ -1279,12 +1294,10 @@ static int32_t msm_actuator_set_param(struct msm_actuator_ctrl_t *a_ctrl, a_ctrl->region_size = set_info->af_tuning_params.region_size; a_ctrl->pwd_step = set_info->af_tuning_params.pwd_step; a_ctrl->total_steps = set_info->af_tuning_params.total_steps; if (copy_from_user(&a_ctrl->region_params, (void *)set_info->af_tuning_params.region_params, a_ctrl->region_size * sizeof(struct region_params_t))) { a_ctrl->total_steps = 0; pr_err("Error copying region_params\n"); return -EFAULT; } Loading Loading @@ -1317,6 +1330,7 @@ static int32_t msm_actuator_set_param(struct msm_actuator_ctrl_t *a_ctrl, (a_ctrl->i2c_reg_tbl != NULL)) { kfree(a_ctrl->i2c_reg_tbl); } a_ctrl->i2c_reg_tbl = NULL; a_ctrl->i2c_reg_tbl = kmalloc(sizeof(struct msm_camera_i2c_reg_array) * Loading @@ -1326,6 +1340,8 @@ static int32_t msm_actuator_set_param(struct msm_actuator_ctrl_t *a_ctrl, return -ENOMEM; } a_ctrl->total_steps = set_info->af_tuning_params.total_steps; if (copy_from_user(&a_ctrl->reg_tbl, (void *)set_info->actuator_params.reg_tbl_params, a_ctrl->reg_tbl_size * Loading Loading
drivers/media/platform/msm/camera_v2/sensor/actuator/msm_actuator.c +19 −3 Original line number Diff line number Diff line Loading @@ -56,6 +56,11 @@ static int32_t msm_actuator_piezo_set_default_focus( struct msm_camera_i2c_reg_setting reg_setting; CDBG("Enter\n"); if (a_ctrl->i2c_reg_tbl == NULL) { pr_err("failed. i2c reg tabl is NULL"); return -EFAULT; } if (a_ctrl->curr_step_pos != 0) { a_ctrl->i2c_tbl_index = 0; a_ctrl->func_tbl->actuator_parse_i2c_params(a_ctrl, Loading Loading @@ -533,6 +538,11 @@ static int32_t msm_actuator_piezo_move_focus( return -EFAULT; } if (a_ctrl->i2c_reg_tbl == NULL) { pr_err("failed. i2c reg tabl is NULL"); return -EFAULT; } if (dest_step_position > a_ctrl->total_steps) { pr_err("Step pos greater than total steps = %d\n", dest_step_position); Loading Loading @@ -590,6 +600,10 @@ static int32_t msm_actuator_move_focus( pr_err("Invalid direction = %d\n", dir); return -EFAULT; } if (a_ctrl->i2c_reg_tbl == NULL) { pr_err("failed. i2c reg tabl is NULL"); return -EFAULT; } if (dest_step_pos > a_ctrl->total_steps) { pr_err("Step pos greater than total steps = %d\n", dest_step_pos); Loading Loading @@ -1169,7 +1183,8 @@ static int32_t msm_actuator_set_position( } if (!a_ctrl || !a_ctrl->func_tbl || !a_ctrl->func_tbl->actuator_parse_i2c_params) { !a_ctrl->func_tbl->actuator_parse_i2c_params || !a_ctrl->i2c_reg_tbl) { pr_err("failed. NULL actuator pointers."); return -EFAULT; } Loading Loading @@ -1279,12 +1294,10 @@ static int32_t msm_actuator_set_param(struct msm_actuator_ctrl_t *a_ctrl, a_ctrl->region_size = set_info->af_tuning_params.region_size; a_ctrl->pwd_step = set_info->af_tuning_params.pwd_step; a_ctrl->total_steps = set_info->af_tuning_params.total_steps; if (copy_from_user(&a_ctrl->region_params, (void *)set_info->af_tuning_params.region_params, a_ctrl->region_size * sizeof(struct region_params_t))) { a_ctrl->total_steps = 0; pr_err("Error copying region_params\n"); return -EFAULT; } Loading Loading @@ -1317,6 +1330,7 @@ static int32_t msm_actuator_set_param(struct msm_actuator_ctrl_t *a_ctrl, (a_ctrl->i2c_reg_tbl != NULL)) { kfree(a_ctrl->i2c_reg_tbl); } a_ctrl->i2c_reg_tbl = NULL; a_ctrl->i2c_reg_tbl = kmalloc(sizeof(struct msm_camera_i2c_reg_array) * Loading @@ -1326,6 +1340,8 @@ static int32_t msm_actuator_set_param(struct msm_actuator_ctrl_t *a_ctrl, return -ENOMEM; } a_ctrl->total_steps = set_info->af_tuning_params.total_steps; if (copy_from_user(&a_ctrl->reg_tbl, (void *)set_info->actuator_params.reg_tbl_params, a_ctrl->reg_tbl_size * Loading