xref: /linux/drivers/gpu/drm/i915/display/intel_tc.h (revision 2e4b90fb)
1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2019 Intel Corporation
4  */
5 
6 #ifndef __INTEL_TC_H__
7 #define __INTEL_TC_H__
8 
9 #include <linux/types.h>
10 
11 struct intel_crtc_state;
12 struct intel_digital_port;
13 struct intel_encoder;
14 
15 bool intel_tc_port_in_tbt_alt_mode(struct intel_digital_port *dig_port);
16 bool intel_tc_port_in_dp_alt_mode(struct intel_digital_port *dig_port);
17 bool intel_tc_port_in_legacy_mode(struct intel_digital_port *dig_port);
18 bool intel_tc_port_handles_hpd_glitches(struct intel_digital_port *dig_port);
19 
20 bool intel_tc_port_connected(struct intel_encoder *encoder);
21 
22 u32 intel_tc_port_get_pin_assignment_mask(struct intel_digital_port *dig_port);
23 int intel_tc_port_max_lane_count(struct intel_digital_port *dig_port);
24 void intel_tc_port_set_fia_lane_count(struct intel_digital_port *dig_port,
25 				      int required_lanes);
26 
27 void intel_tc_port_init_mode(struct intel_digital_port *dig_port);
28 void intel_tc_port_sanitize_mode(struct intel_digital_port *dig_port,
29 				 const struct intel_crtc_state *crtc_state);
30 void intel_tc_port_lock(struct intel_digital_port *dig_port);
31 void intel_tc_port_unlock(struct intel_digital_port *dig_port);
32 void intel_tc_port_suspend(struct intel_digital_port *dig_port);
33 void intel_tc_port_get_link(struct intel_digital_port *dig_port,
34 			    int required_lanes);
35 void intel_tc_port_put_link(struct intel_digital_port *dig_port);
36 bool intel_tc_port_ref_held(struct intel_digital_port *dig_port);
37 bool intel_tc_port_link_needs_reset(struct intel_digital_port *dig_port);
38 bool intel_tc_port_link_reset(struct intel_digital_port *dig_port);
39 void intel_tc_port_link_cancel_reset_work(struct intel_digital_port *dig_port);
40 
41 int intel_tc_port_init(struct intel_digital_port *dig_port, bool is_legacy);
42 void intel_tc_port_cleanup(struct intel_digital_port *dig_port);
43 
44 bool intel_tc_cold_requires_aux_pw(struct intel_digital_port *dig_port);
45 
46 #endif /* __INTEL_TC_H__ */
47