1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #ifndef STV06XX_SENSOR_H_
18 #define STV06XX_SENSOR_H_
19
20 #include "stv06xx.h"
21
22 #define IS_1020(sd) ((sd)->sensor == &stv06xx_sensor_hdcs1020)
23
24 extern const struct stv06xx_sensor stv06xx_sensor_vv6410;
25 extern const struct stv06xx_sensor stv06xx_sensor_hdcs1x00;
26 extern const struct stv06xx_sensor stv06xx_sensor_hdcs1020;
27 extern const struct stv06xx_sensor stv06xx_sensor_pb0100;
28 extern const struct stv06xx_sensor stv06xx_sensor_st6422;
29
30 struct stv06xx_sensor {
31
32 char name[32];
33
34
35 u8 i2c_addr;
36
37
38 u8 i2c_flush;
39
40
41 u8 i2c_len;
42
43
44 int min_packet_size[4];
45 int max_packet_size[4];
46
47
48 int (*probe)(struct sd *sd);
49
50
51 int (*init)(struct sd *sd);
52
53
54 int (*init_controls)(struct sd *sd);
55
56
57 int (*read_sensor)(struct sd *sd, const u8 address,
58 u8 *i2c_data, const u8 len);
59
60
61 int (*write_sensor)(struct sd *sd, const u8 address,
62 u8 *i2c_data, const u8 len);
63
64
65 int (*start)(struct sd *sd);
66
67
68 int (*stop)(struct sd *sd);
69
70
71 int (*dump)(struct sd *sd);
72 };
73
74 #endif