]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/video/omap2/dss/display.c
OMAP: DSS2: remove update_mode from omapdss
[mv-sheeva.git] / drivers / video / omap2 / dss / display.c
index a85a6f38b40c126661e3cf9e61febef169d53fcc..a0bbdf6684b16c6b680baf670b92ae72332c7581 100644 (file)
@@ -27,7 +27,7 @@
 #include <linux/jiffies.h>
 #include <linux/platform_device.h>
 
-#include <plat/display.h>
+#include <video/omapdss.h>
 #include "dss.h"
 
 static ssize_t display_enabled_show(struct device *dev,
@@ -44,9 +44,13 @@ static ssize_t display_enabled_store(struct device *dev,
                const char *buf, size_t size)
 {
        struct omap_dss_device *dssdev = to_dss_device(dev);
-       bool enabled, r;
+       int r, enabled;
 
-       enabled = simple_strtoul(buf, NULL, 10);
+       r = kstrtoint(buf, 0, &enabled);
+       if (r)
+               return r;
+
+       enabled = !!enabled;
 
        if (enabled != (dssdev->state != OMAP_DSS_DISPLAY_DISABLED)) {
                if (enabled) {
@@ -61,46 +65,6 @@ static ssize_t display_enabled_store(struct device *dev,
        return size;
 }
 
-static ssize_t display_upd_mode_show(struct device *dev,
-               struct device_attribute *attr, char *buf)
-{
-       struct omap_dss_device *dssdev = to_dss_device(dev);
-       enum omap_dss_update_mode mode = OMAP_DSS_UPDATE_AUTO;
-       if (dssdev->driver->get_update_mode)
-               mode = dssdev->driver->get_update_mode(dssdev);
-       return snprintf(buf, PAGE_SIZE, "%d\n", mode);
-}
-
-static ssize_t display_upd_mode_store(struct device *dev,
-               struct device_attribute *attr,
-               const char *buf, size_t size)
-{
-       struct omap_dss_device *dssdev = to_dss_device(dev);
-       int val, r;
-       enum omap_dss_update_mode mode;
-
-       if (!dssdev->driver->set_update_mode)
-               return -EINVAL;
-
-       val = simple_strtoul(buf, NULL, 10);
-
-       switch (val) {
-       case OMAP_DSS_UPDATE_DISABLED:
-       case OMAP_DSS_UPDATE_AUTO:
-       case OMAP_DSS_UPDATE_MANUAL:
-               mode = (enum omap_dss_update_mode)val;
-               break;
-       default:
-               return -EINVAL;
-       }
-
-       r = dssdev->driver->set_update_mode(dssdev, mode);
-       if (r)
-               return r;
-
-       return size;
-}
-
 static ssize_t display_tear_show(struct device *dev,
                struct device_attribute *attr, char *buf)
 {
@@ -114,13 +78,16 @@ static ssize_t display_tear_store(struct device *dev,
                struct device_attribute *attr, const char *buf, size_t size)
 {
        struct omap_dss_device *dssdev = to_dss_device(dev);
-       unsigned long te;
-       int r;
+       int te, r;
 
        if (!dssdev->driver->enable_te || !dssdev->driver->get_te)
                return -ENOENT;
 
-       te = simple_strtoul(buf, NULL, 0);
+       r = kstrtoint(buf, 0, &te);
+       if (r)
+               return r;
+
+       te = !!te;
 
        r = dssdev->driver->enable_te(dssdev, te);
        if (r)
@@ -196,13 +163,14 @@ static ssize_t display_rotate_store(struct device *dev,
                struct device_attribute *attr, const char *buf, size_t size)
 {
        struct omap_dss_device *dssdev = to_dss_device(dev);
-       unsigned long rot;
-       int r;
+       int rot, r;
 
        if (!dssdev->driver->set_rotate || !dssdev->driver->get_rotate)
                return -ENOENT;
 
-       rot = simple_strtoul(buf, NULL, 0);
+       r = kstrtoint(buf, 0, &rot);
+       if (r)
+               return r;
 
        r = dssdev->driver->set_rotate(dssdev, rot);
        if (r)
@@ -226,13 +194,16 @@ static ssize_t display_mirror_store(struct device *dev,
                struct device_attribute *attr, const char *buf, size_t size)
 {
        struct omap_dss_device *dssdev = to_dss_device(dev);
-       unsigned long mirror;
-       int r;
+       int mirror, r;
 
        if (!dssdev->driver->set_mirror || !dssdev->driver->get_mirror)
                return -ENOENT;
 
-       mirror = simple_strtoul(buf, NULL, 0);
+       r = kstrtoint(buf, 0, &mirror);
+       if (r)
+               return r;
+
+       mirror = !!mirror;
 
        r = dssdev->driver->set_mirror(dssdev, mirror);
        if (r)
@@ -259,14 +230,15 @@ static ssize_t display_wss_store(struct device *dev,
                struct device_attribute *attr, const char *buf, size_t size)
 {
        struct omap_dss_device *dssdev = to_dss_device(dev);
-       unsigned long wss;
+       u32 wss;
        int r;
 
        if (!dssdev->driver->get_wss || !dssdev->driver->set_wss)
                return -ENOENT;
 
-       if (strict_strtoul(buf, 0, &wss))
-               return -EINVAL;
+       r = kstrtou32(buf, 0, &wss);
+       if (r)
+               return r;
 
        if (wss > 0xfffff)
                return -EINVAL;
@@ -280,8 +252,6 @@ static ssize_t display_wss_store(struct device *dev,
 
 static DEVICE_ATTR(enabled, S_IRUGO|S_IWUSR,
                display_enabled_show, display_enabled_store);
-static DEVICE_ATTR(update_mode, S_IRUGO|S_IWUSR,
-               display_upd_mode_show, display_upd_mode_store);
 static DEVICE_ATTR(tear_elim, S_IRUGO|S_IWUSR,
                display_tear_show, display_tear_store);
 static DEVICE_ATTR(timings, S_IRUGO|S_IWUSR,
@@ -295,7 +265,6 @@ static DEVICE_ATTR(wss, S_IRUGO|S_IWUSR,
 
 static struct device_attribute *display_sysfs_attrs[] = {
        &dev_attr_enabled,
-       &dev_attr_update_mode,
        &dev_attr_tear_elim,
        &dev_attr_timings,
        &dev_attr_rotate,