usb: typec: tcpm: try to get role switch from tcpc fwnode
Subsystems (3)
PATCH 1/1 usb: typec: tcpm: try to get role switch from tcpc fwnode
Try to get usb role switch from tcpc fwnode if failed to get role switch from port dev, this is for case the port for role switch endpoint is located in connector node, as per connector binding doc, port@0 for HS is required.
ptn5110: tcpc@50 {
compatible = "nxp,ptn5110";
...
status = "okay";
connector {
compatible = "usb-c-connector";
label = "USB-C";
...
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
typec_conn: endpoint {
remote-endpoint = <&usb2_controller>;
};
};
};
};
};--- drivers/usb/typec/tcpm/tcpm.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/typec/tcpm/tcpm.c +2 -0
@@ -6557,6 +6557,8 @@ struct tcpm_port *tcpm_register_port(struct device *dev, struct tcpc_dev *tcpc) port->port_type = port->typec_caps.type; port->role_sw =usb_role_switch_get (port->dev); +if (!port->role_sw) + port->role_sw =fwnode_usb_role_switch_get (tcpc->fwnode);if (IS_ERR (port->role_sw)) { err =PTR_ERR (port->role_sw); goto out_destroy_wq;
Signature · 1 line
2.34.1
Heikki Krogerus
maintainer+Bryan
Quoted 40 lines · Li Jun
Try to get usb role switch from tcpc fwnode if failed to get role switch from port dev, this is for case the port for role switch endpoint is located in connector node, as per connector binding doc, port@0 for HS is required.
ptn5110: tcpc@50 { compatible = "nxp,ptn5110"; ... status = "okay"; connector { compatible = "usb-c-connector"; label = "USB-C"; ... ports { #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; typec_conn: endpoint { remote-endpoint = <&usb2_controller>; }; }; }; }; };Signed-off-by Li Jun <[email protected]>--- drivers/usb/typec/tcpm/tcpm.c | 2 ++ 1 file changed, 2 insertions(+)drivers/usb/typec/tcpm/tcpm.c +0
-0
drivers/usb/typec/tcpm/tcpm.c struct tcpm_port *tcpm_register_port(struct device *dev, struct tcpc_dev *tcpc) · line 6564
Quoted 8 lines
drivers/usb/typec/tcpm/tcpm.c +2
-0@@ -6557,6 +6557,8 @@ struct tcpm_port *tcpm_register_port(struct device *dev, struct tcpc_dev *tcpc) port->port_type = port->typec_caps.type; port->role_sw =usb_role_switch_get (port->dev); +if (!port->role_sw) + port->role_sw =fwnode_usb_role_switch_get (tcpc->fwnode);if (IS_ERR (port->role_sw)) { err =PTR_ERR (port->role_sw); goto out_destroy_wq;
This looks like exactly the same as the RFC from Bryan that I just commented. I have not objections if this looks okay to you Brian. I think we should still wait for comments also from Guenter.
thanks,
Signature · 1 line
heikki
Quoted 45 lines · Heikki Krogerus
+Bryan
Quoted 42 lines · Li Jun
Try to get usb role switch from tcpc fwnode if failed to get role switch from port dev, this is for case the port for role switch endpoint is located in connector node, as per connector binding doc, port@0 for HS is required.
ptn5110: tcpc@50 { compatible = "nxp,ptn5110"; ... status = "okay"; connector { compatible = "usb-c-connector"; label = "USB-C"; ... ports { #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; typec_conn: endpoint { remote-endpoint = <&usb2_controller>; }; }; }; }; };Signed-off-by Li Jun <[email protected]>--- drivers/usb/typec/tcpm/tcpm.c | 2 ++ 1 file changed, 2 insertions(+)drivers/usb/typec/tcpm/tcpm.c +0
-0@@ -6557,6 +6557,8 @@ struct tcpm_port *tcpm_register_port(struct device *dev, struct tcpc_dev *tcpc) port->port_type = port->typec_caps.type;
Quoted 11 lines
drivers/usb/typec/tcpm/tcpm.c struct tcpm_port *tcpm_register_port(struct device *dev, struct tcpc_dev *tcpc) · line 6564
Quoted 6 lines
drivers/usb/typec/tcpm/tcpm.c +2
-0port->role_sw =usb_role_switch_get (port->dev); +if (!port->role_sw) + port->role_sw =fwnode_usb_role_switch_get (tcpc->fwnode);if (IS_ERR (port->role_sw)) { err =PTR_ERR (port->role_sw); goto out_destroy_wq;This looks like exactly the same as the RFC from Bryan that I just commented. I have not objections if this looks okay to you Brian. I think we should still wait for comments also from Guenter.
Ok with me.
Guenter
Quoted 4 lines
thanks,
Signature · 1 line
heikki
Quoted 56 lines · Heikki Krogerus
+Bryan
Quoted 40 lines · Li Jun
Try to get usb role switch from tcpc fwnode if failed to get role switch from port dev, this is for case the port for role switch endpoint is located in connector node, as per connector binding doc, port@0 for HS is required.
ptn5110: tcpc@50 { compatible = "nxp,ptn5110"; ... status = "okay"; connector { compatible = "usb-c-connector"; label = "USB-C"; ... ports { #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; typec_conn: endpoint { remote-endpoint = <&usb2_controller>; }; }; }; }; };Signed-off-by Li Jun <[email protected]>--- drivers/usb/typec/tcpm/tcpm.c | 2 ++ 1 file changed, 2 insertions(+)drivers/usb/typec/tcpm/tcpm.c +0
-0drivers/usb/typec/tcpm/tcpm.c struct tcpm_port *tcpm_register_port(struct device *dev, struct tcpc_dev *tcpc) · line 6564
Quoted 8 lines
drivers/usb/typec/tcpm/tcpm.c +2
-0@@ -6557,6 +6557,8 @@ struct tcpm_port *tcpm_register_port(struct device *dev, struct tcpc_dev *tcpc) port->port_type = port->typec_caps.type; port->role_sw =usb_role_switch_get (port->dev); +if (!port->role_sw) + port->role_sw =fwnode_usb_role_switch_get (tcpc->fwnode);if (IS_ERR (port->role_sw)) { err =PTR_ERR (port->role_sw); goto out_destroy_wq;This looks like exactly the same as the RFC from Bryan that I just commented. I have not objections if this looks okay to you Brian. I think we should still wait for comments also from Guenter.
Quoted 2 lines
thanks,
It does look exactly the same. I don't mind letting Li have the commit.
---
bod
Quoted 30 lines · Li Jun
Try to get usb role switch from tcpc fwnode if failed to get role switch from port dev, this is for case the port for role switch endpoint is located in connector node, as per connector binding doc, port@0 for HS is required.
ptn5110: tcpc@50 { compatible = "nxp,ptn5110"; ... status = "okay"; connector { compatible = "usb-c-connector"; label = "USB-C"; ... ports { #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; typec_conn: endpoint { remote-endpoint = <&usb2_controller>; }; }; }; }; };
Quoted 1 line
Signed-off-by Li Jun <[email protected]>
Quoted 19 lines
--- drivers/usb/typec/tcpm/tcpm.c | 2 ++ 1 file changed, 2 insertions(+)drivers/usb/typec/tcpm/tcpm.c +2
-0@@ -6557,6 +6557,8 @@ struct tcpm_port *tcpm_register_port(struct device *dev, struct tcpc_dev *tcpc) port->port_type = port->typec_caps.type; port->role_sw =usb_role_switch_get (port->dev); +if (!port->role_sw) + port->role_sw =fwnode_usb_role_switch_get (tcpc->fwnode);if (IS_ERR (port->role_sw)) { err =PTR_ERR (port->role_sw); goto out_destroy_wq;Signature · 1 line
2.34.1
Signature · 1 line
heikki