static void on_isr_issue_go(void *data)
{
	struct omap_dss_device *dssdev = (struct omap_dss_device *) data;

	while (dispc_go_busy(dssdev->channel));
	dispc_go(dssdev->channel);
}
示例#2
0
static void dpi_set_timings(struct omap_dss_device *dssdev,
			struct omap_video_timings *timings)
{
	DSSDBG("dpi_set_timings\n");
	dssdev->panel.timings = *timings;
	if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) {
		dpi_set_mode(dssdev);
		if (dssdev->channel == OMAP_DSS_CHANNEL_LCD2)
			dispc_go(OMAP_DSS_CHANNEL_LCD2);
		else {
			dispc_go(OMAP_DSS_CHANNEL_LCD);
			while (dispc_go_busy(OMAP_DSS_CHANNEL_LCD))
				;
		}

	}
}
示例#3
0
static void dpi_display_disable(struct omap_dss_device *dssdev)
{
	int lcd_channel_ix = 0;
	int use_dsi_for_hdmi = 0;

	if (strncmp("hdmi", dssdev->name, 4) == 0)
		use_dsi_for_hdmi = 1;

	if (dssdev->channel == OMAP_DSS_CHANNEL_LCD2)
		lcd_channel_ix = 1;

	if (dssdev->state == OMAP_DSS_DISPLAY_DISABLED)
		return;

	if (dssdev->state == OMAP_DSS_DISPLAY_SUSPENDED)
		dpi_display_resume(dssdev);

	dssdev->driver->disable(dssdev);

	if (use_dsi_for_hdmi) {
		dss_select_clk_source(0, 0);

		dispc_go(OMAP_DSS_CHANNEL_LCD);
		while (dispc_go_busy(OMAP_DSS_CHANNEL_LCD))
			;
		dsi_pll_uninit(lcd_channel_ix);
		enable_vpll2_power(0);
		dss_clk_disable(DSS_CLK_FCK2);
	}

	if (dssdev->channel == OMAP_DSS_CHANNEL_LCD2)
		dispc_enable_lcd_out(OMAP_DSS_CHANNEL_LCD2, 0);
	else
		dispc_enable_lcd_out(OMAP_DSS_CHANNEL_LCD, 0);

	dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);

	dssdev->state = OMAP_DSS_DISPLAY_DISABLED;

	omap_dss_stop_device(dssdev);
}
示例#4
0
static int dpi_display_suspend(struct omap_dss_device *dssdev)
{
	int use_dsi_for_hdmi = 0;

	if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
		return -EINVAL;

	DSSDBG("dpi_display_suspend\n");

	if (strncmp("hdmi", dssdev->name, 4) == 0)
		use_dsi_for_hdmi = 1;

	if (dssdev->driver->suspend)
		dssdev->driver->suspend(dssdev);

	if (use_dsi_for_hdmi) {
		dss_select_clk_source(0, 0);

		dispc_go(OMAP_DSS_CHANNEL_LCD);
		while (dispc_go_busy(OMAP_DSS_CHANNEL_LCD))
			;

		dsi_pll_uninit(dsi1);
		enable_vpll2_power(0);
		dss_clk_disable(DSS_CLK_FCK2);
	}

	if (dssdev->channel == OMAP_DSS_CHANNEL_LCD2)
		dispc_enable_lcd_out(OMAP_DSS_CHANNEL_LCD2, 0);
	else
		dispc_enable_lcd_out(OMAP_DSS_CHANNEL_LCD, 0);

	dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);

	dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;

	return 0;
}
示例#5
0
static int dpi_display_resume(struct omap_dss_device *dssdev)
{
	int r = 0;
	int lcd_channel_ix = 1;
	int use_dsi_for_hdmi = 0;

	if (strncmp("hdmi", dssdev->name, 4) == 0)
		use_dsi_for_hdmi = 1;

	if (dssdev->channel == OMAP_DSS_CHANNEL_LCD2) {
		DSSINFO("Lcd channel index 1");
		dpi2_base = ioremap(DPI2_BASE, 2000);
		lcd_channel_ix = 1;
	} else
		lcd_channel_ix = 0;

	if (dssdev->state != OMAP_DSS_DISPLAY_SUSPENDED)
		return -EINVAL;

	DSSDBG("dpi_display_resume\n");

	dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);

	if (use_dsi_for_hdmi) {
		dss_clk_enable(DSS_CLK_FCK2);
		enable_vpll2_power(1);

		if (cpu_is_omap3630())
			r = dsi_pll_init(lcd_channel_ix, dssdev, 1, 1);
		else
			r = dsi_pll_init(lcd_channel_ix, dssdev, 0, 1);
		if (r)
			goto err0;

		r = dpi_set_mode(dssdev);
		if (r)
			goto err1;
	}

	if (dssdev->channel == OMAP_DSS_CHANNEL_LCD2)
		dispc_enable_lcd_out(OMAP_DSS_CHANNEL_LCD2, 1);
	else
		dispc_enable_lcd_out(OMAP_DSS_CHANNEL_LCD, 1);

	if (dssdev->driver->resume) {
		r = dssdev->driver->resume(dssdev);
		if (r)
			goto err2;
	}

	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;

	/* This is done specifically for HDMI panel
	 * Default HDMI panel timings may not work for all monitors
	 * Reset HDMI panel timings after enabling HDMI.
	 */
	if (use_dsi_for_hdmi)
		dpi_set_timings(dssdev, &dssdev->panel.timings);

	return 0;
err2:
	if (dssdev->channel == OMAP_DSS_CHANNEL_LCD2)
		dispc_enable_lcd_out(OMAP_DSS_CHANNEL_LCD2, 0);
	else
		dispc_enable_lcd_out(OMAP_DSS_CHANNEL_LCD, 0);

	if (use_dsi_for_hdmi) {
err1:
		DSSERR("<%s!!> err0: failed to init DSI_PLL = %d\n",
		       __func__, r);
		dss_select_clk_source(0, 0);

		dispc_go(OMAP_DSS_CHANNEL_LCD);
		while (dispc_go_busy(OMAP_DSS_CHANNEL_LCD))
			;

		dsi_pll_uninit(dsi1);
		enable_vpll2_power(0);
err0:
		dss_clk_disable(DSS_CLK_FCK2);
	}

	dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
	return r;
}