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: Sandeep Panda <spanda@codeaurora.org>
This commit is contained in:
Sandeep Panda 2016-02-25 14:45:20 +05:30 committed by David Keitel
parent 94c6261fe7
commit 8e955dcd62

View file

@ -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[] = {