Add touchscreen execute 94/217494/2 accepted/tizen/unified/20191113.010239 submit/tizen/20191112.072646
authorYoungjae Cho <y0.cho@samsung.com>
Tue, 12 Nov 2019 06:28:14 +0000 (15:28 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Tue, 12 Nov 2019 07:01:43 +0000 (16:01 +0900)
Change-Id: Ia97235271addd8c10690e1b0dbfdc92b3b8c0231
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
src/touchscreen/touchscreen.c

index 45caf74..a2ef250 100644 (file)
@@ -24,6 +24,7 @@
 #include "core/log.h"
 
 static struct touchscreen_device *touchscreen_dev;
+static int touchscreen_enable = DEVICE_OPS_STATUS_START;
 
 static int touchscreen_probe(void *data)
 {
@@ -100,8 +101,17 @@ static int touchscreen_set_state(enum touchscreen_state state)
        return ret;
 }
 
+static int touchscreen_execute(void *data)
+{
+       touchscreen_enable = (int)data;
+       return 0;
+}
+
 static int touchscreen_start(enum device_flags flags)
 {
+       if (touchscreen_enable != DEVICE_OPS_STATUS_START)
+               return 0;
+
        return touchscreen_set_state(TOUCHSCREEN_ON);
 }
 
@@ -139,6 +149,7 @@ static const struct device_ops touchscreen_device_ops = {
        .start    = touchscreen_start,
        .stop     = touchscreen_stop,
        .dump     = touchscreen_dump,
+       .execute  = touchscreen_execute,
 };
 
 DEVICE_OPS_REGISTER(&touchscreen_device_ops)