Commit 93cb4094 authored by Imre Deak's avatar Imre Deak

drm/dp_mst: Add drm_dp_mst_aux_for_parent()

Add a function to get the AUX device of the parent of an MST port, used
by a follow-up i915 patch in the patchset.

v2: Move drm_dp_mst_aux_for_parent() forward declaration to this patch
    (Ankit)

Cc: Lyude Paul <lyude@redhat.com>
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: default avatarAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Acked-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240416221010.376865-10-imre.deak@intel.com
parent ca5d9d78
...@@ -6010,6 +6010,22 @@ static bool drm_dp_mst_is_virtual_dpcd(struct drm_dp_mst_port *port) ...@@ -6010,6 +6010,22 @@ static bool drm_dp_mst_is_virtual_dpcd(struct drm_dp_mst_port *port)
return false; return false;
} }
/**
* drm_dp_mst_aux_for_parent() - Get the AUX device for an MST port's parent
* @port: MST port whose parent's AUX device is returned
*
* Return the AUX device for @port's parent or NULL if port's parent is the
* root port.
*/
struct drm_dp_aux *drm_dp_mst_aux_for_parent(struct drm_dp_mst_port *port)
{
if (!port->parent || !port->parent->port_parent)
return NULL;
return &port->parent->port_parent->aux;
}
EXPORT_SYMBOL(drm_dp_mst_aux_for_parent);
/** /**
* drm_dp_mst_dsc_aux_for_port() - Find the correct aux for DSC * drm_dp_mst_dsc_aux_for_port() - Find the correct aux for DSC
* @port: The port to check. A leaf of the MST tree with an attached display. * @port: The port to check. A leaf of the MST tree with an attached display.
......
...@@ -955,6 +955,7 @@ bool drm_dp_mst_port_is_logical(struct drm_dp_mst_port *port) ...@@ -955,6 +955,7 @@ bool drm_dp_mst_port_is_logical(struct drm_dp_mst_port *port)
return port->port_num >= DP_MST_LOGICAL_PORT_0; return port->port_num >= DP_MST_LOGICAL_PORT_0;
} }
struct drm_dp_aux *drm_dp_mst_aux_for_parent(struct drm_dp_mst_port *port);
struct drm_dp_aux *drm_dp_mst_dsc_aux_for_port(struct drm_dp_mst_port *port); struct drm_dp_aux *drm_dp_mst_dsc_aux_for_port(struct drm_dp_mst_port *port);
static inline struct drm_dp_mst_topology_state * static inline struct drm_dp_mst_topology_state *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment