1 /* SPDX-License-Identifier: GPL-2.0-only */
6 /* struct to hold all USB-C mux related variables */
8 bool dp
; /* DP connected */
9 bool usb
; /* USB connected */
10 bool cable
; /* 0 = Passive cable, 1 = Active cable */
11 bool polarity
; /* Polarity of connected device. 0 = Normal, 1 = Flipped */
12 bool hpd_lvl
; /* HPD Level assert */
13 bool hpd_irq
; /* HPD IRQ assert */
14 bool ufp
; /* 0 = DFP, 1 = UFP */
15 bool dbg_acc
; /* Debug Accessory. 0 = Disable, 1 = Enable */
16 uint8_t dp_pin_mode
; /* DP pin assignments
28 * Get mux information on a given port.
34 int (*get_mux_info
)(int port
, struct usbc_mux_info
*info
);
39 * Wait up to `timeout_ms` for DP connection to be ready on any available port.
43 * 0 = no DP connection
44 * <bit mask> = mask for ports that are ready in DP mode.
46 int (*wait_for_connection
)(long timeout_ms
);
49 * Enter DP mode on a given `port`.
55 int (*enter_dp_mode
)(int port
);
58 * Wait up to `timeout_ms` for DP mode entry on a given port.
64 int (*wait_for_dp_mode_entry
)(int port
, long timeout_ms
);
67 * Wait up to `timeout_ms` for HPD on a given port.
73 int (*wait_for_hpd
)(int port
, long timeout_ms
);
77 struct usbc_mux_ops mux_ops
;
78 struct usbc_dp_ops dp_ops
;
81 const struct usbc_ops
*usbc_get_ops(void);
83 #endif /* __USBC_MUX_H__ */