Hi Stephen, On Thu, Feb 27, 2020 at 12:41:13AM -0800, Stephen Boyd wrote: > > +examples: > > + - |+ > > + cros_ec: ec@0 { > > + compatible = "google,cros-ec-spi"; > > + > > + typec { > > + compatible = "google,cros-ec-typec"; > > + > > + usb_con: connector { > > + compatible = "usb-c-connector"; > > + port-number = <0>; > > + power-role = "dual"; > > + data-role = "dual"; > > + try-power-role = "source"; > > + }; > > I thought that perhaps this would be done with the OF graph APIs instead > of being a child of the ec node. I don't see how the usb connector is > anything besides a child of the top-level root node because it's > typically on the board. We put board level components at the root. No. The above follows the usb-connector bindings, so it is correct: Documentation/devicetree/bindings/connector/usb-connector.txt So the connector is always a child of the "CC controller" with the USB Type-C connectors, which in this case is the EC (from operating systems perspective). The "CC controller" controls connectors, and it doesn't actually do anything else. So placing the connectors under the "connector controller" is also logically correct. > Yes, the connector is intimately involved with the EC here, but I would > think that we would have an OF graph connection from the USB controller > on the SoC to the USB connector, traversing through anything that may be > in that path, such as a USB hub. Maybe the connector node itself can > point to the EC type-c controller with some property like I think your idea here is that there should be only a single node for each connector that is then linked with every component that it is physically connected to (right?), but please note that that is not enough. Every component attached to the connector must have its own child node that represents the "port" that is physically connected to the USB Type-C connector. So for example, the USB controller nodes have child nodes for every USB2 port as well as for every USB3 port. Similarly, the GPU controllers have child node for every DisplayPort, etc. And I believe that is already how it has been done in DT (and also in ACPI). Those "port" nodes then just need to be linked with the "connector" node. I think for that the idea was to use OF graph, but I'm really sceptical about that. The problem is that with the USB Type-C connectors we have to be able to identify the connections, i.e. which endpoint is the USB2 port, which is the DisplayPort and so on, and OF graph does not give any means to do that on its own. We will have to rely on separate device properties in order to do the identification. Currently it is not documented anywhere which property should be used for that. For ACPI we are going to propose that with every type of connection, there should be a device property that returns a reference to the appropriate port. That way there are no problems identifying the connections. All we need to do is to define the property names for every type of connection. "usb2-port" for the USB2 or high speed port, "usb3-port" for USB3, etc. thanks, -- heikki