sync hh.org
[hh.org.git] / include / asm-arm / arch-pxa / fsi.h
bloba6bf298cfabe5414b86ae32bfa66ed65819b6c77
1 /* H5400 Fingerprint Sensor Interface driver
2 * Copyright (c) 2004 and 2005 JĀ°rgen Andreas Michaelsen <jorgenam@ifi.uio.no>
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9 #ifndef _FSI_H_
10 #define _FSI_H_
12 #define FSI_FRAME_SIZE 281 /* words */
14 #define ASIC_FSI_Data32 ASIC_REGISTER( u32, FSI, Data )
15 #undef ASIC_FSI_Data
17 #define FSI_CMD_MODE_STOP 0x00
18 #define FSI_CMD_MODE_START 0x01
19 #define FSI_CMD_MODE_NAP 0x02
20 #define FSI_CMD_STOP_ACQ_INT 0x10
21 #define FSI_CMD_START_ACQ_INT 0x11
22 #define FSI_CMD_STOP_INFO_INT 0x14
23 #define FSI_CMD_START_INFO_INT 0x15
24 #define FSI_CMD_RESET 0x20
25 #define FSI_CMD_START_TEMP 0x30
26 #define FSI_CMD_STOP_TEMP 0x31
28 #define FSI_DB1_EVEN(x) (x&0xF)
29 #define FSI_DB1_ODD(x) ((x>>4)&0xF)
30 #define FSI_DB2_EVEN(x) ((x>>8)&0xF)
31 #define FSI_DB2_ODD(x) ((x>>12)&0xF)
32 #define FSI_DB3_EVEN(x) ((x>>16)&0xF)
33 #define FSI_DB3_ODD(x) ((x>>20)&0xF)
34 #define FSI_DB4_EVEN(x) ((x>>24)&0xF)
35 #define FSI_DB4_ODD(x) ((x>>28)&0xF)
37 #define FSI_CONTROL_TEMP (1<<2)
39 #define FSI_IOC_MAGIC 0x81
40 #define FSI_IOCSTOPTEMP _IO(FSI_IOC_MAGIC, 1)
41 #define FSI_IOCSTARTTEMP _IO(FSI_IOC_MAGIC, 2)
42 #define FSI_IOCINCTEMP _IO(FSI_IOC_MAGIC, 3)
43 #define FSI_IOCSETPRESCALE _IO(FSI_IOC_MAGIC, 4)
44 #define FSI_IOCSETDMI _IO(FSI_IOC_MAGIC, 5)
45 #define FSI_IOCSETTRESHOLDON _IO(FSI_IOC_MAGIC, 6)
46 #define FSI_IOCSETTRESHOLDOFF _IO(FSI_IOC_MAGIC, 7)
48 struct fsi_read_state
50 unsigned long *buffer; /* destination for data read from FIFO (circular buffer) */
51 unsigned int buffer_size; /* circular buffer size */
52 unsigned int write_pos; /* used by circular buffer producer */
53 unsigned int read_pos; /* used by circular buffer consumer */
54 unsigned int word_count; /* how many words read so far (written to user) */
55 unsigned int word_dest; /* how many words we should read */
57 unsigned int frame_number;
58 unsigned int frame_offset;
60 unsigned char do_read; /* true if valid data (copy to user) */
61 unsigned char finished;
63 unsigned int treshold_on; /* level for deciding when finger is present */
64 unsigned int treshold_off; /* level for deciding when finger is removed */
65 unsigned char detect_count; /* another (second) treshold */
66 unsigned char finger_present; /* true if finger is present on scanner */
67 unsigned int detect_value;
70 #endif /* _FSI_H_ */