static int mdss_panel_on_post(struct mdss_dsi_ctrl_pdata *ctrl)
{
	struct samsung_display_driver_data *vdd = check_valid_ctrl(ctrl);

	if (IS_ERR_OR_NULL(vdd)) {
		pr_err("%s: Invalid data ctrl : 0x%zx vdd : 0x%zx", __func__, (size_t)ctrl, (size_t)vdd);
		return false;
	}

	pr_info("%s+: ndx=%d %d %d \n", __func__, ctrl->ndx,alpm_status_func(CHECK_PREVIOUS_STATUS),alpm_status_func(CHECK_CURRENT_STATUS));

	/* ALPM Mode Change */
	if (!alpm_status_func(CHECK_PREVIOUS_STATUS)\
		&& alpm_status_func(CHECK_CURRENT_STATUS)) {
			/* Turn On ALPM Mode */
			mdss_samsung_send_cmd(ctrl, PANEL_ALPM_ON);
			alpm_status_func(STORE_CURRENT_STATUS);
			pr_info("[ALPM_DEBUG] %s: Send ALPM mode on cmds\n", __func__);
	} else if (!alpm_status_func(CHECK_CURRENT_STATUS)\
		&& alpm_status_func(CHECK_PREVIOUS_STATUS)) {
			/* Turn Off ALPM Mode */
			mdss_samsung_send_cmd(ctrl, PANEL_ALPM_OFF);
			alpm_status_func(CLEAR_MODE_STATUS);
			pr_info("[ALPM_DEBUG] %s: Send ALPM off cmds\n", __func__);
	}

	pr_info("%s-: ndx=%d \n", __func__, ctrl->ndx);

	return true;
}
示例#2
0
static int mdss_dsi_panel_power_off(struct mdss_panel_data *pdata)
{
	int ret = 0;
	struct mdss_dsi_ctrl_pdata *ctrl_pdata = NULL;
	int i = 0;
#if defined(CONFIG_FB_MSM_MDSS_SAMSUNG)
	bool dsi_panel_pm_ctrl = true;

	if (alpm_status_func(CHECK_CURRENT_STATUS)) {
			dsi_panel_pm_ctrl = false;
			pr_info("[ALPM_DEBUG] dsi_panel_pm_ctrl : %d\n", dsi_panel_pm_ctrl);
	}
#endif

	if (pdata == NULL) {
		pr_err("%s: Invalid input data\n", __func__);
		ret = -EINVAL;
		goto end;
	}

	ctrl_pdata = container_of(pdata, struct mdss_dsi_ctrl_pdata,
				panel_data);
#if !defined(CONFIG_SEC_KCCAT6_PROJECT)

#if defined(CONFIG_FB_MSM_MDSS_SAMSUNG)
	if(dsi_panel_pm_ctrl)
#endif
	{
		ret = regulator_disable(
			(ctrl_pdata->shared_pdata).vdd_vreg);
		if (ret) {
			pr_err("%s: Failed to disable regulator.\n",
				__func__);
		}
	}
#endif

#if defined(CONFIG_FB_MSM_MDSS_SAMSUNG)
	if (dsi_panel_pm_ctrl && gpio_is_valid(ctrl_pdata->disp_en_gpio)){
		gpio_set_value((ctrl_pdata->disp_en_gpio), 0);/* VDDR :1.5*/
		pr_info("%s: disp_en_gpio set low	\n", __func__);
	}
#else
	if (gpio_is_valid(ctrl_pdata->disp_en_gpio)){
			gpio_set_value((ctrl_pdata->disp_en_gpio), 0);/* VDDR :1.5*/
			pr_info("%s: disp_en_gpio set low	\n", __func__);
	}
#endif
#if defined(CONFIG_SEC_KCCAT6_PROJECT)

	usleep_range(1000,1000);
	
#if defined(CONFIG_FB_MSM_MDSS_SAMSUNG)
	if(dsi_panel_pm_ctrl)
#endif
	{
		ret = regulator_disable(
			(ctrl_pdata->shared_pdata).vdd_vreg);
		if (ret) {
			pr_err("%s: Failed to disable regulator.\n",
				__func__);
		}
	}

#endif
	usleep_range(4000, 4000);

/*
#if defined(CONFIG_FB_MSM_MIPI_SAMSUNG_OCTA_S6E3HA2_CMD_WQHD_PT_PANEL) || defined(CONFIG_FB_MSM_MIPI_SAMSUNG_OCTA_S6E3HA2_CMD_WQXGA_PT_PANEL)
	ctrl_pdata->panel_reset(pdata, 0);
#endif
*/
	ret = mdss_dsi_panel_reset(pdata, 0);
	if (ret) {
		pr_warn("%s: Panel reset failed. rc=%d\n", __func__, ret);
		ret = 0;
	}

	for (i = DSI_MAX_PM - 1; i >= 0; i--) {
		/*
		 * Core power module will be disabled when the
		 * clocks are disabled
		 */
		if (DSI_CORE_PM == i)
			continue;
#if defined(CONFIG_FB_MSM_MDSS_SAMSUNG)
		if ((DSI_PANEL_PM == i) && !dsi_panel_pm_ctrl)
			continue;
#endif
		ret = msm_dss_enable_vreg(
			ctrl_pdata->power_data[i].vreg_config,
			ctrl_pdata->power_data[i].num_vreg, 0);
		if (ret)
			pr_err("%s: failed to disable vregs for %s\n",
				__func__, __mdss_dsi_pm_name(i));
	}

	usleep_range(4000, 4000);

end:
	return ret;
}
示例#3
0
static int mdss_dsi_panel_power_on(struct mdss_panel_data *pdata)
{
	int ret = 0;
	struct mdss_dsi_ctrl_pdata *ctrl_pdata = NULL;
	int i = 0;
#if defined(CONFIG_FB_MSM_MDSS_SAMSUNG)
	bool dsi_panel_pm_ctrl = true;

	if (alpm_status_func(CHECK_PREVIOUS_STATUS)){
			dsi_panel_pm_ctrl = false;
			pr_info("[ALPM_DEBUG] dsi_panel_pm_ctrl : %d\n", dsi_panel_pm_ctrl);
	}
#endif

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

	ctrl_pdata = container_of(pdata, struct mdss_dsi_ctrl_pdata,
				panel_data);

	for (i = 0; i < DSI_MAX_PM; i++) {
		/*
		 * Core power module will be enabled when the
		 * clocks are enabled
		 */
		if (DSI_CORE_PM == i)
			continue;
#if defined(CONFIG_FB_MSM_MDSS_SAMSUNG)
		if ((DSI_PANEL_PM == i) && !dsi_panel_pm_ctrl)
			continue;
#endif
		ret = msm_dss_enable_vreg(
			ctrl_pdata->power_data[i].vreg_config,
			ctrl_pdata->power_data[i].num_vreg, 1);
 		if (ret) {
			pr_err("%s: failed to enable vregs for %s\n",
				__func__, __mdss_dsi_pm_name(i));
 			goto error;
 		}
	}
	i--;
	usleep_range(4000, 4000);
#if defined(CONFIG_SEC_KCCAT6_PROJECT)

#if defined(CONFIG_FB_MSM_MDSS_SAMSUNG)
	if(dsi_panel_pm_ctrl)
#endif
	{
		ret = regulator_enable( /*VDD */
			(ctrl_pdata->shared_pdata).vdd_vreg);
		if (ret) {
			pr_err("%s: Failed to enable vdd regulator.\n",
				__func__);
			return ret;
		}
	}
	
	usleep_range(1000,1000);
#endif

#if defined(CONFIG_FB_MSM_MDSS_SAMSUNG)
	if (dsi_panel_pm_ctrl && gpio_is_valid(ctrl_pdata->disp_en_gpio)) {
		pr_info("%s : Set High LCD Enable disp_en GPIO \n", __func__);
		gpio_set_value((ctrl_pdata->disp_en_gpio), 1);
	}
#else
	if (gpio_is_valid(ctrl_pdata->disp_en_gpio)) {
		pr_info("%s : Set High LCD Enable disp_en GPIO \n", __func__);
		gpio_set_value((ctrl_pdata->disp_en_gpio), 1);
	}
#endif

#if !defined(CONFIG_SEC_KCCAT6_PROJECT)
#if defined(CONFIG_FB_MSM_MDSS_SAMSUNG)
	if(dsi_panel_pm_ctrl)
#endif
	{
		ret = regulator_enable( /*VDD */
			(ctrl_pdata->shared_pdata).vdd_vreg);
		if (ret) {
			pr_err("%s: Failed to enable vdd regulator.\n",
				__func__);
			return ret;
		}
	}
#endif
	usleep_range(4000, 4000);
#if 0
	/*
	 * If continuous splash screen feature is enabled, then we need to
	 * request all the GPIOs that have already been configured in the
	 * bootloader. This needs to be done irresepective of whether
	 * the lp11_init flag is set or not.
	 */
	if (pdata->panel_info.cont_splash_enabled ||
		!pdata->panel_info.mipi.lp11_init) {
		ctrl_pdata->panel_reset(pdata, 1);
 	}
#endif

error:
	if (ret) {
		for (; i >= 0; i--)
			msm_dss_enable_vreg(
				ctrl_pdata->power_data[i].vreg_config,
				ctrl_pdata->power_data[i].num_vreg, 0);
	}
	return ret;
}