Esempio n. 1
0
static int mdss_hdmi_enable_power(uint8_t enable, struct msm_panel_info *pinfo)
{
        int ret = NO_ERROR;

        ret = target_ldo_ctrl(enable, pinfo);
        if (ret) {
		dprintf(CRITICAL, "LDO control enable failed\n");
		goto bail_ldo_fail;
        }

        ret = target_hdmi_regulator_ctrl(enable);
        if (ret) {
		dprintf(CRITICAL, "hdmi regulator control enable failed\n");
		goto bail_regulator_fail;
        }

	ret = target_hdmi_gpio_ctrl(enable);
	if (ret) {
		dprintf(CRITICAL, "hdmi gpio control enable failed\n");
		goto bail_gpio_fail;
        }

	dprintf(SPEW, "HDMI Panel power %s done\n", enable ? "on" : "off");

	return ret;

bail_gpio_fail:
	target_hdmi_regulator_ctrl(0);

bail_regulator_fail:
	target_ldo_ctrl(0, pinfo);

bail_ldo_fail:
	return ret;
}
Esempio n. 2
0
static int mdss_dsi_panel_power(uint8_t enable)
{
	int ret = NO_ERROR;

	if (enable) {

		/* Enable backlight */
		ret = panel_backlight_ctrl(enable);
		if (ret) {
			dprintf(CRITICAL, "Backlight enable failed \n");
			return ret;
		}
		ret = target_ldo_ctrl(enable, ldo_entry_array,
						 TOTAL_LDO_DEFINED);
		if (ret) {
			dprintf(CRITICAL, "LDO control enable failed \n");
			return ret;
		}

		/* Panel Reset */
		ret = mdss_dsi_panel_reset(enable);
		if (ret) {
			dprintf(CRITICAL, "panel reset failed \n");
			return ret;
		}
		dprintf(SPEW, "Panel power on done\n");
	} else {
		/* Disable panel, backlight and ldo */
		ret = mdss_dsi_panel_reset(enable);
		if (ret) {
			dprintf(CRITICAL, "panel reset disable failed \n");
			return ret;
		}

		ret = panel_backlight_ctrl(enable);
		if (ret) {
			dprintf(CRITICAL, "Backlight disable failed \n");
			return ret;
		}

		ret = target_ldo_ctrl(enable, ldo_entry_array,
						TOTAL_LDO_DEFINED);
		if (ret) {
			dprintf(CRITICAL, "ldo control disable failed \n");
			return ret;
		}
		dprintf(SPEW, "Panel power off done\n");
	}

	return ret;
}
static int mdss_dsi_panel_power(uint8_t enable,
				struct msm_panel_info *pinfo)
{
	int ret = NO_ERROR;

	if (enable) {
		ret = target_ldo_ctrl(enable, pinfo);
		if (ret) {
			dprintf(CRITICAL, "LDO control enable failed\n");
			return ret;
		}

		/* Panel Reset */
		if (!panelstruct.paneldata->panel_lp11_init) {
			ret = mdss_dsi_panel_reset(enable);
			if (ret) {
				dprintf(CRITICAL, "panel reset failed\n");
				return ret;
			}
		}
		dprintf(SPEW, "Panel power on done\n");
	} else {
		/* Disable panel and ldo */
		ret = mdss_dsi_panel_reset(enable);
		if (ret) {
			dprintf(CRITICAL, "panel reset disable failed\n");
			return ret;
		}

		ret = target_ldo_ctrl(enable, pinfo);
		if (ret) {
			dprintf(CRITICAL, "ldo control disable failed\n");
			return ret;
		}
		dprintf(SPEW, "Panel power off done\n");
	}

	return ret;
}
static int mdss_edp_panel_power(uint8_t enable,
				struct msm_panel_info *pinfo)
{
	int ret = NO_ERROR;

	if (enable) {
		ret = target_ldo_ctrl(enable, pinfo);
		if (ret) {
			dprintf(CRITICAL, "LDO control enable failed\n");
			return ret;
		}

		ret = mdss_edp_panel_enable();
		if (ret) {
			dprintf(CRITICAL, "%s: panel enable failed\n", __func__);
			return ret;
		}
		dprintf(SPEW, "EDP Panel power on done\n");
	} else {
		/* Disable panel and ldo */
		ret = mdss_edp_panel_disable();
		if (ret) {
			dprintf(CRITICAL, "%s: panel disable failed\n", __func__);
			return ret;
		}

		ret = target_ldo_ctrl(enable, pinfo);
		if (ret) {
			dprintf(CRITICAL, "%s: ldo control disable failed\n", __func__);
			return ret;
		}
		dprintf(SPEW, "EDP Panel power off done\n");
	}

	return ret;
}