diff mbox series

[v5,1/2] usb: typec: altmodes/displayport: add support for embedded DP cases

Message ID 20230817150824.14371-2-dmitry.baryshkov@linaro.org (mailing list archive)
State Accepted
Commit 0bd9e0219bf0764149eb83826c774162c09e74de
Headers show
Series usb: typec: qcom-pmic-typec: enable DP support | expand

Commit Message

Dmitry Baryshkov Aug. 17, 2023, 3:08 p.m. UTC
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 <dmitry.baryshkov@linaro.org>
---
 drivers/usb/typec/altmodes/displayport.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Heikki Krogerus Aug. 22, 2023, 1:39 p.m. UTC | #1
On Thu, Aug 17, 2023 at 06:08:23PM +0300, Dmitry Baryshkov wrote:
> 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 <dmitry.baryshkov@linaro.org>

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
>  drivers/usb/typec/altmodes/displayport.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/typec/altmodes/displayport.c b/drivers/usb/typec/altmodes/displayport.c
> index bc4af130940d..a4cf1045b535 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;
>  
> -- 
> 2.39.2
diff mbox series

Patch

diff --git a/drivers/usb/typec/altmodes/displayport.c b/drivers/usb/typec/altmodes/displayport.c
index bc4af130940d..a4cf1045b535 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;