diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c index 83189c48c03c..462ab482aacc 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c @@ -46,6 +46,32 @@ static bool is_support_iommu = true; static struct drm_driver rockchip_drm_driver; +/** + * drm_connector_oob_hotplug_event - Report out-of-band hotplug event to connector + * @connector: connector to report the event on + * + * On some hardware a hotplug event notification may come from outside the display + * driver / device. An example of this is some USB Type-C setups where the hardware + * muxes the DisplayPort data and aux-lines but does not pass the altmode HPD + * status bit to the GPU's DP HPD pin. + * + * This function can be used to report these out-of-band events after obtaining + * a drm_connector reference through calling drm_connector_find_by_fwnode(). + */ +void drm_connector_oob_hotplug_event(struct fwnode_handle *connector_fwnode) +{ + struct rockchip_drm_sub_dev *sub_dev; + + if (!connector_fwnode || !connector_fwnode->dev) + return; + + sub_dev = rockchip_drm_get_sub_dev(dev_of_node(connector_fwnode->dev)); + + if (sub_dev && sub_dev->connector && sub_dev->oob_hotplug_event) + sub_dev->oob_hotplug_event(sub_dev->connector); +} +EXPORT_SYMBOL(drm_connector_oob_hotplug_event); + uint32_t rockchip_drm_get_bpp(const struct drm_format_info *info) { /* use whatever a driver has set */ diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.h b/drivers/gpu/drm/rockchip/rockchip_drm_drv.h index bb1aa545222f..a3802c3bcc78 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.h +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.h @@ -58,6 +58,7 @@ struct rockchip_drm_sub_dev { struct drm_connector *connector; struct device_node *of_node; void (*loader_protect)(struct drm_encoder *encoder, bool on); + void (*oob_hotplug_event)(struct drm_connector *connector); }; struct rockchip_sdr2hdr_state { diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index a67f51d737dd..f8cd5d8e58ee 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -1649,6 +1649,7 @@ drm_connector_is_unregistered(struct drm_connector *connector) DRM_CONNECTOR_UNREGISTERED; } +void drm_connector_oob_hotplug_event(struct fwnode_handle *connector_fwnode); const char *drm_get_connector_type_name(unsigned int connector_type); const char *drm_get_connector_status_name(enum drm_connector_status status); const char *drm_get_subpixel_order_name(enum subpixel_order order);