On Thu, Apr 14, 2022 at 8:05 AM Xu Yang <xu.yang_2@xxxxxxx> wrote: > > Hi jun, > > > -----Original Message----- > > From: Jun Li <jun.li@xxxxxxx> > > Sent: Wednesday, April 13, 2022 9:16 PM > > To: Xu Yang <xu.yang_2@xxxxxxx>; Adam Ford <aford173@xxxxxxxxx>; Jun Li > > <lijun.kernel@xxxxxxxxx>; Xu Yang <xu.yang_2@xxxxxxx> > > Cc: Guenter Roeck <linux@xxxxxxxxxxxx>; Heikki Krogerus > > <heikki.krogerus@xxxxxxxxxxxxxxx>; USB list <linux-usb@xxxxxxxxxxxxxxx> > > Subject: RE: Using PTN5110 w/ USB Hub > > > > > > > > > -----Original Message----- > > > From: Adam Ford <aford173@xxxxxxxxx> > > > Sent: Tuesday, April 12, 2022 11:58 PM > > > To: Jun Li <lijun.kernel@xxxxxxxxx> > > > Cc: Guenter Roeck <linux@xxxxxxxxxxxx>; Heikki Krogerus > > > <heikki.krogerus@xxxxxxxxxxxxxxx>; USB list > > > <linux-usb@xxxxxxxxxxxxxxx>; Jun Li <jun.li@xxxxxxx>; Xu Yang > > > <xu.yang_2@xxxxxxx> > > > Subject: Re: Using PTN5110 w/ USB Hub > > > > > > On Tue, Apr 12, 2022 at 10:37 AM Jun Li <lijun.kernel@xxxxxxxxx> wrote: > > > > > > > > Adam Ford <aford173@xxxxxxxxx> 于2022年4月12日周二 08:24写道: > > > > > > > > > > I have a board with a dual role USB conttroller connected to a > > > > > dual role hub > > > > > > > > Could you please explain more about what's "a dual role hub"? > > > Thanks for responding. > > > > > > > > > The datasheet is listed here: > > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fww1. > > > m > > > > > icrochip.com%2Fdownloads%2Fen%2FDeviceDoc%2F00002238D.pdf&data > > =04% > > > 7 > > > > > C01%7Cjun.li%40nxp.com%7C71a9f6a3197248e09d0708da1c9d4187%7C686ea > > 1d3bc > > > 2 > > > > > b4c6fa92cd99c5c301635%7C0%7C1%7C637853758981725860%7CUnknown%7 > > CTWFpbGZ > > > s > > > > > b3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0 > > %3D > > > % > > > > > 7C3000&sdata=VFowzrzgNKvG7ZbXGMUBtmMa2nV5bH5Jl9knYVS%2BJ7w > > %3D& > > > r > > > eserved=0 > > > > > > I worded that poorly, sorry. It supports DCP, CDP, SDP. > > > > > > From the datasheet: > > > • USB Hub Feature Controller IC Hub with:- 1 USB 3.1 Gen 1 USB > > > Type-CTM downstream port- 4 USB 3.1 Gen 1 legacy downstream ports- 1 > > > USB 2.0 downstream port- Legacy upstream port • USB-IF Battery Charger > > > revision 1.2 support on up & downstream ports (DCP, CDP, SDP) > > > > P2 ~ P6 all are normal downstream ports, how about P1? It's just has 2 sets of SS > > lanes(for typec) but still downstream port(DFP)? > > > > > > > > The hope was to have the PTN enable the SRC_EN when the USB-C cable is > > > connected to the hub. > > > > If you use the correct USB-C cable(Present Rd), PTN should detect a sink and > > Linux tcpm + tcpci driver will enable SRC_EN for you, Did you correctly enable > > the typec port driver? > > > > Cat /sys/kernel/debug/usb/tcpm-xxx/log > > > > @Xu Yang, could you help check if a source only config like below still Can work? > > > > ptn5110: tcpc@50 { > > compatible = "nxp,ptn5110"; > > pinctrl-names = "default"; > > pinctrl-0 = <&pinctrl_typec>; > > reg = <0x50>; > > interrupt-parent = <&gpio4>; > > interrupts = <19 8>; > > > > > > usb_con: connector { > > compatible = "usb-c-connector"; > > label = "USB-C"; > > power-role = "source"; > > data-role = "host"; > > source-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>; > > > > ports { > > #address-cells = <1>; > > #size-cells = <0>; > > > > port@1 { > > reg = <1>; > > typec_con_ss: endpoint { > > remote-endpoint = <&usb3_data_ss>; > > }; > > }; > > }; > > }; > > }; > > After my check, the ptn5110 can work with the above source only config. I've been sick for a few days, so when I can work on this again, I will give it a try. I think I understand it better now. Thanks for your help. adam > > Xu Yang > > > > > > > > > > > > > > > connected to a PTN5110 for enabing power to the USB-C. > > > > > > > > > > SoC -> Hub -> PTN-> USB-C > > > > > > > > What signals of Hub chip connect to PTN5110 chip? > > > > > > Technically, only the CC pins are connected between the USB-C > > > connector and the PTN5110. There isn't really a connection to the hub > > > itself, but the output on the PTN enables a regulator which powers the > > > USB-C which does connect to the hub. > > > > That's a typical usage. > > > > > > > > > > > > > > > > > > > The hope was the PTN5110 would enable/disable the src_en pin when > > > > > I connect a device that needs power. Unfortunately, most of the > > > > > examples I can see for the device trees on a PTN5110 show some > > > > > sort of connection to a USB controller, but I am going through a > > > > > hub, not a controller. > > > > > > > > > > Is it possible to configure the PTN5110 to either not require > > > > > connection to a USB controller or plumb it to a USB hub? > > > > > > > > My understanding PTN5110(TCPCI controller with PD PHY) is > > > > independent with USB data path, for USB data path, I think it should be: > > > > SoC -> Hub -> USB-C > > > > PTN5110 should not care or know if there is a Hub between type-C > > > > connector and USB controller. > > > > If the type-C connector connects to a Hub, then it's a DFP only on > > > > data, and from power point view, you also only power source role, right? > > > > > > Yes. We're basically trying to source power when a device is > > > connected and power down the regulator when the USB-C device is > > > disconnected. Unfortunately, the PTN5110 never enables power even when > > > I specify it's source only with no sink. The driver acts like it > > > needs some sort of USB node, > > > > If you don't need usb data dual role(host and device), I assume the typec node > > does not need link to any usb controller node, PTN just works to enable > > power(via SRC_EN) and do orientation flip. > > > > > and when it doesn't find one, and the > > > example device tree in the YAML file shows a refernce to the USB > > > controller. I assumed I needed to plumb it to the hub somehow. If I > > > am reading your response correctly, I should just add the node for the > > > USB controller and forget the hub exists, is that correct? > > > > You even need not link PTN to USB controller, see my comment above. > > > > Li Jun > > > > > > > > > > > > > thanks > > > > Li Jun > > > > > > > > > > thanks > > > > > > > > > > adam