Debian Codegraph @

src/soc/mediatek/mt8196/mt6685.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only OR MIT */
2
3 #include <console/console.h>
4 #include <soc/mt6685.h>
5
6 static const struct mt6685_setting init_setting[] = {
7 {0x18, 0x2, 0x2, 0},
8 {0x1A, 0x1F, 0x1F, 0},
9 {0x27, 0x10, 0x10, 0},
10 {0x8A, 0x0, 0x1F, 0},
11 {0x10B, 0x8, 0x8, 0},
12 {0x11E, 0x1, 0x1, 0},
13 {0x127, 0x2, 0x2, 0},
14 {0x193, 0x1, 0x1, 0},
15 {0x19C, 0x3, 0xF, 0},
16 {0x389, 0x0, 0xFF, 0},
17 {0x38A, 0x0, 0x7, 0},
18 {0x413, 0x7, 0xFF, 0},
19 {0x418, 0x10, 0xF0, 0},
20 {0x789, 0x6, 0x6, 0},
21 {0x9B3, 0x0, 0x7F, 0},
22 {0x9B4, 0x7E, 0x7E, 0},
23 {0xF8C, 0x15, 0x15, 0},
24 {0xF8D, 0x5, 0x5, 0},
25 {0x1B0D, 0xF, 0xF, 0},
26 {0x1B0E, 0x1, 0x1, 0},
27 {0x1B0F, 0x0, 0x1, 0},
28 {0x1B10, 0x7F, 0x7F, 0},
29 {0x1B1A, 0x8, 0x8, 0},
30 {0x1B89, 0x0, 0x80, 0},
31 {0x1B8E, 0x40, 0x40, 0},
32 {0x1B99, 0x0, 0x80, 0},
33 {0x1B9E, 0x40, 0x40, 0},
34 {0x1BA9, 0x0, 0x80, 0},
35 {0x1BAE, 0x40, 0x40, 0},
36 {0x1BB9, 0x0, 0x80, 0},
37 {0x1BC9, 0x0, 0x80, 0},
38 {0x1BD9, 0x0, 0x80, 0},
39 {0x1C09, 0x0, 0x80, 0},
40 {0x1C0B, 0x1, 0x5, 0},
41 {0x1C0E, 0xC0, 0xC0, 0},
42 {0x1C8E, 0x1, 0x1, 0},
43
44 /* Add UVLO 2.0 setting, also need to modify dts setting for main pmic */
45 {0x7F1, 0x1, 0xF, 0},
46 {0x9a3, 0xD, 0x1F, 0},
47 {0x9b2, 0x80, 0x80, 0},
48 {0xA8b, 0x4, 0x4, 0},
49 };
50
51 static inline void write_field(const struct mt6685_setting *setting)
52 {
53 mt6685_write_field(setting->addr, setting->val, setting->mask, setting->shift);
54 }
55
56 void mt6685_init_setting(void)
57 {
58 for (int i = 0; i < ARRAY_SIZE(init_setting); i++)
59 write_field(&init_setting[i]);
60 }