long msm_sensor_bayer_subdev_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) { struct msm_sensor_ctrl_t *s_ctrl = get_sctrl(sd); void __user *argp = (void __user *)arg; switch (cmd) { case VIDIOC_MSM_SENSOR_CFG: return s_ctrl->func_tbl->sensor_config(s_ctrl, argp); case VIDIOC_MSM_SENSOR_RELEASE: return 0; case VIDIOC_MSM_SENSOR_CSID_INFO: { struct msm_sensor_csi_info *csi_info = (struct msm_sensor_csi_info *)arg; s_ctrl->is_csic = csi_info->is_csic; return 0; } default: return -ENOIOCTLCMD; } }
static int hisi_sensor_subdev_internal_close(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) { struct hisi_sensor_ctrl_t *s_ctrl = get_sctrl(sd); int rc=0; struct sensor_cfg_data cdata = {0}; cdata.cfgtype = CFG_SENSOR_POWER_DOWN; if (s_ctrl == NULL) { cam_err("%s get s_strl error", __func__); return -1; } if (s_ctrl->sensor == NULL || s_ctrl->sensor->func_tbl == NULL || s_ctrl->csi_ctrl == NULL || s_ctrl->csi_ctrl->hisi_csi_disable == NULL) return rc; rc = s_ctrl->sensor->func_tbl->sensor_config(s_ctrl, (void *)(&cdata)); rc |= s_ctrl->csi_ctrl->hisi_csi_disable(s_ctrl->sensor->sensor_info->csi_index); cam_notice(" enter %s,return value %d", __func__,rc); return rc; }
static long hisi_pmic_subdev_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) { struct hisi_pmic_ctrl_t *pmic_ctrl = get_sctrl(sd); //long rc = 0; if (!pmic_ctrl) { cam_err("%s pmic_ctrl is NULL\n", __func__); return -EBADF; } cam_info("%s cmd = 0x%x\n", __func__, cmd); switch (cmd) { case 0: return pmic_ctrl->func_tbl->pmic_config(pmic_ctrl, arg); default: cam_err("%s cmd is error .", __func__); return -ENOIOCTLCMD; } }
static long msm_sensor_subdev_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) { struct msm_sensor_ctrl_t *s_ctrl = get_sctrl(sd); void __user *argp = (void __user *)arg; if (!s_ctrl) { pr_err("%s s_ctrl NULL\n", __func__); return -EBADF; } switch (cmd) { case VIDIOC_MSM_SENSOR_CFG: return s_ctrl->func_tbl->sensor_config(s_ctrl, argp); case VIDIOC_MSM_SENSOR_GET_AF_STATUS: return msm_sensor_get_af_status(s_ctrl, argp); case VIDIOC_MSM_SENSOR_RELEASE: msm_sensor_stop_stream(s_ctrl); return 0; case MSM_SD_SHUTDOWN: return 0; default: return -ENOIOCTLCMD; } }
long msm_sensor_subdev_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) { struct msm_sensor_ctrl_t *s_ctrl = get_sctrl(sd); void __user *argp = (void __user *)arg; if (s_ctrl->sensor_state == MSM_SENSOR_POWER_DOWN) return -EINVAL; switch (cmd) { case VIDIOC_MSM_SENSOR_CFG: return s_ctrl->func_tbl->sensor_config(s_ctrl, argp); case VIDIOC_MSM_SENSOR_RELEASE: return msm_sensor_release(s_ctrl); case VIDIOC_MSM_SENSOR_CSID_INFO: { struct msm_sensor_csi_info *csi_info = (struct msm_sensor_csi_info *)arg; s_ctrl->csid_version = csi_info->csid_version; s_ctrl->is_csic = csi_info->is_csic; return 0; } default: return -ENOIOCTLCMD; } }
int32_t msm_sensor_power(struct v4l2_subdev *sd, int on) { int rc = 0; struct msm_sensor_ctrl_t *s_ctrl = get_sctrl(sd); mutex_lock(s_ctrl->msm_sensor_mutex); if (on) { rc = s_ctrl->func_tbl->sensor_power_up(s_ctrl); if (rc < 0) { pr_err("%s: %s power_up failed rc = %d\n", __func__, s_ctrl->sensordata->sensor_name, rc); s_ctrl->sensor_state = MSM_SENSOR_POWER_DOWN; } else { if (s_ctrl->func_tbl->sensor_match_id) rc = s_ctrl->func_tbl->sensor_match_id(s_ctrl); else rc = msm_sensor_match_id(s_ctrl); if (rc < 0) { pr_err("%s: %s match_id failed rc=%d\n", __func__, s_ctrl->sensordata->sensor_name, rc); if (s_ctrl->func_tbl->sensor_power_down(s_ctrl) < 0) pr_err("%s: %s power_down failed\n", __func__, s_ctrl->sensordata->sensor_name); s_ctrl->sensor_state = MSM_SENSOR_POWER_DOWN; } s_ctrl->sensor_state = MSM_SENSOR_POWER_UP; } } else { rc = s_ctrl->func_tbl->sensor_power_down(s_ctrl); s_ctrl->sensor_state = MSM_SENSOR_POWER_DOWN; } mutex_unlock(s_ctrl->msm_sensor_mutex); return rc; }
long sr130pc10_sensor_subdev_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) { void __user *argp = (void __user *)arg; struct msm_sensor_ctrl_t *sr130pc10_s_ctrl = get_sctrl(sd); pr_info("sr130pc10_sensor_subdev_ioctl : E\n"); switch (cmd) { case VIDIOC_MSM_SENSOR_CFG: return sr130pc10_sensor_config(sr130pc10_s_ctrl, argp); case VIDIOC_MSM_SENSOR_CSID_INFO: { struct msm_sensor_csi_info *csi_info = (struct msm_sensor_csi_info *)arg; pr_info("is_csic = %d", csi_info->is_csic); sr130pc10_s_ctrl->is_csic = csi_info->is_csic; return 0; } default: pr_info("[%s] default(cmd:%d)\n", __func__, cmd); return -ENOIOCTLCMD; } }