drm/i915/tc: Add TC PHY hooks to connect/disconnect the PHY
authorImre Deak <imre.deak@intel.com>
Thu, 23 Mar 2023 14:20:19 +0000 (16:20 +0200)
committerImre Deak <imre.deak@intel.com>
Mon, 3 Apr 2023 08:35:30 +0000 (11:35 +0300)
Add TC PHY hooks to connect/disconnect the PHY. A follow-up patch will
add the ADLP specific hooks for these.

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-14-imre.deak@intel.com
drivers/gpu/drm/i915/display/intel_tc.c

index bf83e67940543ebde13a3a0166e0faee36ee8323..cdac808aac3ccc08fa835f9da92b8b698bd55da9 100644 (file)
@@ -29,6 +29,8 @@ struct intel_tc_phy_ops {
        bool (*is_ready)(struct intel_tc_port *tc);
        bool (*is_owned)(struct intel_tc_port *tc);
        void (*get_hw_state)(struct intel_tc_port *tc);
+       bool (*connect)(struct intel_tc_port *tc, int required_lanes);
+       void (*disconnect)(struct intel_tc_port *tc);
 };
 
 struct intel_tc_port {
@@ -523,6 +525,8 @@ static const struct intel_tc_phy_ops icl_tc_phy_ops = {
        .is_ready = icl_tc_phy_is_ready,
        .is_owned = icl_tc_phy_is_owned,
        .get_hw_state = icl_tc_phy_get_hw_state,
+       .connect = icl_tc_phy_connect,
+       .disconnect = icl_tc_phy_disconnect,
 };
 
 /*
@@ -605,6 +609,8 @@ static const struct intel_tc_phy_ops adlp_tc_phy_ops = {
        .is_ready = adlp_tc_phy_is_ready,
        .is_owned = adlp_tc_phy_is_owned,
        .get_hw_state = icl_tc_phy_get_hw_state,
+       .connect = icl_tc_phy_connect,
+       .disconnect = icl_tc_phy_disconnect,
 };
 
 /*
@@ -824,10 +830,10 @@ static void tc_phy_connect(struct intel_tc_port *tc, int required_lanes)
 
        tc->mode = tc_phy_get_target_mode(tc);
 
-       connected = icl_tc_phy_connect(tc, required_lanes);
+       connected = tc->phy_ops->connect(tc, required_lanes);
        if (!connected && tc->mode != default_tc_mode(tc)) {
                tc->mode = default_tc_mode(tc);
-               connected = icl_tc_phy_connect(tc, required_lanes);
+               connected = tc->phy_ops->connect(tc, required_lanes);
        }
 
        drm_WARN_ON(&i915->drm, !connected);
@@ -836,7 +842,7 @@ static void tc_phy_connect(struct intel_tc_port *tc, int required_lanes)
 static void tc_phy_disconnect(struct intel_tc_port *tc)
 {
        if (tc->mode != TC_PORT_DISCONNECTED) {
-               icl_tc_phy_disconnect(tc);
+               tc->phy_ops->disconnect(tc);
                tc->mode = TC_PORT_DISCONNECTED;
        }
 }