Hi Sumit, [...] >> - if (init == USB_INIT_HOST) { >> - /* Start USB Hub */ >> - dm_gpio_set_dir_flags(&hub_reset, >> - GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE); >> - mdelay(100); >> - /* Switch usb to host connectors */ >> - dm_gpio_set_dir_flags(&usb_sel, >> - GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE); >> - mdelay(100); >> - } else { /* Device */ >> - /* Disable hub */ >> - dm_gpio_set_dir_flags(&hub_reset, GPIOD_IS_OUT); >> - /* Switch back to device connector */ >> - dm_gpio_set_dir_flags(&usb_sel, GPIOD_IS_OUT); >> + /* Select "default" or "device" pinctrl */ >> + switch (init) { >> + case USB_INIT_HOST: >> + pinctrl_select_state(usb, "default"); >> + break; >> + case USB_INIT_DEVICE: >> + pinctrl_select_state(usb, "device"); >> + break; >> + default: >> + debug("Unknown usb_init_type %d\n", init); >> + break; > > Can this pinctrl configuration move to the corresponding USB driver instead?
Possibly, this is definitely something where DT is currently lacking, similar discussions in Linux resulted in the USB onboard_hub driver, it would be nice to add support for that U-Boot at some point. I don't think putting the pinctrl code directly into the USB driver is the right way to go, as it definitely wouldn't be accepted in upstream DT bindings. > > -Sumit > -- // Caleb (they/them)