summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/display/intel_tc.h
diff options
context:
space:
mode:
authorImre Deak <imre.deak@intel.com>2023-03-23 16:20:11 +0200
committerImre Deak <imre.deak@intel.com>2023-04-03 11:35:30 +0300
commit3eafcddf766b6bb8e6308ec2d587d4ef7a4381e4 (patch)
treec3f3b3c71f95dc87656137c365e7f498566728e8 /drivers/gpu/drm/i915/display/intel_tc.h
parent39feb7b16b107625a0071e5bb8ea19ee89be2a9f (diff)
drm/i915/tc: Move TC port fields to a new intel_tc_port struct
Move the TC port specific fields from intel_digital_port to a new intel_tc_port struct. Pass an intel_tc_port pointer to all static functions in intel_tc.c keeping dig_port accessible for these via a pointer stored in the new struct. The next patch will allocate the intel_tc_port dynamically, allowing moving the struct definition to intel_tc.c. Reviewed-by: Mika Kahola <mika.kahola@intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230323142035.1432621-6-imre.deak@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/display/intel_tc.h')
-rw-r--r--drivers/gpu/drm/i915/display/intel_tc.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_tc.h b/drivers/gpu/drm/i915/display/intel_tc.h
index 79667d977508..cc3a7fd4ac10 100644
--- a/drivers/gpu/drm/i915/display/intel_tc.h
+++ b/drivers/gpu/drm/i915/display/intel_tc.h
@@ -9,10 +9,36 @@
#include <linux/mutex.h>
#include <linux/types.h>
+#include "intel_display.h"
+#include "intel_display_power.h"
+#include "intel_wakeref.h"
+
struct intel_crtc_state;
struct intel_digital_port;
struct intel_encoder;
+enum tc_port_mode {
+ TC_PORT_DISCONNECTED,
+ TC_PORT_TBT_ALT,
+ TC_PORT_DP_ALT,
+ TC_PORT_LEGACY,
+};
+
+struct intel_tc_port {
+ struct intel_digital_port *dig_port;
+ struct mutex lock; /* protects the TypeC port mode */
+ intel_wakeref_t lock_wakeref;
+ enum intel_display_power_domain lock_power_domain;
+ struct delayed_work disconnect_phy_work;
+ int link_refcount;
+ bool legacy_port:1;
+ char port_name[8];
+ enum tc_port_mode mode;
+ enum tc_port_mode init_mode;
+ enum phy_fia phy_fia;
+ u8 phy_fia_idx;
+};
+
bool intel_tc_port_in_tbt_alt_mode(struct intel_digital_port *dig_port);
bool intel_tc_port_in_dp_alt_mode(struct intel_digital_port *dig_port);
bool intel_tc_port_in_legacy_mode(struct intel_digital_port *dig_port);