---
name: "usb_add_config"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/usb_add_config"
---

# usb\_add\_config(9)

add a configuration to a device.

## NAME

usb\_add\_config - add a configuration to a device.

## SYNOPSIS

**int usb\_add\_config(struct usb\_composite\_dev \*** *cdev***, struct usb\_configuration \*** *config***, int (\****bind***) (struct usb\_configuration \*));**

## ARGUMENTS

*cdev*

wraps the USB gadget

*config*

the configuration, with bConfigurationValue assigned

*bind*

the configuration's bind function

## CONTEXT

single threaded during gadget setup

## DESCRIPTION

One of the main tasks of a composite *bind*() routine is to add each of the configurations it supports, using this routine.

This function returns the value of the configuration's *bind*(), which is zero for success else a negative errno value. Binding configurations assigns global resources including string IDs, and per-configuration resources such as interface IDs and endpoints.

## AUTHOR

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

Author.

## COPYRIGHT
