Exemplo n.º 1
0
static long msm_ispif_subdev_ioctl(struct v4l2_subdev *sd,
                                   unsigned int cmd, void *arg)
{
    struct ispif_device *ispif =
        (struct ispif_device *)v4l2_get_subdevdata(sd);

    switch (cmd) {
    case VIDIOC_MSM_ISPIF_CFG:
        return msm_ispif_cmd(sd, arg);
    case MSM_SD_NOTIFY_FREEZE: {
        ispif->ispif_sof_debug = 0;
        return 0;
    }
    case MSM_SD_SHUTDOWN: {
        struct ispif_device *ispif =
            (struct ispif_device *)v4l2_get_subdevdata(sd);
        if (ispif && ispif->base)
            msm_ispif_release(ispif);
        return 0;
    }
    default:
        pr_err_ratelimited("%s: invalid cmd 0x%x received\n",
                           __func__, cmd);
        return -ENOIOCTLCMD;
    }
}
static long msm_ispif_subdev_ioctl(struct v4l2_subdev *sd,
	unsigned int cmd, void *arg)
{
#ifdef CONFIG_COMPAT
	void __user *up;
	if (is_compat_task()) {
		up = (void __user *)compat_ptr((unsigned long)arg);
		arg = up;
	}
#endif

	switch (cmd) {
	case VIDIOC_MSM_ISPIF_CFG:
		return msm_ispif_cmd(sd, arg);
	case MSM_SD_SHUTDOWN: {
		struct ispif_device *ispif =
			(struct ispif_device *)v4l2_get_subdevdata(sd);
		if (ispif && ispif->base)
			msm_ispif_release(ispif);
		return 0;
	}
	default:
		pr_err_ratelimited("%s: invalid cmd 0x%x received\n",
			__func__, cmd);
		return -ENOIOCTLCMD;
	}
}
static long msm_ispif_cmd(struct v4l2_subdev *sd, void *arg)
{
	long rc = 0;
	struct ispif_cfg_data *pcdata = (struct ispif_cfg_data *)arg;
	struct ispif_device *ispif =
		(struct ispif_device *)v4l2_get_subdevdata(sd);

	BUG_ON(!sd);
	BUG_ON(!pcdata);

	mutex_lock(&ispif->mutex);
	switch (pcdata->cfg_type) {
	case ISPIF_ENABLE_REG_DUMP:
		ispif->enb_dump_reg = pcdata->reg_dump; /* save dump config */
		break;
	case ISPIF_INIT:
		rc = msm_ispif_init(ispif, pcdata->csid_version);
		msm_ispif_io_dump_reg(ispif);
		break;
	case ISPIF_CFG:
		rc = msm_ispif_config(ispif, &pcdata->params);
		msm_ispif_io_dump_reg(ispif);
		break;
	case ISPIF_START_FRAME_BOUNDARY:
		rc = msm_ispif_start_frame_boundary(ispif, &pcdata->params);
		msm_ispif_io_dump_reg(ispif);
		break;
	case ISPIF_RESTART_FRAME_BOUNDARY:
		rc = msm_ispif_restart_frame_boundary(ispif, &pcdata->params);
		msm_ispif_io_dump_reg(ispif);
		break;

	case ISPIF_STOP_FRAME_BOUNDARY:
		rc = msm_ispif_stop_frame_boundary(ispif, &pcdata->params);
		msm_ispif_io_dump_reg(ispif);
		break;
	case ISPIF_STOP_IMMEDIATELY:
		rc = msm_ispif_stop_immediately(ispif, &pcdata->params);
		msm_ispif_io_dump_reg(ispif);
		break;
	case ISPIF_RELEASE:
		msm_ispif_release(ispif);
		break;
	case ISPIF_SET_VFE_INFO:
		rc = msm_ispif_set_vfe_info(ispif, &pcdata->vfe_info);
		break;
	default:
		pr_err("%s: invalid cfg_type\n", __func__);
		rc = -EINVAL;
		break;
	}
	mutex_unlock(&ispif->mutex);
	return rc;
}
Exemplo n.º 4
0
static long msm_ispif_subdev_ioctl(struct v4l2_subdev *sd,
	unsigned int cmd, void *arg)
{
	switch (cmd) {
	case VIDIOC_MSM_ISPIF_CFG:
		return msm_ispif_cmd(sd, arg);
	case MSM_SD_SHUTDOWN: {
		struct ispif_device *ispif =
			(struct ispif_device *)v4l2_get_subdevdata(sd);
		msm_ispif_release(ispif);
		return 0;
	}
	default:
		pr_err("%s: invalid cmd 0x%x received\n", __func__, cmd);
		return -ENOIOCTLCMD;
	}
}
Exemplo n.º 5
0
static int ispif_close_node(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
{
	int rc = 0;
	struct ispif_device *ispif = v4l2_get_subdevdata(sd);
	if (!ispif) {
		pr_err("%s: invalid input\n", __func__);
		return -EINVAL;
	}

	mutex_lock(&ispif->mutex);
	if (ispif->open_cnt == 0) {
		pr_err("%s: Invalid close\n", __func__);
		rc = -ENODEV;
		goto end;
	}
	ispif->open_cnt--;
	if (ispif->open_cnt == 0)
		msm_ispif_release(ispif);
end:
	mutex_unlock(&ispif->mutex);
	return rc;
}
Exemplo n.º 6
0
void msm_camio_disable(struct platform_device *pdev)
{

	free_irq(camio_ext.csiphy, 0);
	iounmap(csiphybase);
	release_mem_region(camio_ext.csiphyphy, camio_ext.csiphysz);

	free_irq(camio_ext.csiirq, 0);
	iounmap(csidbase);
	release_mem_region(camio_ext.csiphy, camio_ext.csisz);
	return;
	msm_camio_clk_disable(CAMIO_CSI0_PCLK);
	msm_camio_clk_disable(CAMIO_CSIPHY1_TIMER_CLK);
	msm_camio_clk_disable(CAMIO_CSIPHY0_TIMER_CLK);
	msm_camio_clk_disable(CAMIO_CSI_RDI_CLK);
	msm_camio_clk_disable(CAMIO_CSI_PIX_CLK);
	msm_camio_clk_disable(CAMIO_CSI1_CLK);
	msm_camio_clk_disable(CAMIO_CSI0_CLK);
	msm_camio_clk_disable(CAMIO_CSI1_SRC_CLK);
	msm_camio_clk_disable(CAMIO_CSI_SRC_CLK);
	msm_camio_clk_disable(CAMIO_CSI0_VFE_CLK);
	msm_camio_clk_disable(CAMIO_VFE_CLK);
	msm_ispif_release(pdev);
}