Exemplo n.º 1
0
static int __init omap3beagle_soc_init(void)
{
	int ret;

	if (!machine_is_omap3_beagle()) {
		pr_debug("Not OMAP3 Beagle!\n");
		return -ENODEV;
	}
	pr_info("OMAP3 Beagle SoC init\n");

	omap3beagle_snd_device = platform_device_alloc("soc-audio", -1);
	if (!omap3beagle_snd_device) {
		printk(KERN_ERR "Platform device allocation failed\n");
		return -ENOMEM;
	}

	platform_set_drvdata(omap3beagle_snd_device, &omap3beagle_snd_devdata);
	omap3beagle_snd_devdata.dev = &omap3beagle_snd_device->dev;
	*(unsigned int *)omap3beagle_dai.cpu_dai->private_data = 1; /* McBSP2 */

	ret = platform_device_add(omap3beagle_snd_device);
	if (ret)
		goto err1;

	return 0;

err1:
	printk(KERN_ERR "Unable to add platform device\n");
	platform_device_put(omap3beagle_snd_device);

	return ret;
}
static int __init omap3beagle_soc_init(void)
{
	int ret;

	if (!(machine_is_omap3_beagle() || machine_is_devkit8000()))
		return -ENODEV;
	pr_info("OMAP3 Beagle/Devkit8000 SoC init\n");

	omap3beagle_snd_device = platform_device_alloc("soc-audio", -1);
	if (!omap3beagle_snd_device) {
		printk(KERN_ERR "Platform device allocation failed\n");
		return -ENOMEM;
	}

	platform_set_drvdata(omap3beagle_snd_device, &snd_soc_omap3beagle);

	ret = platform_device_add(omap3beagle_snd_device);
	if (ret)
		goto err1;

	return 0;

err1:
	printk(KERN_ERR "Unable to add platform device\n");
	platform_device_put(omap3beagle_snd_device);

	return ret;
}
Exemplo n.º 3
0
static int __init omap3_beagle_late_initcall(void)
{
	if (!machine_is_omap3_beagle())
		return 0;

	if (!cpu_is_omap3630())
		return 0;

#if defined(CONFIG_VIDEO_MT9P031)
	if ((!strcmp(camera_name, "lbcm5m1")) || (!strcmp(camera_name, "li5m03")))
	{
		pr_info("Beagle camera: MT9P031 init\n");

		reg_1v8 = regulator_get(NULL, "cam_1v8");
		if (IS_ERR(reg_1v8))
			pr_err("%s: cannot get cam_1v8 regulator\n", __func__);
		else
			regulator_enable(reg_1v8);

		reg_2v8 = regulator_get(NULL, "cam_2v8");
		if (IS_ERR(reg_2v8))
			pr_err("%s: cannot get cam_2v8 regulator\n", __func__);
		else
			regulator_enable(reg_2v8);

		omap3_init_camera(&beagle_isp_platform_data);
	}
#endif
	return 0;
}
Exemplo n.º 4
0
static int __init expansionboard2_setup(char *str)
{
	if (!machine_is_omap3_beagle())
		return 0;

	if (!str)
		return -EINVAL;
	strncpy(expansionboard2_name, str, 16);
	pr_info("Beagle expansionboard2: %s\n", expansionboard2_name);
	return 0;
}
Exemplo n.º 5
0
static int __init wl12xx_setup(char *str)
{
	if (!machine_is_omap3_beagle())
		return 0;

	if (!str)
		return -EINVAL;
	strncpy(wl12xx_name, str, 16);
	pr_info("Beagle wl12xx clk: %s\n", wl12xx_name);
	return 0;
}
Exemplo n.º 6
0
static int __init camera_setup(char *str)
{
	if (!machine_is_omap3_beagle())
		return 0;

	if (!str)
		return -EINVAL;
	strncpy(camera_name, str, 16);
	pr_info("Beagle camera: %s\n", camera_name);
	return 0;
}
Exemplo n.º 7
0
static int __init beagle_opp_init(void)
{
	int r = 0;

	if (!machine_is_omap3_beagle())
		return 0;

	/* Initialize the omap3 opp table if not already created. */
	r = omap3_opp_init();
	if (r < 0 && (r != -EEXIST)) {
		pr_err("%s: opp default init failed\n", __func__);
		return r;
	}

	/* Custom OPP enabled for all xM versions */
	if (cpu_is_omap3630()) {
		struct device *mpu_dev, *iva_dev;

		mpu_dev = get_cpu_device(0);
		iva_dev = omap_device_get_by_hwmod_name("iva");

		if (!mpu_dev || IS_ERR(iva_dev)) {
			pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n",
				__func__, mpu_dev, iva_dev);
			return -ENODEV;
		}
		/* Enable MPU 1GHz and lower opps */
		r = dev_pm_opp_enable(mpu_dev, 800000000);
		/* TODO: MPU 1GHz needs SR and ABB */

		/* Enable IVA 800MHz and lower opps */
		r |= dev_pm_opp_enable(iva_dev, 660000000);
		/* TODO: DSP 800MHz needs SR and ABB */
		if (r) {
			pr_err("%s: failed to enable higher opp %d\n",
				__func__, r);
			/*
			 * Cleanup - disable the higher freqs - we dont care
			 * about the results
			 */
			dev_pm_opp_disable(mpu_dev, 800000000);
			dev_pm_opp_disable(iva_dev, 660000000);
		}
	}
	return 0;
}
static int __init beagle_camera_init(void)
{
	if (!machine_is_omap3_beagle() || !cpu_is_omap3630())
		return 0;

	reg_1v8 = regulator_get(NULL, "cam_1v8");
	if (IS_ERR(reg_1v8))
		pr_err("%s: cannot get cam_1v8 regulator\n", __func__);
	else
		regulator_enable(reg_1v8);

	reg_2v8 = regulator_get(NULL, "cam_2v8");
	if (IS_ERR(reg_2v8))
		pr_err("%s: cannot get cam_2v8 regulator\n", __func__);
	else
		regulator_enable(reg_2v8);

	omap_register_i2c_bus(2, 100, NULL, 0);
#ifdef CONFIG_VIDEO_AP0100
        gpio_request(AP0100_RESET_GPIO, "cam_rst");
        gpio_direction_output(AP0100_RESET_GPIO, 0);
#endif
#ifdef CONFIG_VIDEO_AR0130
        gpio_request(AR0130_RESET_GPIO, "cam_rst");
        gpio_direction_output(AR0130_RESET_GPIO, 0);
#endif
#ifdef CONFIG_VIDEO_MT9D131
	gpio_request(MT9D131_RESET_GPIO, "cam_rst");
	gpio_direction_output(MT9D131_RESET_GPIO, 0);
#endif
#ifdef CONFIG_VIDEO_MT9P006
	gpio_request(MT9P006_RESET_GPIO, "cam_rst");
	gpio_direction_output(MT9P006_RESET_GPIO, 0);
#endif
#ifdef CONFIG_VIDEO_MT9P017
	gpio_request(MT9P017_RESET_GPIO, "cam_rst");
	gpio_direction_output(MT9P017_RESET_GPIO, 0);
#endif
#ifdef CONFIG_VIDEO_MT9P031
	gpio_request(MT9P031_RESET_GPIO, "cam_rst");
	gpio_direction_output(MT9P031_RESET_GPIO, 0);
#endif
#ifdef CONFIG_VIDEO_MT9P111
	gpio_request(MT9P111_RESET_GPIO, "cam_rst");
	gpio_direction_output(MT9P111_RESET_GPIO, 0);
#endif
#ifdef CONFIG_VIDEO_MT9T111
	gpio_request(MT9T111_RESET_GPIO, "cam_rst");
	gpio_direction_output(MT9T111_RESET_GPIO, 0);
#endif
#ifdef CONFIG_VIDEO_MT9V032
	gpio_request(MT9V032_RESET_GPIO, "cam_rst");
	gpio_direction_output(MT9V032_RESET_GPIO, 0);
#endif
#ifdef CONFIG_VIDEO_MT9V034
	gpio_request(MT9V034_RESET_GPIO, "cam_rst");
	gpio_direction_output(MT9V034_RESET_GPIO, 0);
#endif
#ifdef CONFIG_VIDEO_MT9V128
	gpio_request(MT9V128_RESET_GPIO, "cam_rst");
	gpio_direction_output(MT9V128_RESET_GPIO, 0);
#endif
#ifdef CONFIG_VIDEO_MT9V113
	gpio_request(MT9V113_RESET_GPIO, "cam_rst");
	gpio_direction_output(MT9V113_RESET_GPIO, 0);
#endif
#ifdef CONFIG_VIDEO_MT9M021
	gpio_request(MT9M021_RESET_GPIO, "cam_rst");
	gpio_direction_output(MT9M021_RESET_GPIO, 0);
#endif

	omap3_init_camera(&beagle_isp_platform_data); //Enable >1 Aptina driver
	return 0;
}