diff mbox

[3/3] DSS2 sysfs enteries to export LPR enable to user

Message ID E0D41E29EB0DAC4E9F3FF173962E9E94026AD401DD@dbde02.ent.ti.com (mailing list archive)
State Not Applicable, archived
Delegated to: Tomi Valkeinen
Headers show

Commit Message

Y, Kishore Dec. 22, 2009, 9:37 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c
index 3b92b84..81fc70e 100644
--- a/drivers/video/omap2/dss/display.c
+++ b/drivers/video/omap2/dss/display.c
@@ -277,6 +277,28 @@  static ssize_t display_wss_store(struct device *dev,
 	return size;
 }
 
+unsigned long lpr_enable;
+extern int omap_dispc_lpr_enable(void);
+extern void omap_dispc_lpr_disable(void);
+
+static ssize_t display_lpr_store(struct device *dev,
+		struct device_attribute *attr, const char *buf, size_t size)
+{
+	lpr_enable = simple_strtoul(buf, NULL, 0);
+	if (lpr_enable)
+		omap_dispc_lpr_enable();
+	else
+		omap_dispc_lpr_disable();
+
+	return size;
+}
+
+static ssize_t display_lpr_show(struct device *dev,
+		struct device_attribute *attr, char *buf)
+{
+	return snprintf(buf, PAGE_SIZE, "%lu\n", lpr_enable);
+}
+
 static DEVICE_ATTR(enabled, S_IRUGO|S_IWUSR,
 		display_enabled_show, display_enabled_store);
 static DEVICE_ATTR(update_mode, S_IRUGO|S_IWUSR,
@@ -291,6 +313,8 @@  static DEVICE_ATTR(mirror, S_IRUGO|S_IWUSR,
 		display_mirror_show, display_mirror_store);
 static DEVICE_ATTR(wss, S_IRUGO|S_IWUSR,
 		display_wss_show, display_wss_store);
+static DEVICE_ATTR(lpr_enable, S_IRUGO|S_IWUSR,
+		display_lpr_show, display_lpr_store);
 
 static struct device_attribute *display_sysfs_attrs[] = {
 	&dev_attr_enabled,
@@ -300,6 +324,7 @@  static struct device_attribute *display_sysfs_attrs[] = {
 	&dev_attr_rotate,
 	&dev_attr_mirror,
 	&dev_attr_wss,
+	&dev_attr_lpr_enable,
 	NULL
 };