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

Commit 5e9a982b authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: mdss: add sysfs node for panel status"

parents 82557d8d c762b3db
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1385,6 +1385,10 @@ static int mdss_dsi_event_handler(struct mdss_panel_data *pdata,
		rc = mdss_dsi_register_recovery_handler(ctrl_pdata,
			(struct mdss_intf_recovery *)arg);
		break;
	case MDSS_EVENT_DSI_PANEL_STATUS:
		if (ctrl_pdata->check_status)
			rc = ctrl_pdata->check_status(ctrl_pdata);
		break;
	default:
		pr_debug("%s: unhandled event=%d\n", __func__, event);
		break;
+20 −2
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
 * Core MDSS framebuffer driver.
 *
 * Copyright (C) 2007 Google Incorporated
 * Copyright (c) 2008-2014, The Linux Foundation. All rights reserved.
 * Copyright (c) 2008-2015, The Linux Foundation. All rights reserved.
 *
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
@@ -528,6 +528,22 @@ static ssize_t mdss_fb_get_panel_info(struct device *dev,
	return ret;
}

static ssize_t mdss_fb_get_panel_status(struct device *dev,
		struct device_attribute *attr, char *buf)
{
	struct fb_info *fbi = dev_get_drvdata(dev);
	struct msm_fb_data_type *mfd = fbi->par;
	int ret;
	int panel_status;

	panel_status = mdss_fb_send_panel_event(mfd,
			MDSS_EVENT_DSI_PANEL_STATUS, NULL);
	ret = scnprintf(buf, PAGE_SIZE, "panel_status=%s\n",
		panel_status > 0 ? "alive" : "dead");

	return ret;
}

/*
 * mdss_fb_lpm_enable() - Function to Control LowPowerMode
 * @mfd:	Framebuffer data structure for display
@@ -626,7 +642,8 @@ static DEVICE_ATTR(msm_fb_src_split_info, S_IRUGO, mdss_fb_get_src_split_info,
	NULL);
static DEVICE_ATTR(msm_fb_thermal_level, S_IRUGO | S_IWUSR,
	mdss_fb_get_thermal_level, mdss_fb_set_thermal_level);

static DEVICE_ATTR(msm_fb_panel_status, S_IRUGO,
	mdss_fb_get_panel_status, NULL);
static struct attribute *mdss_fb_attrs[] = {
	&dev_attr_msm_fb_type.attr,
	&dev_attr_msm_fb_split.attr,
@@ -636,6 +653,7 @@ static struct attribute *mdss_fb_attrs[] = {
	&dev_attr_msm_fb_panel_info.attr,
	&dev_attr_msm_fb_src_split_info.attr,
	&dev_attr_msm_fb_thermal_level.attr,
	&dev_attr_msm_fb_panel_status.attr,
	NULL,
};

+5 −1
Original line number Diff line number Diff line
/* Copyright (c) 2008-2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2008-2015, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -181,6 +181,9 @@ struct mdss_intf_recovery {
 *				- 1: update to command mode
 * @MDSS_EVENT_REGISTER_RECOVERY_HANDLER: Event to recover the interface in
 *					case there was any errors detected.
 * @ MDSS_EVENT_DSI_PANEL_STATUS:Event to check the panel status
 *				<= 0: panel check fail
 *				>  0: panel check success
 */
enum mdss_intf_events {
	MDSS_EVENT_RESET = 1,
@@ -203,6 +206,7 @@ enum mdss_intf_events {
	MDSS_EVENT_DSI_STREAM_SIZE,
	MDSS_EVENT_DSI_DYNAMIC_SWITCH,
	MDSS_EVENT_REGISTER_RECOVERY_HANDLER,
	MDSS_EVENT_DSI_PANEL_STATUS,
};

struct lcd_panel_info {