int __init archos_camera_mt9m114_init(void)
{
	const struct archos_camera_config *camera_cfg;

	pr_debug("%s\n", __FUNCTION__);

	camera_cfg = omap_get_config( ARCHOS_TAG_CAMERA, struct archos_camera_config );
	if (camera_cfg == NULL) {
		printk(KERN_DEBUG "archos_camera_init: no board configuration found\n");
		return -ENODEV;
	}
	if ( system_rev >= camera_cfg->nrev ) {
		printk(KERN_DEBUG "archos_camera_init: system_rev (%i) >= nrev (%i)\n",
			system_rev, camera_cfg->nrev);
		return -ENODEV;
	}

	reset_gpio = camera_cfg->rev[system_rev].reset;

	omap_mux_init_gpio(reset_gpio, OMAP_PIN_INPUT);
	gpio_set_value(reset_gpio, 0);

	init_cam_clk();

	omap_mux_init_signal("fref_clk2_out", OMAP_PIN_OUTPUT);
	
	omap_mux_init_signal("csi21_dx0.csi21_dx0", OMAP_PIN_INPUT);
	omap_mux_init_signal("csi21_dy0.csi21_dy0", OMAP_PIN_INPUT);
	omap_mux_init_signal("csi21_dx1.csi21_dx1", OMAP_PIN_INPUT);
	omap_mux_init_signal("csi21_dy1.csi21_dy1", OMAP_PIN_INPUT);

	return 0;
}
Exemple #2
0
static void enable(int on_off)
{
	static int state = 0;

	if (state == on_off)
		return;

	if (on_off) {

		regulator_enable(cam_vdd);

		if (!IS_ERR(cam_1v8)) {
			regulator_enable(cam_1v8);
		}

		msleep(10);

		init_cam_clk();

	} else {
		if (!IS_ERR(cam_1v8))
			regulator_disable(cam_1v8);

		regulator_disable(cam_vdd);
	}

	state = on_off;
}