コード例 #1
0
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;
	}
}
コード例 #2
0
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;
}
コード例 #3
0
ファイル: hw_pmic.c プロジェクト: herryfan/kernel-huawei-h60
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;
    }
}
コード例 #4
0
ファイル: msm_sensor.c プロジェクト: sndnvaps/G718c_kernel
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;
	}
}
コード例 #5
0
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;
	}
}
コード例 #6
0
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;
}
コード例 #7
0
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;
	}
}