示例#1
0
文件: edp.c 项目: jbott/lk_gee
int edp_on(void)
{
	mdss_edp_pll_configure();
	mdss_edp_phy_pll_ready();
	edp_phy_misc_cfg();
	edp_config_sync();
	edp_config_sw_div();
	edp_config_static_mdiv();
	edp_config_timing(edp_pinfo);
	edp_config_tu();

	edp_config_clk();
	mdss_edp_lane_power_ctrl(1);

	edp_enable_mainlink(1);

	mdss_edp_link_train();

	edp_enable(1);

	mdss_edp_wait_for_video_ready();

	mdss_edp_irq_disable();
        dprintf(INFO, "%s:\n", __func__);

	return 0;
}
示例#2
0
static void mdss_edp_do_link_train(struct mdss_edp_drv_pdata *ep)
{
	if (ep->cont_splash)
		return;

	mdss_edp_link_train(ep);
}
示例#3
0
static void mdss_edp_do_link_train(struct mdss_edp_drv_pdata *ep)
{
	if (ep->cont_splash)
		return;

	if (!ep->inited) {
		ep->delay_link_train++;
		return;
	}

	mdss_edp_link_train(ep);
}
示例#4
0
static int edp_event_thread(void *data)
{
	struct mdss_edp_drv_pdata *ep;
	unsigned long flag;
	u32 todo = 0;

	ep = (struct mdss_edp_drv_pdata *)data;

	while (1) {
		wait_event(ep->event_q, (ep->event_pndx != ep->event_gndx));
		spin_lock_irqsave(&ep->event_lock, flag);
		if (ep->event_pndx == ep->event_gndx) {
			spin_unlock_irqrestore(&ep->event_lock, flag);
			break;
		}
		todo = ep->event_todo_list[ep->event_gndx];
		ep->event_todo_list[ep->event_gndx++] = 0;
		ep->event_gndx %= HPD_EVENT_MAX;
		spin_unlock_irqrestore(&ep->event_lock, flag);

		pr_debug("%s: todo=%x\n", __func__, todo);

		if (todo == 0)
			continue;

		if (todo & EV_EDID_READ)
			mdss_edp_edid_read(ep, 0);

		if (todo & EV_DPCD_CAP_READ)
			mdss_edp_dpcd_cap_read(ep);

		if (todo & EV_DPCD_STATUS_READ)
			mdss_edp_dpcd_status_read(ep);

		if (todo & EV_LINK_TRAIN) {
			INIT_COMPLETION(ep->train_comp);
			mdss_edp_link_train(ep);
		}

		if (todo & EV_VIDEO_READY)
			mdss_edp_video_ready(ep);
	}

	return 0;
}
示例#5
0
int mdss_edp_on(struct mdss_panel_data *pdata)
{
	struct mdss_edp_drv_pdata *edp_drv = NULL;
	int ret = 0;

	if (!pdata) {
		pr_err("%s: Invalid input data\n", __func__);
		return -EINVAL;
	}

	edp_drv = container_of(pdata, struct mdss_edp_drv_pdata,
			panel_data);

	pr_debug("%s:+, cont_splash=%d\n", __func__, edp_drv->cont_splash);

	if (!edp_drv->cont_splash) { /* vote for clocks */
		mdss_edp_phy_pll_reset(edp_drv);
		mdss_edp_aux_reset(edp_drv);
		mdss_edp_mainlink_reset(edp_drv);
		mdss_edp_aux_ctrl(edp_drv, 1);

		ret = mdss_edp_prepare_clocks(edp_drv);
		if (ret)
			return ret;

		mdss_edp_phy_power_ctrl(edp_drv, 1);

		ret = mdss_edp_clk_enable(edp_drv);
		if (ret) {
			mdss_edp_unprepare_clocks(edp_drv);
			return ret;
		}

		mdss_edp_phy_pll_ready(edp_drv);

		mdss_edp_lane_power_ctrl(edp_drv, 1);

		mdss_edp_clock_synchrous(edp_drv, 1);
		mdss_edp_phy_vm_pe_init(edp_drv);
		mdss_edp_config_ctrl(edp_drv);
		mdss_edp_sw_mvid_nvid(edp_drv);
		mdss_edp_timing_cfg(edp_drv);

		gpio_set_value(edp_drv->gpio_panel_en, 1);
		if (gpio_is_valid(edp_drv->gpio_lvl_en))
			gpio_set_value(edp_drv->gpio_lvl_en, 1);

		INIT_COMPLETION(edp_drv->idle_comp);
		mdss_edp_mainlink_ctrl(edp_drv, 1);
	} else {
		mdss_edp_aux_ctrl(edp_drv, 1);
	}

	mdss_edp_irq_enable(edp_drv);

	if (edp_drv->delay_link_train) {
		mdss_edp_link_train(edp_drv);
		edp_drv->delay_link_train = 0;
	}

	mdss_edp_wait4train(edp_drv);

	edp_drv->cont_splash = 0;

	pr_debug("%s:-\n", __func__);
	return ret;
}