예제 #1
0
static int s5k6aafx13_config_csi(void)
{
	struct msm_camera_csi_params *csi = NULL;
	int rc = 0;

	CDBG("%s E\n", __func__);

	csi = kmalloc(sizeof(struct msm_camera_csi_params), GFP_KERNEL);
	if (!csi) {
		CERR("%s err(-ENOMEM)", __func__);
		return -ENOMEM;
	}

	csi->data_format = CSI_8BIT;
	csi->lane_cnt    = 1;
	csi->lane_assign = 0xe4;
	csi->settle_cnt  = 0x14;
	csi->dpcm_scheme = 0;

	rc = msm_camio_csi_config(csi);
	if (rc < 0) {
		kfree(csi);
		CERR("%s err(%d)\n", __func__, rc);
		return rc;
	}

	msleep(10);

	config_csi_done = true;
	kfree(csi);

	CDBG("%s X\n", __func__);
	return 0;
}
예제 #2
0
static int mc7_monitor_mode(int mode)
{
	int rc = 0;
	unsigned int val;
	struct msm_camera_csi_params mc7_csi_params;

	FUNC_ENTER();

	if (!config_csi) {
		mc7_csi_params.lane_cnt = 2;
		mc7_csi_params.data_format = CSI_8BIT;
		mc7_csi_params.lane_assign = 0xe4;
		mc7_csi_params.dpcm_scheme = 0;
		mc7_csi_params.settle_cnt = 0x14;
		rc = msm_camio_csi_config(&mc7_csi_params);
		if (rc < 0)
			printk(KERN_ERR "config csi controller failed \n");
		config_csi = 1;
	}

	if (return_from_capture) {
		/* Stop sending large frames */
		mc7_catparam_i2c_write(1, 0x0c, 0x09, 0x02);
		return_from_capture = 0;
	}

	mc7_catparam_i2c_write(1, 0x01, 0x01, 0x17);
	mc7_catparam_i2c_write(1, 0x00, 0x10, 0x01);
	mc7_catparam_i2c_write(1, 0x00, 0x0B, 0x02);
	wait_mc7_int(60);
	mc7_catparam_i2c_read(1, 0x0, 0x1c, &val);
	/* Now MC7 starts outputing YUV data */
	MC7DBG("successfully entered monitor mode\n");

	/* Move the lens to infinity */
	mc7_catparam_i2c_write(1, 0x0a, 0x10, 0x01);

	return rc;
}