---
name: "usb_gadget_disconnect"
section: "9"
platform: "linux"
package: "linux-manual-3.16"
version: "3.16.56-1+deb8u1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/usb_gadget_disconnect"
---

# usb\_gadget\_disconnect(9)

software-controlled disconnect from USB host

## NAME

usb\_gadget\_disconnect - software-controlled disconnect from USB host

## SYNOPSIS

**int usb\_gadget\_disconnect(struct usb\_gadget \*** *gadget***);**

## ARGUMENTS

*gadget*

the peripheral being disconnected

## DESCRIPTION

Disables the D+ (or potentially D-) pullup, which the host may see as a disconnect (when a VBUS session is active). Not all systems support software pullup controls.

This routine may be used during the gadget driver **bind** call to prevent the peripheral from ever being visible to the USB host, unless later **usb\_gadget\_connect** is called. For example, user mode components may need to be activated before the system can talk to hosts.

Returns zero on success, else negative errno.

## AUTHOR

**David Brownell** \<dbrownell@users.sourceforge.net\>

Author.

## COPYRIGHT
