diff options
| author | Chandan Uddaraju <chandanu@codeaurora.org> | 2016-08-31 10:22:03 -0700 |
|---|---|---|
| committer | Chandan Uddaraju <chandanu@codeaurora.org> | 2016-08-31 10:22:03 -0700 |
| commit | 70fb619af46b08bef4d1045ea76510e2373a98f8 (patch) | |
| tree | 15f4250a3673ed4f9160d08ae0907356a8318b33 | |
| parent | ab26d098793adbf90b77d414663e34ac0c7315f6 (diff) | |
mdss: display-port: add new sysfs node for 3D mode
Add sysfs node to provide the status of display-port's 3D
mode support. Framework will query about the interface for
3D mode status before enabling the corresponding
FrameBuffer.
Change-Id: If53a034c3c5ee39a95b2501ee495e572f60d6b56
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_dp.c | 44 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_dp.h | 1 |
2 files changed, 45 insertions, 0 deletions
diff --git a/drivers/video/fbdev/msm/mdss_dp.c b/drivers/video/fbdev/msm/mdss_dp.c index c8b415df4bce..f25a6e185051 100644 --- a/drivers/video/fbdev/msm/mdss_dp.c +++ b/drivers/video/fbdev/msm/mdss_dp.c @@ -1434,10 +1434,54 @@ static ssize_t mdss_dp_rda_connected(struct device *dev, return ret; } + +static ssize_t mdss_dp_sysfs_wta_s3d_mode(struct device *dev, + struct device_attribute *attr, const char *buf, size_t count) +{ + int ret, s3d_mode; + struct mdss_dp_drv_pdata *dp = mdss_dp_get_drvdata(dev); + + if (!dp) { + DEV_ERR("%s: invalid input\n", __func__); + return -EINVAL; + } + ret = kstrtoint(buf, 10, &s3d_mode); + if (ret) { + DEV_ERR("%s: kstrtoint failed. rc=%d\n", __func__, ret); + goto end; + } + + dp->s3d_mode = s3d_mode; + ret = strnlen(buf, PAGE_SIZE); + DEV_DBG("%s: %d\n", __func__, dp->s3d_mode); +end: + return ret; +} + +static ssize_t mdss_dp_sysfs_rda_s3d_mode(struct device *dev, + struct device_attribute *attr, char *buf) +{ + ssize_t ret; + struct mdss_dp_drv_pdata *dp = mdss_dp_get_drvdata(dev); + + if (!dp) { + DEV_ERR("%s: invalid input\n", __func__); + return -EINVAL; + } + + ret = snprintf(buf, PAGE_SIZE, "%d\n", dp->s3d_mode); + DEV_DBG("%s: '%d'\n", __func__, dp->s3d_mode); + + return ret; +} + static DEVICE_ATTR(connected, S_IRUGO, mdss_dp_rda_connected, NULL); +static DEVICE_ATTR(s3d_mode, S_IRUGO | S_IWUSR, mdss_dp_sysfs_rda_s3d_mode, + mdss_dp_sysfs_wta_s3d_mode); static struct attribute *mdss_dp_fs_attrs[] = { &dev_attr_connected.attr, + &dev_attr_s3d_mode.attr, NULL, }; diff --git a/drivers/video/fbdev/msm/mdss_dp.h b/drivers/video/fbdev/msm/mdss_dp.h index b724aa655424..9a8534677c5e 100644 --- a/drivers/video/fbdev/msm/mdss_dp.h +++ b/drivers/video/fbdev/msm/mdss_dp.h @@ -404,6 +404,7 @@ struct mdss_dp_drv_pdata { struct mutex pd_msg_mutex; struct mutex hdcp_mutex; bool cable_connected; + u32 s3d_mode; u32 aux_cmd_busy; u32 aux_cmd_i2c; int aux_trans_num; |
