File tree Expand file tree Collapse file tree 2 files changed +65
-0
lines changed Expand file tree Collapse file tree 2 files changed +65
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ all-y += system76_ec.c
5
5
6
6
ramstage-y += smbios.c
7
7
ramstage-$(CONFIG_EC_SYSTEM76_EC_LOCKDOWN) += lockdown.c
8
+ ramstage-y += usbc_mux.c
8
9
9
10
smm-$(CONFIG_DEBUG_SMI) += system76_ec.c
10
11
Original file line number Diff line number Diff line change
1
+ /* SPDX-License-Identifier: GPL-2.0-only */
2
+
3
+ #include <delay.h>
4
+ #include <device/usbc_mux.h>
5
+ #include <intelblocks/tcss.h>
6
+
7
+ static int system76_ec_get_mux_info (int port , struct usbc_mux_info * info )
8
+ {
9
+ if (!info )
10
+ return -1 ;
11
+
12
+ // TODO: Get actual TBT port info
13
+ info -> dp = true;
14
+ info -> usb = true;
15
+ // Initialize everything else to 0.
16
+ info -> cable = false;
17
+ info -> polarity = false;
18
+ info -> hpd_lvl = false;
19
+ info -> hpd_irq = false;
20
+ info -> ufp = false;
21
+ info -> dbg_acc = false;
22
+ // XXX: Mode E and F for USB Type-C to DisplayPort
23
+ info -> dp_pin_mode = MODE_DP_PIN_E ;
24
+
25
+ return 0 ;
26
+ }
27
+
28
+ static int system76_ec_wait_for_connection (long timeout_ms )
29
+ {
30
+ mdelay (50 );
31
+ return 1 ;
32
+ }
33
+
34
+ static int system76_ec_enter_dp_mode (int port )
35
+ {
36
+ return 0 ;
37
+ }
38
+
39
+ static int system76_ec_wait_for_dp_mode_entry (int port , long timeout_ms )
40
+ {
41
+ return 0 ;
42
+ }
43
+
44
+ static int system76_ec_wait_for_hpd (int port , long timeout_ms )
45
+ {
46
+ return 0 ;
47
+ }
48
+
49
+ static const struct usbc_ops system76_ec_usbc_ops = {
50
+ .mux_ops = {
51
+ .get_mux_info = system76_ec_get_mux_info ,
52
+ },
53
+ .dp_ops = {
54
+ .wait_for_connection = system76_ec_wait_for_connection ,
55
+ .enter_dp_mode = system76_ec_enter_dp_mode ,
56
+ .wait_for_dp_mode_entry = system76_ec_wait_for_dp_mode_entry ,
57
+ .wait_for_hpd = system76_ec_wait_for_hpd ,
58
+ },
59
+ };
60
+
61
+ const struct usbc_ops * usbc_get_ops (void )
62
+ {
63
+ return & system76_ec_usbc_ops ;
64
+ }
You can’t perform that action at this time.
0 commit comments