コード例 #1
0
/* PLATFORM DEVICE */
static int omap_dss_probe(struct platform_device *pdev)
{
	struct omap_dss_board_info *pdata = pdev->dev.platform_data;
	int skip_init = 0;
	int r;
	int i;

	core.pdev = pdev;

	dss_init_overlay_managers(pdev);
	dss_init_overlays(pdev);

	/*
	 * FIX-ME: Replace with correct clk node when clk
	 * framework is available
	 */
	if (!cpu_is_omap44xx()) {
		r = dss_get_clocks();
		if (r)
			goto fail0;
	}

	dss_clk_enable_all_no_ctx();

	core.ctx_id = dss_get_ctx_id();
	DSSDBG("initial ctx id %u\n", core.ctx_id);

#ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
	/* DISPC_CONTROL */
	if (omap_readl(0x48050440) & 1)	/* LCD enabled? */
		skip_init = 1;
#endif

	r = dss_init(skip_init);
	if (r) {
		DSSERR("Failed to initialize DSS\n");
		goto fail0;
	}

#ifdef CONFIG_OMAP2_DSS_RFBI
	r = rfbi_init();
	if (r) {
		DSSERR("Failed to initialize rfbi\n");
		goto fail0;
	}
#endif

	r = dpi_init();
	if (r) {
		DSSERR("Failed to initialize dpi\n");
		goto fail0;
	}

	r = dispc_init();
	if (r) {
		DSSERR("Failed to initialize dispc\n");
		goto fail0;
	}
#ifdef CONFIG_OMAP2_DSS_VENC
	r = venc_init(pdev);
	if (r) {
		DSSERR("Failed to initialize venc\n");
		goto fail0;
	}
#endif
	if (cpu_is_omap34xx()) {
#ifdef CONFIG_OMAP2_DSS_SDI
		r = sdi_init(skip_init);
		if (r) {
			DSSERR("Failed to initialize SDI\n");
			goto fail0;
		}
#endif
	}
#ifdef CONFIG_OMAP2_DSS_DSI
		printk(KERN_INFO "dsi_init calling");
		r = dsi_init(pdev);
		if (r) {
			DSSERR("Failed to initialize DSI\n");
			goto fail0;
		}
	if (cpu_is_omap44xx()) {
			printk(KERN_INFO "dsi2_init calling");
		r = dsi2_init(pdev);
		if (r) {
			DSSERR("Failed to initialize DSI2\n");
			goto fail0;
			}
		}
#endif

#ifdef CONFIG_OMAP2_DSS_HDMI
	r = hdmi_init(pdev, hdmi_code);
	if (r) {
		DSSERR("Failed to initialize hdmi\n");
		goto fail0;
	}
#endif
#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT)
	r = dss_initialize_debugfs();
	if (r)
		goto fail0;
#endif

	for (i = 0; i < pdata->num_devices; ++i) {
		struct omap_dss_device *dssdev = pdata->devices[i];

		r = omap_dss_register_device(dssdev);
		if (r)
			DSSERR("device reg failed %d\n", i);

		if (def_disp_name && strcmp(def_disp_name, dssdev->name) == 0)
			pdata->default_device = dssdev;
	}

	dss_clk_disable_all();

	return 0;

	/* XXX fail correctly */
fail0:
	return r;
}
コード例 #2
0
/* PLATFORM DEVICE */
static int omap_dss_probe(struct platform_device *pdev)
{
	struct omap_dss_board_info *pdata = pdev->dev.platform_data;
	int r = 0;
	int i;

	core.pdev = pdev;

	dss_init_overlay_managers(pdev);
	dss_init_overlays(pdev);

#ifdef CONFIG_HAS_EARLYSUSPEND
	omap_pm_set_min_bus_tput(&pdev->dev, OCP_INITIATOR_AGENT, 166 * 1000 * 4);
#endif

	if (cpu_is_omap44xx())
		dss_init_writeback(pdev); /*Write back init*/
#ifdef HWMOD
	if (!cpu_is_omap44xx()) {
		r = dss_get_clocks();
		if (r)
			goto err_clocks;
	}

	core.ctx_id = dss_get_ctx_id();
	DSSDBG("initial ctx id %u\n", core.ctx_id);

	r = dss_init(pdev);
	if (r) {
		DSSERR("Failed to initialize DSS\n");
		goto err_dss;
	}

	r = rfbi_init();
	if (r) {
		DSSERR("Failed to initialize rfbi\n");
		goto err_rfbi;
	}

	r = dpi_init(pdev);
	if (r) {
		DSSERR("Failed to initialize dpi\n");
		goto err_dpi;
	}

	r = dispc_init(pdev);
	if (r) {
		DSSERR("Failed to initialize dispc\n");
		goto err_dispc;
	}

	r = venc_init(pdev);
	if (r) {
		DSSERR("Failed to initialize venc\n");
		goto err_venc;
	}

	if (cpu_is_omap34xx()) {
		r = sdi_init(skip_init);
		if (r) {
			DSSERR("Failed to initialize SDI\n");
			goto err_sdi;
		}
	}

	if (!cpu_is_omap24xx()) {
		r = dsi_init(pdev);
		if (r) {
			DSSERR("Failed to initialize DSI\n");
			goto err_dsi1;
		}

		if (cpu_is_omap44xx()) {
			r = dsi2_init(pdev);
			if (r) {
				DSSERR("Failed to initialize DSI2\n");
				goto err_dsi2;
			}
		}
	}
#ifdef CONFIG_OMAP2_DSS_HDMI
	r = hdmi_init(pdev);
	if (r) {
		DSSERR("Failed to initialize hdmi\n");
		goto err_hdmi;
	}
#endif
#endif
	r = dss_initialize_debugfs();
	if (r)
		goto err_debugfs;

	for (i = 0; i < pdata->num_devices; ++i) {
		struct omap_dss_device *dssdev = pdata->devices[i];

		r = omap_dss_register_device(dssdev);
		if (r) {
			DSSERR("device %d %s register failed %d\n", i,
				dssdev->name ?: "unnamed", r);

			while (--i >= 0)
				omap_dss_unregister_device(pdata->devices[i]);

			goto err_register;
		}

		if (def_disp_name && strcmp(def_disp_name, dssdev->name) == 0)
			pdata->default_device = dssdev;
	}
#ifdef HWMOD
	dss_clk_disable_all();
#endif
	return 0;

err_register:
	dss_uninitialize_debugfs();
err_debugfs:
#ifdef HWMOD
#ifdef CONFIG_OMAP2_DSS_HDMI
	hdmi_exit();
err_hdmi:
#endif
	if (cpu_is_omap44xx())
		dsi2_exit();
err_dsi2:
	if (!cpu_is_omap24xx())
		dsi_exit();
err_dsi1:
	if (cpu_is_omap34xx())
		sdi_exit();
err_sdi:
	venc_exit();
err_venc:
	dispc_exit();
err_dispc:
	dpi_exit();
err_dpi:
	rfbi_exit();
err_rfbi:
	dss_exit();
err_dss:
	dss_clk_disable_all_no_ctx();
	dss_put_clocks();
err_clocks:
#endif
	return r;
}
コード例 #3
0
ファイル: core.c プロジェクト: MuMu360121/jordan-kernel
/* PLATFORM DEVICE */
static int omap_dss_probe(struct platform_device *pdev)
{
	struct omap_dss_board_info *pdata = pdev->dev.platform_data;
	int skip_init = 0;
	int r;
	int i;

	core.pdev = pdev;

	dss_init_overlay_managers(pdev);
	dss_init_overlays(pdev);

	r = dss_get_clocks();
	if (r)
		goto fail0;

	dss_clk_enable_all_no_ctx();

	core.ctx_id = dss_get_ctx_id();
	DSSDBG("initial ctx id %u\n", core.ctx_id);

#ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
	/* DISPC_CONTROL */
	skip_init = 1;
	if (pdata->default_device->phy.dsi.xfer_mode
		== OMAP_DSI_XFER_VIDEO_MODE)
		skip_init = 0;
#endif

	r = dss_init(skip_init);
	if (r) {
		DSSERR("Failed to initialize DSS\n");
		goto fail0;
	}

#ifdef CONFIG_OMAP2_DSS_RFBI
	r = rfbi_init();
	if (r) {
		DSSERR("Failed to initialize rfbi\n");
		goto fail0;
	}
#endif

	r = dpi_init();
	if (r) {
		DSSERR("Failed to initialize dpi\n");
		goto fail0;
	}

	r = dispc_init();
	if (r) {
		DSSERR("Failed to initialize dispc\n");
		goto fail0;
	}
#ifdef CONFIG_OMAP2_DSS_VENC
	r = venc_init(pdev);
	if (r) {
		DSSERR("Failed to initialize venc\n");
		goto fail0;
	}
#endif
	if (cpu_is_omap34xx()) {
#ifdef CONFIG_OMAP2_DSS_SDI
		r = sdi_init(skip_init);
		if (r) {
			DSSERR("Failed to initialize SDI\n");
			goto fail0;
		}
#endif
#ifdef CONFIG_OMAP2_DSS_DSI
		r = dsi_init(pdev);
		if (r) {
			DSSERR("Failed to initialize DSI\n");
			goto fail0;
		}
#endif
	}

#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT)
	r = dss_initialize_debugfs();
	if (r)
		goto fail0;
#endif

	for (i = 0; i < pdata->num_devices; ++i) {
		struct omap_dss_device *dssdev = pdata->devices[i];

		r = omap_dss_register_device(dssdev);
		if (r)
			DSSERR("device reg failed %d\n", i);

		if (def_disp_name && strcmp(def_disp_name, dssdev->name) == 0)
			pdata->default_device = dssdev;
	}

	dss_clk_disable_all();

	return 0;

	/* XXX fail correctly */
fail0:
	return r;
}
コード例 #4
0
ファイル: dss.c プロジェクト: embest-tech/rowboat-kernel
static int omap_dss_probe(struct platform_device *pdev)
{
	struct omap_dss_platform_data *pdata = pdev->dev.platform_data;

	int r;

	dss.pdev = pdev;

	r = get_dss_clocks();
	if (r)
		goto fail0;

	dss_clk_enable_all_no_ctx();

	dss.ctx_id = dss_get_ctx_id();
	DSSDBG("initial ctx id %u\n", dss.ctx_id);

	r = dss_init();
	if (r) {
		DSSERR("Failed to initialize DSS\n");
		goto fail0;
	}

#ifdef CONFIG_OMAP2_DSS_RFBI
	r = rfbi_init();
	if (r) {
		DSSERR("Failed to initialize rfbi\n");
		goto fail0;
	}
#endif

	r = dpi_init();
	if (r) {
		DSSERR("Failed to initialize dpi\n");
		goto fail0;
	}

	r = dispc_init();
	if (r) {
		DSSERR("Failed to initialize dispc\n");
		goto fail0;
	}
#ifdef CONFIG_OMAP2_DSS_VENC
	r = venc_init();
	if (r) {
		DSSERR("Failed to initialize venc\n");
		goto fail0;
	}
#endif
	if (cpu_is_omap34xx()) {
#ifdef CONFIG_OMAP2_DSS_SDI
		r = sdi_init();
		if (r) {
			DSSERR("Failed to initialize SDI\n");
			goto fail0;
		}
#endif
#ifdef CONFIG_OMAP2_DSS_DSI
		r = dsi_init();
		if (r) {
			DSSERR("Failed to initialize DSI\n");
			goto fail0;
		}
#endif
	}

	initialize_displays(pdata);

	r = initialize_sysfs(&pdev->dev);
	if (r)
		goto fail0;

	initialize_overlays(def_disp_name);

	dss_clk_disable_all();

	return 0;

	/* XXX fail correctly */
fail0:
	return r;
}
コード例 #5
0
/* PLATFORM DEVICE */
static int omap_dss_probe(struct platform_device *pdev)
{
	struct omap_dss_board_info *pdata = pdev->dev.platform_data;
	int r = 0;
	int i;

	core.pdev = pdev;
	core.pdata = pdev->dev.platform_data;

	dss_init_overlay_managers(pdev);
	dss_init_overlays(pdev);

	if (cpu_is_omap44xx())
		dss_init_writeback(pdev); /*Write back init*/
#ifdef HWMOD
	if (!cpu_is_omap44xx()) {
		r = dss_get_clocks();
		if (r)
			goto err_clocks;
	}

	core.ctx_id = dss_get_ctx_id();
	DSSDBG("initial ctx id %u\n", core.ctx_id);

	r = dss_init(pdev);
	if (r) {
		DSSERR("Failed to initialize DSS\n");
		goto err_dss;
	}

	r = rfbi_init();
	if (r) {
		DSSERR("Failed to initialize rfbi\n");
		goto err_rfbi;
	}

	r = dpi_init(pdev);
	if (r) {
		DSSERR("Failed to initialize dpi\n");
		goto err_dpi;
	}

	r = dispc_init(pdev);
	if (r) {
		DSSERR("Failed to initialize dispc\n");
		goto err_dispc;
	}

	r = venc_init(pdev);
	if (r) {
		DSSERR("Failed to initialize venc\n");
		goto err_venc;
	}

	if (cpu_is_omap34xx()) {
		r = sdi_init(skip_init);
		if (r) {
			DSSERR("Failed to initialize SDI\n");
			goto err_sdi;
		}
	}

	if (!cpu_is_omap24xx()) {
		r = dsi_init(pdev);
		if (r) {
			DSSERR("Failed to initialize DSI\n");
			goto err_dsi1;
		}

		if (cpu_is_omap44xx()) {
			r = dsi2_init(pdev);
			if (r) {
				DSSERR("Failed to initialize DSI2\n");
				goto err_dsi2;
			}
		}
	}
// == 2011.05.31 === [email protected] START	
#ifdef CONFIG_OMAP2_DSS_HDMI
// TEDCHO_HDMI
#if defined(CONFIG_PRODUCT_LGE_HUB) || defined(CONFIG_PRODUCT_LGE_JUSTIN)
#else
	r = hdmi_init(pdev, hdmi_code, hdmi_mode);
	if (r) {
		DSSERR("Failed to initialize hdmi\n");
		goto err_hdmi;
	}
#endif
#endif
#endif
// == 2011.05.31 === [email protected] END
	r = dss_initialize_debugfs();
	if (r)
		goto err_debugfs;

	for (i = 0; i < pdata->num_devices; ++i) {
		struct omap_dss_device *dssdev = pdata->devices[i];

		r = omap_dss_register_device(dssdev);
		if (r) {
			DSSERR("device %d %s register failed %d\n", i,
				dssdev->name ?: "unnamed", r);

			while (--i >= 0)
				omap_dss_unregister_device(pdata->devices[i]);

			goto err_register;
		}

		if (def_disp_name && strcmp(def_disp_name, dssdev->name) == 0)
			pdata->default_device = dssdev;
	}
#ifdef HWMOD
	dss_clk_disable_all();
#endif
	return 0;

err_register:
	dss_uninitialize_debugfs();
err_debugfs:
#ifdef HWMOD
#ifdef CONFIG_OMAP2_DSS_HDMI
	hdmi_exit();
err_hdmi:
#endif
	if (cpu_is_omap44xx())
		dsi2_exit();
err_dsi2:
	if (!cpu_is_omap24xx())
		dsi_exit();
err_dsi1:
	if (cpu_is_omap34xx())
		sdi_exit();
err_sdi:
	venc_exit();
err_venc:
	dispc_exit();
err_dispc:
	dpi_exit();
err_dpi:
	rfbi_exit();
err_rfbi:
	dss_exit();
err_dss:
	dss_clk_disable_all_no_ctx();
	dss_put_clocks();
err_clocks:
#endif
	return r;
}