#include "core/log.h"
static struct touchscreen_device *touchscreen_dev;
+static int touchscreen_enable = DEVICE_OPS_STATUS_START;
static int touchscreen_probe(void *data)
{
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);
}
.start = touchscreen_start,
.stop = touchscreen_stop,
.dump = touchscreen_dump,
+ .execute = touchscreen_execute,
};
DEVICE_OPS_REGISTER(&touchscreen_device_ops)