diff options
| author | Henrik Rydberg <rydberg@euromail.se> | 2010-06-17 20:15:44 +0200 |
|---|---|---|
| committer | Henrik Rydberg <rydberg@euromail.se> | 2010-06-17 20:15:44 +0200 |
| commit | 7d392652bae52b76cb5fe907cc1e86e0e0c4ced9 (patch) | |
| tree | bdbc8271e1b2a85041f84cfefb37bd32c48a8c5c /include | |
| parent | 6a8c74eb36ab93702c257f425832272cccb0cde8 (diff) | |
Add idle function
This patch adds the mtdev_idle() function, which checks the kernel
device for activity. Useful when implementing timing logic.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'include')
| -rw-r--r-- | include/mtdev.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/mtdev.h b/include/mtdev.h index 5f2f6a3..e2fdc9d 100644 --- a/include/mtdev.h +++ b/include/mtdev.h | |||
| @@ -146,6 +146,17 @@ int mtdev_configure(struct mtdev *dev, int fd); | |||
| 146 | int mtdev_open(struct mtdev *dev, int fd); | 146 | int mtdev_open(struct mtdev *dev, int fd); |
| 147 | 147 | ||
| 148 | /** | 148 | /** |
| 149 | * mtdev_idle - check state of kernel device | ||
| 150 | * @dev: the mtdev in use | ||
| 151 | * @fd: file descriptor of the kernel device | ||
| 152 | * @ms: number of milliseconds to wait for activity | ||
| 153 | * | ||
| 154 | * Returns true if the device is idle, i.e., there are no buffered | ||
| 155 | * events and there is nothing to fetch from the kernel device. | ||
| 156 | */ | ||
| 157 | int mtdev_idle(struct mtdev *dev, int fd, int ms); | ||
| 158 | |||
| 159 | /** | ||
| 149 | * mtdev_fetch - fetch an event from the kernel device | 160 | * mtdev_fetch - fetch an event from the kernel device |
| 150 | * @dev: the mtdev in use | 161 | * @dev: the mtdev in use |
| 151 | * @ev: the kernel input event to fill | 162 | * @ev: the kernel input event to fill |
