From: Dmitry Baryshkov Date: Thu, 17 Aug 2023 15:08:23 +0000 (+0300) Subject: usb: typec: altmodes/displayport: add support for embedded DP cases X-Git-Tag: v6.6.17~4039^2~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0bd9e0219bf0764149eb83826c774162c09e74de;p=platform%2Fkernel%2Flinux-rpi.git usb: typec: altmodes/displayport: add support for embedded DP cases In the embedded cases, the DisplayPort connector is handled by the TCPM itself. It was proposed to add the "displayport" OF property to the DT bindings, but it was rejected in favour of properly describing the electrical signal path using of_graph. Fallback to the controller fwnode for HPD notifications to support such usecases without requiring additional DT properties. Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230817150824.14371-2-dmitry.baryshkov@linaro.org Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/typec/altmodes/displayport.c b/drivers/usb/typec/altmodes/displayport.c index cdf8261e22db..426c88a516e5 100644 --- a/drivers/usb/typec/altmodes/displayport.c +++ b/drivers/usb/typec/altmodes/displayport.c @@ -594,7 +594,10 @@ int dp_altmode_probe(struct typec_altmode *alt) alt->ops = &dp_altmode_ops; fwnode = dev_fwnode(alt->dev.parent->parent); /* typec_port fwnode */ - dp->connector_fwnode = fwnode_find_reference(fwnode, "displayport", 0); + if (fwnode_property_present(fwnode, "displayport")) + dp->connector_fwnode = fwnode_find_reference(fwnode, "displayport", 0); + else + dp->connector_fwnode = fwnode_handle_get(fwnode); /* embedded DP */ if (IS_ERR(dp->connector_fwnode)) dp->connector_fwnode = NULL;