
26 Dec
2023
26 Dec
'23
10:30 a.m.
On Fri, 22 Dec 2023 at 21:43, Caleb Connolly caleb.connolly@linaro.org wrote:
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.
As discussed in the other thread, arch/arm/mach-snapdragon/board_apq8016.c would be a better place for the time being.
-Sumit
-Sumit
-- // Caleb (they/them)