예제 #1
0
파일: csis.c 프로젝트: SelfImp/m9
void s3c_csis_start(int lanes, int settle, int align, int width,
		int height, int pixel_format)
{
	struct platform_device *pdev = to_platform_device(s3c_csis->dev);
	struct s3c_platform_csis *pdata;

	/* clock & power on */
	s3c_csis_clk_on(pdev);
	pdata = to_csis_plat(s3c_csis->dev);
	if (pdata->cfg_phy_global)
		pdata->cfg_phy_global(pdev, 1);

	s3c_csis_reset();
	s3c_csis_set_nr_lanes(lanes);

#ifdef CONFIG_MIPI_CSI_ADV_FEATURE
	/* FIXME: how configure the followings with FIMC dynamically? */
	s3c_csis_set_hs_settle(settle);	/* s5k6aa */
	s3c_csis_set_data_align(align);
	s3c_csis_set_wclk(0);
	if (pixel_format == V4L2_PIX_FMT_JPEG)
		s3c_csis_set_format(MIPI_USER_DEF_PACKET_1);
	else
		s3c_csis_set_format(MIPI_CSI_YCBCR422_8BIT);
	s3c_csis_set_resol(width, height);
	s3c_csis_update_shadow();
#endif

	s3c_csis_enable_interrupt();
	s3c_csis_system_on();
	s3c_csis_phy_on();

	info("Samsung MIPI-CSI2 operation started\n");
}
예제 #2
0
파일: csis.c 프로젝트: SelfImp/m9
static int s3c_csis_probe(struct platform_device *pdev)
{
	struct s3c_platform_csis *pdata;
	struct resource *res;

	s3c_csis_set_info();

	s3c_csis->dev = &pdev->dev;
	s3c_csis->clockon = 0;

	pdata = to_csis_plat(&pdev->dev);
	if (pdata->cfg_gpio)
		pdata->cfg_gpio();

	/* Get csis power domain regulator */
	s3c_csis->regulator = regulator_get(&pdev->dev, "pd");
	if (IS_ERR(s3c_csis->regulator)) {
		err("%s: failed to get regulator %s\n",
				__func__, pdev->name);
		return PTR_ERR(s3c_csis->regulator);
	}
	/* clock & power on */
	s3c_csis_clk_on(pdev);

	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	if (!res) {
		err("failed to get io memory region\n");
		return -EINVAL;
	}

	res = request_mem_region(res->start,
			res->end - res->start + 1, pdev->name);
	if (!res) {
		err("failed to request io memory region\n");
		return -EINVAL;
	}

	/* ioremap for register block */
	s3c_csis->regs = ioremap(res->start, res->end - res->start + 1);
	if (!s3c_csis->regs) {
		err("failed to remap io region\n");
		return -EINVAL;
	}

	/* irq */
	s3c_csis->irq = platform_get_irq(pdev, 0);
	if (request_irq(s3c_csis->irq, s3c_csis_irq, IRQF_DISABLED, \
		s3c_csis->name, s3c_csis))
		err("request_irq failed\n");

	pr_info("Samsung MIPI-CSI2 driver probed successfully\n");

	s3c_csis_clk_off(pdev);
	return 0;
}
예제 #3
0
/* wakeup */
int s3c_csis_resume(struct platform_device *pdev)
{
	s3c_csis_clk_on(pdev);
	return 0;
}