1
2
3
4
5
6
7
8
9
10
11 #ifndef ET8EK8REGS_H
12 #define ET8EK8REGS_H
13
14 #include <linux/i2c.h>
15 #include <linux/types.h>
16 #include <linux/videodev2.h>
17 #include <linux/v4l2-subdev.h>
18
19 struct v4l2_mbus_framefmt;
20 struct v4l2_subdev_pad_mbus_code_enum;
21
22 struct et8ek8_mode {
23
24 u16 sensor_width;
25 u16 sensor_height;
26 u16 sensor_window_origin_x;
27 u16 sensor_window_origin_y;
28 u16 sensor_window_width;
29 u16 sensor_window_height;
30
31
32 u16 width;
33 u16 height;
34 u16 window_origin_x;
35 u16 window_origin_y;
36 u16 window_width;
37 u16 window_height;
38
39 u32 pixel_clock;
40 u32 ext_clock;
41 struct v4l2_fract timeperframe;
42 u32 max_exp;
43 u32 bus_format;
44 u32 sensitivity;
45 };
46
47 #define ET8EK8_REG_8BIT 1
48 #define ET8EK8_REG_16BIT 2
49 #define ET8EK8_REG_DELAY 100
50 #define ET8EK8_REG_TERM 0xff
51 struct et8ek8_reg {
52 u16 type;
53 u16 reg;
54 u32 val;
55 };
56
57
58 #define ET8EK8_REGLIST_STANDBY 0
59 #define ET8EK8_REGLIST_POWERON 1
60 #define ET8EK8_REGLIST_RESUME 2
61 #define ET8EK8_REGLIST_STREAMON 3
62 #define ET8EK8_REGLIST_STREAMOFF 4
63 #define ET8EK8_REGLIST_DISABLED 5
64
65 #define ET8EK8_REGLIST_MODE 10
66
67 #define ET8EK8_REGLIST_LSC_ENABLE 100
68 #define ET8EK8_REGLIST_LSC_DISABLE 101
69 #define ET8EK8_REGLIST_ANR_ENABLE 102
70 #define ET8EK8_REGLIST_ANR_DISABLE 103
71
72 struct et8ek8_reglist {
73 u32 type;
74 struct et8ek8_mode mode;
75 struct et8ek8_reg regs[];
76 };
77
78 #define ET8EK8_MAX_LEN 32
79 struct et8ek8_meta_reglist {
80 char version[ET8EK8_MAX_LEN];
81 union {
82 struct et8ek8_reglist *ptr;
83 } reglist[];
84 };
85
86 extern struct et8ek8_meta_reglist meta_reglist;
87
88 #endif