Lines Matching full:vbus
34 struct regulator *vbus; member
48 * "DEVICE" = VBUS and "HOST" = !ID, so we have:
51 * even if VBUS is on.
53 * Role | ID | VBUS
61 * - VBUS only - we want to distinguish between [1] and [2], so ID is always 1
62 * - ID only - we want to distinguish between [1] and [4], so VBUS = ID
68 int id, vbus, ret; in usb_conn_detect_cable() local
73 /* check ID and VBUS */ in usb_conn_detect_cable()
76 vbus = info->vbus_gpiod ? in usb_conn_detect_cable()
81 else if (vbus) in usb_conn_detect_cable()
86 dev_dbg(info->dev, "role %d/%d, gpios: id %d, vbus %d\n", in usb_conn_detect_cable()
87 info->last_role, role, id, vbus); in usb_conn_detect_cable()
94 if (info->last_role == USB_ROLE_HOST && info->vbus) in usb_conn_detect_cable()
95 regulator_disable(info->vbus); in usb_conn_detect_cable()
101 if (role == USB_ROLE_HOST && info->vbus) { in usb_conn_detect_cable()
102 ret = regulator_enable(info->vbus); in usb_conn_detect_cable()
104 dev_err(info->dev, "enable vbus regulator failed\n"); in usb_conn_detect_cable()
109 if (info->vbus) in usb_conn_detect_cable()
110 dev_dbg(info->dev, "vbus regulator is %s\n", in usb_conn_detect_cable()
111 regulator_is_enabled(info->vbus) ? "enabled" : "disabled"); in usb_conn_detect_cable()
172 info->vbus_gpiod = devm_gpiod_get_optional(dev, "vbus", GPIOD_IN); in usb_conn_probe()
191 * If the USB connector is a child of a USB port and that port already provides the VBUS in usb_conn_probe()
195 if (of_find_property(dev->parent->of_node, "vbus-supply", NULL)) in usb_conn_probe()
200 info->vbus = devm_regulator_get_optional(dev, "vbus"); in usb_conn_probe()
201 if (PTR_ERR(info->vbus) == -ENODEV) in usb_conn_probe()
202 info->vbus = NULL; in usb_conn_probe()
204 info->vbus = devm_regulator_get(dev, "vbus"); in usb_conn_probe()
207 if (IS_ERR(info->vbus)) { in usb_conn_probe()
208 if (PTR_ERR(info->vbus) != -EPROBE_DEFER) in usb_conn_probe()
209 dev_err(dev, "failed to get vbus: %ld\n", PTR_ERR(info->vbus)); in usb_conn_probe()
210 return PTR_ERR(info->vbus); in usb_conn_probe()
241 dev_err(dev, "failed to get VBUS IRQ\n"); in usb_conn_probe()
250 dev_err(dev, "failed to request VBUS IRQ\n"); in usb_conn_probe()
287 if (info->last_role == USB_ROLE_HOST && info->vbus) in usb_conn_remove()
288 regulator_disable(info->vbus); in usb_conn_remove()