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

Commit 484150ae authored by Sandeep Panda's avatar Sandeep Panda
Browse files

msm: mdss: add support to read hpd state from sysfs node



This change adds support to read HPD state from sysfs node,
which will be helpful in automated test cases where multiple
HPD operations are performed on HDMI TV.

Change-Id: I39d19447c01d11a54a8e54c661b2dd177310c205
Signed-off-by: default avatarSandeep Panda <spanda@codeaurora.org>
parent 2642c0ad
Loading
Loading
Loading
Loading
+25 −1
Original line number Diff line number Diff line
@@ -219,13 +219,37 @@ static ssize_t mdss_dba_utils_sysfs_wta_hpd(struct device *dev,
	return count;
}

static ssize_t mdss_dba_utils_sysfs_rda_hpd(struct device *dev,
	struct device_attribute *attr, char *buf)
{
	ssize_t ret;
	struct mdss_dba_utils_data *udata = NULL;

	if (!dev) {
		pr_debug("invalid device\n");
		return -EINVAL;
	}

	udata = mdss_dba_utils_get_data(dev);

	if (!udata) {
		pr_debug("invalid input\n");
		return -EINVAL;
	}

	ret = snprintf(buf, PAGE_SIZE, "%d\n", udata->hpd_state);
	pr_debug("'%d'\n", udata->hpd_state);

	return ret;
}

static DEVICE_ATTR(connected, S_IRUGO,
		mdss_dba_utils_sysfs_rda_connected, NULL);

static DEVICE_ATTR(video_mode, S_IRUGO,
		mdss_dba_utils_sysfs_rda_video_mode, NULL);

static DEVICE_ATTR(hpd, S_IRUGO | S_IWUSR, NULL,
static DEVICE_ATTR(hpd, S_IRUGO | S_IWUSR, mdss_dba_utils_sysfs_rda_hpd,
		mdss_dba_utils_sysfs_wta_hpd);

static struct attribute *mdss_dba_utils_fs_attrs[] = {