Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8e31df20 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: Proper probe deferral in pproc driver"

parents d35ac49e 3a082f65
Loading
Loading
Loading
Loading
+17 −3
Original line number Diff line number Diff line
@@ -715,7 +715,6 @@ static int cpp_init_hardware(struct cpp_device *cpp_dev)
			IRQF_TRIGGER_RISING, "cpp", cpp_dev);
		if (rc < 0) {
			pr_err("irq request fail\n");
			rc = -EBUSY;
			goto req_irq_fail;
		}
		cpp_dev->buf_mgr_subdev = msm_buf_mngr_get_subdev();
@@ -862,6 +861,7 @@ static void cpp_load_fw(struct cpp_device *cpp_dev, char *fw_name_bin)

static int cpp_open_node(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
{
	int rc;
	uint32_t i;
	struct cpp_device *cpp_dev = v4l2_get_subdevdata(sd);
	CPP_DBG("E\n");
@@ -889,7 +889,15 @@ static int cpp_open_node(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
	CPP_DBG("open %d %p\n", i, &fh->vfh);
	cpp_dev->cpp_open_cnt++;
	if (cpp_dev->cpp_open_cnt == 1) {
		cpp_init_hardware(cpp_dev);
		rc = cpp_init_hardware(cpp_dev);
		if (rc < 0) {
			cpp_dev->cpp_open_cnt--;
			cpp_dev->cpp_subscribe_list[i].active = 0;
			cpp_dev->cpp_subscribe_list[i].vfh = NULL;
			mutex_unlock(&cpp_dev->mutex);
			return rc;
		}

		iommu_attach_device(cpp_dev->domain, cpp_dev->iommu_ctx);
		cpp_init_mem(cpp_dev);
		cpp_dev->state = CPP_STATE_IDLE;
@@ -1963,7 +1971,10 @@ static int cpp_probe(struct platform_device *pdev)
	cpp_dev->msm_sd.sd.devnode->fops = &msm_cpp_v4l2_subdev_fops;
	cpp_dev->msm_sd.sd.entity.revision = cpp_dev->msm_sd.sd.devnode->num;
	cpp_dev->state = CPP_STATE_BOOT;
	cpp_init_hardware(cpp_dev);

	rc = cpp_init_hardware(cpp_dev);
	if (rc < 0)
		goto CPP_PROBE_INIT_ERROR;

	msm_camera_io_w(0x0, cpp_dev->base +
					   MSM_CPP_MICRO_IRQGEN_MASK);
@@ -1995,6 +2006,9 @@ static int cpp_probe(struct platform_device *pdev)
	else
		CPP_DBG("FAILED.");
	return rc;
CPP_PROBE_INIT_ERROR:
	media_entity_cleanup(&cpp_dev->msm_sd.sd.entity);
	msm_sd_unregister(&cpp_dev->msm_sd);
ERROR3:
	release_mem_region(cpp_dev->mem->start, resource_size(cpp_dev->mem));
ERROR2:
+0 −3
Original line number Diff line number Diff line
@@ -512,7 +512,6 @@ static int vpe_init_hardware(struct vpe_device *vpe_dev)
	rc = msm_cam_clk_enable(&vpe_dev->pdev->dev, vpe_clk_info,
				vpe_dev->vpe_clk, ARRAY_SIZE(vpe_clk_info), 1);
	if (rc < 0) {
		rc = -ENODEV;
		pr_err("clk enable failed\n");
		goto disable_and_put_regulator;
	}
@@ -602,7 +601,6 @@ static int vpe_open_node(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
		if (rc < 0) {
			pr_err("%s: Couldn't init vpe hardware\n", __func__);
			vpe_dev->vpe_open_cnt--;
			rc = -ENODEV;
			goto err_fixup_sub_list;
		}
		rc = vpe_init_mem(vpe_dev);
@@ -1565,7 +1563,6 @@ static int vpe_probe(struct platform_device *pdev)
	rc = vpe_init_hardware(vpe_dev);
	if (rc < 0) {
		pr_err("%s: Couldn't init vpe hardware\n", __func__);
		rc = -ENODEV;
		goto err_unregister_sd;
	}
	vpe_reset(vpe_dev);