From: Marek Vasut Date: Wed, 16 Sep 2020 15:43:37 +0200 Subject: [PATCH 10/13] ehci-mx6: Add OTG ID detecting by GPIO In-Reply-To: <20200916125705.4341-11-peng.fan@nxp.com> References: <20200916125705.4341-1-peng.fan@nxp.com> <20200916125705.4341-11-peng.fan@nxp.com> Message-ID: <2961658d-7922-e730-7c47-9b6041520d43@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 9/16/20 2:57 PM, peng.fan at nxp.com wrote: [...] > +int __weak board_ehci_usb_phy_mode(struct udevice *dev) > +{ > + return USB_INIT_HOST; > +} > + > static int ehci_usb_phy_mode(struct udevice *dev) > { > struct usb_platdata *plat = dev_get_platdata(dev); > @@ -634,6 +653,15 @@ static int ehci_usb_ofdata_to_platdata(struct udevice *dev) > { > struct usb_platdata *plat = dev_get_platdata(dev); > enum usb_dr_mode dr_mode; > + const struct fdt_property *extcon; > + > + extcon = fdt_get_property(gd->fdt_blob, dev_of_offset(dev), > + "extcon", NULL); > + if (extcon) { > + plat->init_type = board_ehci_usb_phy_mode(dev); Shouldn't this information be available in the DT too ?