summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/dc/hdmi.c
diff options
context:
space:
mode:
authorVictor Ryabukhin <vryabukhin@nvidia.com>2011-12-07 15:16:47 +0900
committerVarun Wadekar <vwadekar@nvidia.com>2011-12-15 11:52:09 +0530
commit6992959b717c58e6bd70daa1886ed5d401f8edb2 (patch)
treef1faf026cb29b5b070ab93eaedc6a49b081b9dd9 /drivers/video/tegra/dc/hdmi.c
parent115a6e6335f77705055c8c71aa22fffddb5b8cfb (diff)
tegra: HDMI: add underscan capability exposure via sysfs
TVs/monitors which do not support underscan will crop HDMI picture. Underscan information might be needed in userspace to adjust HDMI resolution so that the picture will be shown correctly on such devices. Bug 911580 Bug 912187 Change-Id: I1eec810d860e13dafef895cb85b32fd8187a4e02 Signed-off-by: Victor Ryabukhin <vryabukhin@nvidia.com> Reviewed-on: http://git-master/r/68616 Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'drivers/video/tegra/dc/hdmi.c')
-rw-r--r--drivers/video/tegra/dc/hdmi.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/drivers/video/tegra/dc/hdmi.c b/drivers/video/tegra/dc/hdmi.c
index e12c16851368..413a3df8c39b 100644
--- a/drivers/video/tegra/dc/hdmi.c
+++ b/drivers/video/tegra/dc/hdmi.c
@@ -32,6 +32,7 @@
#include <linux/workqueue.h>
#include <linux/debugfs.h>
#include <linux/seq_file.h>
+#include <linux/device.h>
#include <mach/clk.h>
#include <mach/dc.h>
@@ -912,11 +913,30 @@ static void tegra_dc_hdmi_resume(struct tegra_dc *dc)
tegra_nvhdcp_resume(hdmi->nvhdcp);
}
+static ssize_t underscan_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+#ifdef CONFIG_SWITCH
+ struct tegra_dc_hdmi_data *hdmi =
+ container_of(dev_get_drvdata(dev), struct tegra_dc_hdmi_data, hpd_switch);
+
+ if (hdmi->edid)
+ return sprintf(buf, "%d\n", tegra_edid_underscan_supported(hdmi->edid));
+ else
+ return 0;
+#else
+ return 0;
+#endif
+}
+
+static DEVICE_ATTR(underscan, S_IRUGO | S_IWUSR, underscan_show, NULL);
+
static int tegra_dc_hdmi_init(struct tegra_dc *dc)
{
struct tegra_dc_hdmi_data *hdmi;
struct resource *res;
struct resource *base_res;
+ int ret;
void __iomem *base;
struct clk *clk = NULL;
struct clk *disp1_clk = NULL;
@@ -1038,7 +1058,10 @@ static int tegra_dc_hdmi_init(struct tegra_dc *dc)
#ifdef CONFIG_SWITCH
hdmi->hpd_switch.name = "hdmi";
- switch_dev_register(&hdmi->hpd_switch);
+ ret = switch_dev_register(&hdmi->hpd_switch);
+
+ if (!ret)
+ device_create_file(hdmi->hpd_switch.dev, &dev_attr_underscan);
#endif
dc->out->depth = 24;