Ejemplo n.º 1
0
int rawchip_open_init(void)
{
	int rc = 0;
	struct msm_camera_rawchip_info *pdata = rawchipCtrl->pdata;
	int read_id_retry = 0;

	pr_info("%s\n", __func__);

open_read_id_retry:
	rc = rawchip_power_up(pdata);
	if (rc < 0)
		return rc;

	rc = rawchip_match_id();
	if (rc < 0) {
		if (read_id_retry < 3) {
			pr_info("retry read rawchip ID: %d\n", read_id_retry);
			read_id_retry++;
			rawchip_power_down(pdata);
			goto open_read_id_retry;
		}
		goto open_init_failed;
	}

	init_waitqueue_head(&yushan_int.yushan_wait);
	spin_lock_init(&yushan_int.yushan_spin_lock);
	atomic_set(&interrupt, 0);
	atomic_set(&interrupt2, 0);

	
	rc = request_irq(pdata->rawchip_intr0, yushan_irq_handler,
		IRQF_TRIGGER_HIGH, "yushan_irq", 0);
	if (rc < 0) {
		pr_err("request irq intr0 failed\n");
		goto open_init_failed;
	}

	rc = request_irq(pdata->rawchip_intr1, yushan_irq_handler2,
		IRQF_TRIGGER_HIGH, "yushan_irq2", 0);
	if (rc < 0) {
		pr_err("request irq intr1 failed\n");
		free_irq(pdata->rawchip_intr0, 0);
		goto open_init_failed;
	}

	rawchipCtrl->rawchip_init = 0;
	atomic_set(&rawchipCtrl->check_intr0, 0);
	atomic_set(&rawchipCtrl->check_intr1, 0);
	rawchip_intr0 = pdata->rawchip_intr0;
	rawchip_intr1 = pdata->rawchip_intr1;

	return rc;

open_init_failed:
	pr_err("%s: rawchip_open_init failed\n", __func__);
	rawchip_power_down(pdata);

	return rc;
}
Ejemplo n.º 2
0
int rawchip_open_init(void)
{
    int rc = 0;
    struct msm_camera_rawchip_info *pdata = rawchipCtrl->pdata;
    int i;

    pr_info("%s\n", __func__);

    rc = rawchip_power_up(pdata);
    if (rc < 0)
        return rc;

    rc = rawchip_match_id();
    if (rc < 0) {
        pr_err("read rawchip ID failed\n");
        rawchip_power_down(pdata);
        return rc;
    }

    init_waitqueue_head(&yushan_int.yushan_wait);
    spin_lock_init(&yushan_int.yushan_spin_lock);
    atomic_set(&interrupt, 0);
    atomic_set(&interrupt2, 0);


    rc = request_irq(MSM_GPIO_TO_INT(pdata->rawchip_intr0), yushan_irq_handler,
                     IRQF_TRIGGER_HIGH, "yushan_irq", 0);
    if (rc < 0) {
        pr_err("request irq intr0 failed rc=%d\n", rc);
        rawchip_power_down(pdata);
        return rc;
    }

    rc = request_irq(MSM_GPIO_TO_INT(pdata->rawchip_intr1), yushan_irq_handler2,
                     IRQF_TRIGGER_HIGH, "yushan_irq2", 0);
    if (rc < 0) {
        pr_err("request irq intr1 failed rc=%d\n", rc);
        free_irq(MSM_GPIO_TO_INT(pdata->rawchip_intr0), 0);
        rawchip_power_down(pdata);
        return rc;
    }

    rawchipCtrl->rawchip_init = 0;
    rawchipCtrl->total_error_interrupt_times = 0;
    for (i = 0; i < TOTAL_INTERRUPT_COUNT; i++)
        rawchipCtrl->error_interrupt_times[i] = 0;
    atomic_set(&rawchipCtrl->check_intr0, 0);
    atomic_set(&rawchipCtrl->check_intr1, 0);
    rawchip_intr0 = pdata->rawchip_intr0;
    rawchip_intr1 = pdata->rawchip_intr1;

    return rc;

}
Ejemplo n.º 3
0
void rawchip_probe_deinit(void)
{
	struct msm_camera_rawchip_info *pdata = rawchipCtrl->pdata;
	CDBG("%s\n", __func__);

	rawchip_power_down(pdata);
}
Ejemplo n.º 4
0
int rawchip_probe_init(void)
{
    int rc = 0;
    struct msm_camera_rawchip_info *pdata = rawchipCtrl->pdata;

    pr_info("%s\n", __func__);

    if (rawchipCtrl == NULL) {
        pr_err("already failed in __msm_rawchip_probe\n");
        return -EINVAL;
    }

    rc = rawchip_power_up(pdata);
    if (rc < 0)
        return rc;

    rc = rawchip_match_id();
    if (rc < 0) {
        pr_err("read rawchip ID failed\n");
        rawchip_power_down(pdata);
        return rc;
    }

    pr_info("%s: probe_success\n", __func__);
    return rc;

}
Ejemplo n.º 5
0
int rawchip_probe_init(void)
{
	int rc = 0;
	struct msm_camera_rawchip_info *pdata = rawchipCtrl->pdata;
	int read_id_retry = 0;

	pr_info("%s\n", __func__);

	if (rawchipCtrl == NULL) {
		pr_err("already failed in __msm_rawchip_probe\n");
		return -EINVAL;
	}

	rc = rawchip_spi_init();
	if (rc < 0) {
		pr_err("%s: failed to register spi driver\n", __func__);
		return rc;
	}

probe_read_id_retry:
	rc = rawchip_power_up(pdata);
	if (rc < 0)
		return rc;

	rc = rawchip_match_id();
	if (rc < 0) {
		if (read_id_retry < 3) {
			pr_info("retry read rawchip ID: %d\n", read_id_retry);
			read_id_retry++;
			rawchip_power_down(pdata);
			goto probe_read_id_retry;
		}
		goto probe_init_fail;
	}

	pr_info("%s: probe_success\n", __func__);
	return rc;

probe_init_fail:
	pr_err("%s: rawchip_probe_init failed\n", __func__);
	rawchip_power_down(pdata);
	return rc;
}
Ejemplo n.º 6
0
void rawchip_release(void)
{
	struct msm_camera_rawchip_info *pdata = rawchipCtrl->pdata;

	pr_info("%s\n", __func__);

	CDBG("[CAM] rawchip free irq");
	free_irq(pdata->rawchip_intr0, 0);
	free_irq(pdata->rawchip_intr1, 0);

	rawchip_power_down(pdata);
}