1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 #ifndef M5602_S5K4AA_H_
16 #define M5602_S5K4AA_H_
17
18 #include <linux/dmi.h>
19
20 #include "m5602_sensor.h"
21
22
23
24 #define S5K4AA_PAGE_MAP 0xec
25
26 #define S5K4AA_PAGE_MAP_0 0x00
27 #define S5K4AA_PAGE_MAP_1 0x01
28 #define S5K4AA_PAGE_MAP_2 0x02
29
30
31 #define S5K4AA_READ_MODE 0x03
32 #define S5K4AA_ROWSTART_HI 0x04
33 #define S5K4AA_ROWSTART_LO 0x05
34 #define S5K4AA_COLSTART_HI 0x06
35 #define S5K4AA_COLSTART_LO 0x07
36 #define S5K4AA_WINDOW_HEIGHT_HI 0x08
37 #define S5K4AA_WINDOW_HEIGHT_LO 0x09
38 #define S5K4AA_WINDOW_WIDTH_HI 0x0a
39 #define S5K4AA_WINDOW_WIDTH_LO 0x0b
40 #define S5K4AA_GLOBAL_GAIN__ 0x0f
41
42 #define S5K4AA_H_BLANK_HI__ 0x1d
43 #define S5K4AA_H_BLANK_LO__ 0x1e
44 #define S5K4AA_EXPOSURE_HI 0x17
45 #define S5K4AA_EXPOSURE_LO 0x18
46 #define S5K4AA_BRIGHTNESS 0x1f
47 #define S5K4AA_GAIN 0x20
48 #define S5K4AA_NOISE_SUPP 0x37
49
50 #define S5K4AA_RM_ROW_SKIP_4X 0x08
51 #define S5K4AA_RM_ROW_SKIP_2X 0x04
52 #define S5K4AA_RM_COL_SKIP_4X 0x02
53 #define S5K4AA_RM_COL_SKIP_2X 0x01
54 #define S5K4AA_RM_H_FLIP 0x40
55 #define S5K4AA_RM_V_FLIP 0x80
56
57 #define S5K4AA_DEFAULT_GAIN 0x5f
58 #define S5K4AA_DEFAULT_BRIGHTNESS 0x10
59
60
61
62
63 extern int force_sensor;
64 extern bool dump_sensor;
65
66 int s5k4aa_probe(struct sd *sd);
67 int s5k4aa_init(struct sd *sd);
68 int s5k4aa_init_controls(struct sd *sd);
69 int s5k4aa_start(struct sd *sd);
70 void s5k4aa_disconnect(struct sd *sd);
71
72 static const struct m5602_sensor s5k4aa = {
73 .name = "S5K4AA",
74 .i2c_slave_id = 0x5a,
75 .i2c_regW = 2,
76
77 .probe = s5k4aa_probe,
78 .init = s5k4aa_init,
79 .init_controls = s5k4aa_init_controls,
80 .start = s5k4aa_start,
81 .disconnect = s5k4aa_disconnect,
82 };
83
84 #endif