void sensor_native_control_front(void __user *arg) { int err = 0; struct ioctl_native_cmd ctrl_info; struct msm_camera_v4l2_ioctl_t *ioctl_ptr = arg; if (copy_from_user(&ctrl_info, (void __user *)ioctl_ptr->ioctl_ptr, sizeof(ctrl_info))) { pr_info("fail copy_from_user!"); } /* pr_info("mode : %d", ctrl_info.mode);*/ switch (ctrl_info.mode) { case EXT_CAM_EV: err = sr130pc10_set_exposure_value(0, ctrl_info.value_1); break; case EXT_CAM_MOVIE_MODE: sr130pc10_ctrl->cam_mode = ctrl_info.value_1; /*sr130pc10_set_movie_mode(ctrl_info.value_1);*/ break; case EXT_CAM_EXIF: ctrl_info.value_1 = sr130pc10_get_exif(ctrl_info.address, ctrl_info.value_2); break; case EXT_CAM_SET_FLIP: sr130pc10_set_flipmode(ctrl_info.value_1); break; case EXT_CAM_DTP_TEST: sr130pc10_check_dataline(ctrl_info.value_1); sr130pc10_ctrl->dtp_mode = ctrl_info.value_1; break; default: break; } if (copy_to_user((void __user *)ioctl_ptr->ioctl_ptr, (const void *)&ctrl_info, sizeof(ctrl_info))) pr_info("fail copy_to_user!"); return ; }
int sr130pc10_sensor_ext_config(void __user *argp) { struct sensor_ext_cfg_data cfg_data; int err = 0; printk(KERN_DEBUG "[teddy][%s][E]\n", __func__); if (copy_from_user( (void *)&cfg_data, (const void *)argp, sizeof(cfg_data))) printk(KERN_DEBUG "fail copy_from_user!\n"); switch (cfg_data.cmd) { case EXT_CFG_SET_BRIGHTNESS: err = sr130pc10_set_exposure_value(0, cfg_data.value_1); break; case EXT_CFG_SET_ISO: /*err = s5k5ccg_set_ISO(0, cfg_data.value_1);*/ break; case EXT_CFG_SET_MOVIE_MODE: sr130pc10_set_movie_mode(cfg_data.value_1); break; case EXT_CFG_GET_EXIF: sr130pc10_get_exif(&cfg_data.value_1, &cfg_data.value_2); break; case EXT_CAM_SET_FLIP: sr130pc10_set_flipmode(cfg_data.value_1); break; default: break; } if (copy_to_user( (void *)argp, (const void *)&cfg_data, sizeof(cfg_data))) printk(KERN_DEBUG "fail copy_to_user!\n"); return err; }