Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os/drivers/input: Add ioctl for Touch Wakeup and suspend #6519

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion os/drivers/input/touchscreen.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Comment on lines +232 to 240
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry but real operations are touch disable and enable. But the commands are SUSPEND and WAKEUP. wakeup and enable look little bit different. Is it impossible to use ENABLE and DISABLE?

}
return OK;
Expand Down
3 changes: 3 additions & 0 deletions os/include/tinyara/input/touchscreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down