arm: allwinner: a10_ehci: Look for the phy based on the id

phy-names was never in the bindings schema even if it was present
in some DTS. Get the optional phy based on its ID.

PR:		240978
This commit is contained in:
Emmanuel Vadot 2019-10-01 20:22:54 +00:00
parent 4dbb3f478b
commit ecd012f975
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=352941

View File

@ -144,6 +144,7 @@ a10_ehci_attach(device_t self)
struct aw_ehci_softc *aw_sc = device_get_softc(self);
ehci_softc_t *sc = &aw_sc->sc;
const struct aw_ehci_conf *conf;
phandle_t node;
bus_space_handle_t bsh;
int err, rid, off;
struct clk_list *clkp;
@ -154,6 +155,8 @@ a10_ehci_attach(device_t self)
conf = USB_CONF(self);
node = ofw_bus_get_node(self);
/* initialise some bus fields */
sc->sc_bus.parent = self;
sc->sc_bus.devices = sc->sc_devices;
@ -241,7 +244,7 @@ a10_ehci_attach(device_t self)
}
/* Enable USB PHY */
if (phy_get_by_ofw_name(self, 0, "usb", &aw_sc->phy) == 0) {
if (phy_get_by_ofw_idx(self, node, 0, &aw_sc->phy) == 0) {
err = phy_usb_set_mode(aw_sc->phy, PHY_USB_MODE_HOST);
if (err != 0) {
device_printf(self, "Could not set phy to host mode\n");