From 0fe664edc8a16da63045e47eff1e151a2036b59b Mon Sep 17 00:00:00 2001 From: Naman Jain Date: Wed, 20 Nov 2024 16:47:22 +0530 Subject: [PATCH] os/drivers/input: Add ioctl for Touch Wakeup and suspend Add support for Touch wakeup and touch suspend. Added ioctl for it --- os/drivers/input/touchscreen.c | 9 ++++++++- os/include/tinyara/input/touchscreen.h | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/os/drivers/input/touchscreen.c b/os/drivers/input/touchscreen.c index d4aa212ffa..d49afdd423 100755 --- a/os/drivers/input/touchscreen.c +++ b/os/drivers/input/touchscreen.c @@ -229,7 +229,14 @@ static int touch_ioctl(FAR struct file *filep, int cmd, unsigned long arg) } switch (cmd) { - default: + case TSIOC_SUSPEND: { + priv->ops->touch_disable(priv); + } + break; + + case TSIOC_WAKEUP: { + priv->ops->touch_enable(priv); + } break; } return OK; diff --git a/os/include/tinyara/input/touchscreen.h b/os/include/tinyara/input/touchscreen.h index cb06e5bb88..952fbfc191 100644 --- a/os/include/tinyara/input/touchscreen.h +++ b/os/include/tinyara/input/touchscreen.h @@ -84,6 +84,9 @@ #define TSIOC_SETFREQUENCY _TSIOC(0x0003) /* arg: Pointer to uint32_t frequency value */ #define TSIOC_GETFREQUENCY _TSIOC(0x0004) /* arg: Pointer to uint32_t frequency value */ +#define TSIOC_SUSPEND _TSIOC(0x0006) /* Disable touch interrupt */ +#define TSIOC_WAKEUP _TSIOC(0x0007) /* Enable touch interrupt */ + #define TSC_FIRST 0x0001 /* First common command */ #define TSC_NCMDS 4 /* Four common commands */