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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Subramani Venkatesh <x0108988@xxxxxx>

LPR power saving methods are exported to user by sysfs entires,
implementing of ioctl will help user application to use the LPR.

echo 1 > /sys/devices/platform/omapdss/display0/lpr_enable
enables the LPR on LCD.

echo 0 > /sys/devices/platform/omapdss/display0/lpr_enable
disables the LPR on LCD.

Signed-off-by: Kishore Y <kishore.y@xxxxxx>
Signed-off-by: Sudeep Basavaraj <sudeep.basavaraj@xxxxxx>
---
 drivers/video/omap2/dss/display.c |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

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
 };
 
-- 
1.5.4.3


Regards,
Kishore Y

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux