summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/touchscreen/touchscreen.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/touchscreen/touchscreen.c b/src/touchscreen/touchscreen.c
index 45caf747..a2ef250f 100644
--- a/src/touchscreen/touchscreen.c
+++ b/src/touchscreen/touchscreen.c
@@ -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)