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

Commit 5dd78794 authored by franciscofranco's avatar franciscofranco Committed by Vincent Zvikaramba
Browse files

display: add a simple api to query the display state (on/off) at any point in time



Change-Id: Ib299f00860416afca598d366a45257c5f4f14569
Signed-off-by: default avatarfranciscofranco <franciscofranco.1990@gmail.com>
parent cb41b023
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
#include <linux/leds.h>
#include <linux/qpnp/pwm.h>
#include <linux/err.h>

#include <linux/display_state.h>
#include "mdss_dsi.h"
#include "mdss_livedisplay.h"

@@ -48,6 +48,13 @@

DEFINE_LED_TRIGGER(bl_led_trigger);

bool display_on = true;

bool is_display_on()
{
	return display_on;
}

void mdss_dsi_panel_pwm_cfg(struct mdss_dsi_ctrl_pdata *ctrl)
{
	if (ctrl->pwm_pmi)
@@ -733,6 +740,9 @@ static int mdss_dsi_panel_on(struct mdss_panel_data *pdata)
		return -EINVAL;
	}


	display_on = true;

	pinfo = &pdata->panel_info;
	ctrl = container_of(pdata, struct mdss_dsi_ctrl_pdata,
				panel_data);
@@ -857,6 +867,8 @@ static int mdss_dsi_panel_off(struct mdss_panel_data *pdata)
	mdss_samsung_panel_off_post(pdata);
#endif

	display_on = false;

end:
	pinfo->blank_state = MDSS_PANEL_BLANK_BLANK;
	pr_debug("%s:-\n", __func__);
+17 −0
Original line number Diff line number Diff line
/*
 * include/linux/display_state.h
 *
 * Copyright (c) 2016 Francisco Franco
 * franciscofranco.1990@gmail.com
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

#ifndef _LINUX_DISPLAY_STATE_H
#define _LINUX_DISPLAY_STATE_H

bool is_display_on(void);

#endif