Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3829ba59 authored by Ingrid Gallardo's avatar Ingrid Gallardo
Browse files

msm: mdss: add sysfs node to disable panel



For power measurements, it is needed to disable
the panel in order to determine the delta
between the consumption with and without
the panel and it's dependencies.
This change adds a sysfs note to disable
the panel and dependencies without disturbing
any of the dsi/mdp configurations.

CRs-Fixed: 878591
Change-Id: I57c1f49aa57f645cb96714edd2f297fa06187c03
Signed-off-by: default avatarIngrid Gallardo <ingridg@codeaurora.org>
parent 9e2d528d
Loading
Loading
Loading
Loading
+21 −2
Original line number Diff line number Diff line
@@ -357,7 +357,7 @@ static int mdss_dsi_panel_power_lp(struct mdss_panel_data *pdata, int enable)
static int mdss_dsi_panel_power_ctrl(struct mdss_panel_data *pdata,
	int power_state)
{
	int ret;
	int ret = 0;
	struct mdss_panel_info *pinfo;

	if (pdata == NULL) {
@@ -383,6 +383,10 @@ static int mdss_dsi_panel_power_ctrl(struct mdss_panel_data *pdata,

	switch (power_state) {
	case MDSS_PANEL_POWER_OFF:
	case MDSS_PANEL_POWER_LCD_DISABLED:
		/* if LCD has not been disabled, then disable it now */
		if ((pinfo->panel_power_state != MDSS_PANEL_POWER_LCD_DISABLED)
		     && (pinfo->panel_power_state != MDSS_PANEL_POWER_OFF))
			ret = mdss_dsi_panel_power_off(pdata);
		break;
	case MDSS_PANEL_POWER_ON:
@@ -2469,6 +2473,7 @@ static int mdss_dsi_event_handler(struct mdss_panel_data *pdata,
	int power_state;
	u32 mode;
	struct mdss_panel_info *pinfo;
	int ret;

	if (pdata == NULL) {
		pr_err("%s: Invalid input data\n", __func__);
@@ -2529,6 +2534,20 @@ static int mdss_dsi_event_handler(struct mdss_panel_data *pdata,
			rc = mdss_dsi_blank(pdata, power_state);
		rc = mdss_dsi_off(pdata, power_state);
		break;
	case MDSS_EVENT_DISABLE_PANEL:
		/* disable esd thread */
		disable_esd_thread();

		/* disable backlight */
		ctrl_pdata->panel_data.set_backlight(pdata, 0);

		/* send the off commands */
		ctrl_pdata->off(pdata);

		/* disable panel power */
		ret = mdss_dsi_panel_power_ctrl(pdata,
			MDSS_PANEL_POWER_LCD_DISABLED);
		break;
	case MDSS_EVENT_CONT_SPLASH_FINISH:
		if (ctrl_pdata->off_cmds.link_state == DSI_LP_MODE)
			rc = mdss_dsi_blank(pdata, MDSS_PANEL_POWER_OFF);
+1 −0
Original line number Diff line number Diff line
@@ -614,6 +614,7 @@ int mdss_dsi_wait_for_lane_idle(struct mdss_dsi_ctrl_pdata *ctrl);

irqreturn_t mdss_dsi_isr(int irq, void *ptr);
irqreturn_t hw_vsync_handler(int irq, void *data);
void disable_esd_thread(void);
void mdss_dsi_irq_handler_config(struct mdss_dsi_ctrl_pdata *ctrl_pdata);

void mdss_dsi_set_tx_power_mode(int mode, struct mdss_panel_data *pdata);
+5 −0
Original line number Diff line number Diff line
@@ -667,6 +667,11 @@ static void mdss_dsi_panel_bl_ctrl(struct mdss_panel_data *pdata,
	 * for the backlight brightness. If the brightness is less
	 * than it, the controller can malfunction.
	 */
	pr_debug("%s: bl_level:%d\n", __func__, bl_level);

	/* do not allow backlight to change when panel in disable mode */
	if (pdata->panel_disable_mode && (bl_level != 0))
		return;

	if ((bl_level < pdata->panel_info.bl_min) && (bl_level != 0))
		bl_level = pdata->panel_info.bl_min;
+10 −0
Original line number Diff line number Diff line
@@ -100,6 +100,16 @@ irqreturn_t hw_vsync_handler(int irq, void *data)
	return IRQ_HANDLED;
}

/*
 * disable_esd_thread() - Cancels work item for the esd check.
 */
void disable_esd_thread(void)
{
	if (pstatus_data &&
	    cancel_delayed_work(&pstatus_data->check_status))
		pr_debug("esd thread killed\n");
}

/*
 * fb_event_callback() - Call back function for the fb_register_client()
 *			 notifying events
+3 −0
Original line number Diff line number Diff line
@@ -1950,6 +1950,9 @@ static int mdss_fb_blank(int blank_mode, struct fb_info *info)
		pdata->panel_info.is_lpm_mode = false;
	}

	if (pdata->panel_disable_mode)
		mdss_mdp_enable_panel_disable_mode(mfd, false);

	return mdss_fb_blank_sub(blank_mode, info, mfd->op_enable);
}

Loading