Lines Matching full:vbus

35 	struct regulator *vbus;  member
50 * "DEVICE" = VBUS and "HOST" = !ID, so we have:
53 * even if VBUS is on.
55 * Role | ID | VBUS
63 * - VBUS only - we want to distinguish between [1] and [2], so ID is always 1
64 * - ID only - we want to distinguish between [1] and [4], so VBUS = ID
70 int id, vbus, ret; in usb_conn_detect_cable() local
75 /* check ID and VBUS */ in usb_conn_detect_cable()
78 vbus = info->vbus_gpiod ? in usb_conn_detect_cable()
83 else if (vbus) in usb_conn_detect_cable()
88 dev_dbg(info->dev, "role %s -> %s, gpios: id %d, vbus %d\n", in usb_conn_detect_cable()
89 usb_role_string(info->last_role), usb_role_string(role), id, vbus); in usb_conn_detect_cable()
98 if (info->last_role == USB_ROLE_HOST && info->vbus) in usb_conn_detect_cable()
99 regulator_disable(info->vbus); in usb_conn_detect_cable()
105 if (role == USB_ROLE_HOST && info->vbus) { in usb_conn_detect_cable()
106 ret = regulator_enable(info->vbus); in usb_conn_detect_cable()
108 dev_err(info->dev, "enable vbus regulator failed\n"); in usb_conn_detect_cable()
113 if (info->vbus) in usb_conn_detect_cable()
114 dev_dbg(info->dev, "vbus regulator is %s\n", in usb_conn_detect_cable()
115 str_enabled_disabled(regulator_is_enabled(info->vbus))); in usb_conn_detect_cable()
193 info->vbus_gpiod = devm_gpiod_get_optional(dev, "vbus", GPIOD_IN); in usb_conn_probe()
211 info->vbus = devm_regulator_get_optional(dev, "vbus"); in usb_conn_probe()
212 if (PTR_ERR(info->vbus) == -ENODEV) in usb_conn_probe()
213 info->vbus = NULL; in usb_conn_probe()
215 if (IS_ERR(info->vbus)) in usb_conn_probe()
216 return dev_err_probe(dev, PTR_ERR(info->vbus), "failed to get vbus\n"); in usb_conn_probe()
247 dev_err(dev, "failed to get VBUS IRQ\n"); in usb_conn_probe()
256 dev_err(dev, "failed to request VBUS IRQ\n"); in usb_conn_probe()
281 if (info->last_role == USB_ROLE_HOST && info->vbus) in usb_conn_remove()
282 regulator_disable(info->vbus); in usb_conn_remove()