Lines Matching full:usb2

285 	if (strcmp(soc->name, "usb2") == 0)  in tegra_xusb_pad_create()
286 padctl->usb2 = pad; in tegra_xusb_pad_create()
489 port = tegra_xusb_find_port(padctl, "usb2", index); in tegra_xusb_find_usb2_port()
684 lane = tegra_xusb_find_lane(port->padctl, "usb2", port->index); in tegra_xusb_setup_usb_role_switch()
708 static int tegra_xusb_usb2_port_parse_dt(struct tegra_xusb_usb2_port *usb2) in tegra_xusb_usb2_port_parse_dt() argument
710 struct tegra_xusb_port *port = &usb2->base; in tegra_xusb_usb2_port_parse_dt()
715 usb2->internal = of_property_read_bool(np, "nvidia,internal"); in tegra_xusb_usb2_port_parse_dt()
722 usb2->mode = USB_DR_MODE_UNKNOWN; in tegra_xusb_usb2_port_parse_dt()
724 usb2->mode = err; in tegra_xusb_usb2_port_parse_dt()
727 usb2->mode = USB_DR_MODE_HOST; in tegra_xusb_usb2_port_parse_dt()
731 if (usb2->mode == USB_DR_MODE_PERIPHERAL || in tegra_xusb_usb2_port_parse_dt()
732 usb2->mode == USB_DR_MODE_OTG) { in tegra_xusb_usb2_port_parse_dt()
739 modes[usb2->mode]); in tegra_xusb_usb2_port_parse_dt()
744 usb2->supply = regulator_get(&port->dev, "vbus"); in tegra_xusb_usb2_port_parse_dt()
745 return PTR_ERR_OR_ZERO(usb2->supply); in tegra_xusb_usb2_port_parse_dt()
751 struct tegra_xusb_usb2_port *usb2; in tegra_xusb_add_usb2_port() local
756 * USB2 ports don't require additional properties, but if the port is in tegra_xusb_add_usb2_port()
759 np = tegra_xusb_find_port_node(padctl, "usb2", index); in tegra_xusb_add_usb2_port()
763 usb2 = kzalloc(sizeof(*usb2), GFP_KERNEL); in tegra_xusb_add_usb2_port()
764 if (!usb2) { in tegra_xusb_add_usb2_port()
769 err = tegra_xusb_port_init(&usb2->base, padctl, np, "usb2", index); in tegra_xusb_add_usb2_port()
773 usb2->base.ops = padctl->soc->ports.usb2.ops; in tegra_xusb_add_usb2_port()
775 usb2->base.lane = usb2->base.ops->map(&usb2->base); in tegra_xusb_add_usb2_port()
776 if (IS_ERR(usb2->base.lane)) { in tegra_xusb_add_usb2_port()
777 err = PTR_ERR(usb2->base.lane); in tegra_xusb_add_usb2_port()
781 err = tegra_xusb_usb2_port_parse_dt(usb2); in tegra_xusb_add_usb2_port()
783 tegra_xusb_port_unregister(&usb2->base); in tegra_xusb_add_usb2_port()
787 list_add_tail(&usb2->base.list, &padctl->ports); in tegra_xusb_add_usb2_port()
796 struct tegra_xusb_usb2_port *usb2 = to_usb2_port(port); in tegra_xusb_usb2_port_release() local
798 kfree(usb2); in tegra_xusb_usb2_port_release()
803 struct tegra_xusb_usb2_port *usb2 = to_usb2_port(port); in tegra_xusb_usb2_port_remove() local
805 regulator_put(usb2->supply); in tegra_xusb_usb2_port_remove()
930 err = of_property_read_u32(np, "nvidia,usb2-companion", &value); in tegra_xusb_usb3_port_parse_dt()
1039 static bool tegra_xusb_port_is_companion(struct tegra_xusb_usb2_port *usb2) in tegra_xusb_port_is_companion() argument
1043 struct tegra_xusb_padctl *padctl = usb2->base.padctl; in tegra_xusb_port_is_companion()
1047 if (usb3 && usb3->port == usb2->base.index) in tegra_xusb_port_is_companion()
1054 static int tegra_xusb_update_usb3_fake_port(struct tegra_xusb_usb2_port *usb2) in tegra_xusb_update_usb3_fake_port() argument
1059 usb2->usb3_port_fake = -1; in tegra_xusb_update_usb3_fake_port()
1061 if ((usb2->mode == USB_DR_MODE_OTG || in tegra_xusb_update_usb3_fake_port()
1062 usb2->mode == USB_DR_MODE_PERIPHERAL) && in tegra_xusb_update_usb3_fake_port()
1063 !tegra_xusb_port_is_companion(usb2)) { in tegra_xusb_update_usb3_fake_port()
1064 fake = tegra_xusb_find_unused_usb3_port(usb2->base.padctl); in tegra_xusb_update_usb3_fake_port()
1066 dev_err(&usb2->base.dev, "no unused USB3 ports available\n"); in tegra_xusb_update_usb3_fake_port()
1070 dev_dbg(&usb2->base.dev, "Found unused usb3 port: %d\n", fake); in tegra_xusb_update_usb3_fake_port()
1071 usb2->usb3_port_fake = fake; in tegra_xusb_update_usb3_fake_port()
1080 struct tegra_xusb_usb2_port *usb2; in tegra_xusb_setup_ports() local
1086 for (i = 0; i < padctl->soc->ports.usb2.count; i++) { in tegra_xusb_setup_ports()
1111 for (i = 0; i < padctl->soc->ports.usb2.count; i++) { in tegra_xusb_setup_ports()
1112 usb2 = tegra_xusb_find_usb2_port(padctl, i); in tegra_xusb_setup_ports()
1113 if (!usb2) in tegra_xusb_setup_ports()
1116 err = tegra_xusb_update_usb3_fake_port(usb2); in tegra_xusb_setup_ports()
1378 struct tegra_xusb_usb2_port *usb2; in tegra_xusb_padctl_get_usb3_companion() local
1382 usb2 = tegra_xusb_find_usb2_port(padctl, port); in tegra_xusb_padctl_get_usb3_companion()
1383 if (!usb2) in tegra_xusb_padctl_get_usb3_companion()
1388 if (usb3 && usb3->port == usb2->base.index) in tegra_xusb_padctl_get_usb3_companion()