forked from EnJens/vendor-sony-oss-fingerprint
-
Notifications
You must be signed in to change notification settings - Fork 30
/
common.h
56 lines (48 loc) · 1.57 KB
/
common.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef FINGERPRINT_COMMON_H
#define FINGERPRINT_COMMON_H
#include <stdint.h>
#define FPC_IOC_MAGIC 0x1145
#define FPC_IOCWPREPARE _IOW(FPC_IOC_MAGIC, 0x01, int)
#define FPC_IOCWDEVWAKE _IOW(FPC_IOC_MAGIC, 0x02, int)
#define FPC_IOCWRESET _IOW(FPC_IOC_MAGIC, 0x03, int)
#define FPC_IOCWAWAKE _IOW(FPC_IOC_MAGIC, 0x04, int)
#define FPC_IOCRPREPARE _IOR(FPC_IOC_MAGIC, 0x81, int)
#define FPC_IOCRDEVWAKE _IOR(FPC_IOC_MAGIC, 0x82, int)
#define FPC_IOCRIRQ _IOR(FPC_IOC_MAGIC, 0x83, int)
#define FPC_IOCRIRQPOLL _IOR(FPC_IOC_MAGIC, 0x84, int)
enum {
FPC_PWROFF = 0,
FPC_PWRON = 1,
};
enum {
FPC_EVENT_FINGER,
FPC_EVENT_EVENTFD,
FPC_EVENT_TIMEOUT,
FPC_EVENT_ERROR,
};
typedef struct {
int epoll_fd;
int dev_fd;
int event_fd;
} fpc_event_t;
typedef int32_t err_t;
err_t fpc_event_create(fpc_event_t *, int event_fd);
err_t fpc_event_destroy(fpc_event_t *);
err_t fpc_set_power(const fpc_event_t *, int poweron);
err_t fpc_get_power(const fpc_event_t *);
err_t fpc_poll_event(const fpc_event_t *);
err_t is_event_available(const fpc_event_t *event);
/**
* Extend wakelock timeout.
*
* @param[in] awake Boolean: awake or release wakelock.
* @param[in] timeout How long to stay awake, in ms.
*
* The kernel cannot guess how long the operation takes, since the
* HAL waits for a finger to disappear when the operation is unsuccessful,
* before returning back to polling.
*
* Note that \p timeout is clamped to a maximum defined in the driver.
*/
err_t fpc_keep_awake(const fpc_event_t *event, int awake, unsigned int timeout);
#endif // FINGERPRINT_COMMON_H