---
name: "i2c_new_device"
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/i2c_new_device"
---

# i2c\_new\_device(9)

instantiate an i2c device

## NAME

i2c\_new\_device - instantiate an i2c device

## SYNOPSIS

**struct i2c\_client \* i2c\_new\_device(struct i2c\_adapter \*** *adap***, struct i2c\_board\_info const \*** *info***);**

## ARGUMENTS

*adap*

the adapter managing the device

*info*

describes one I2C device; bus\_num is ignored

## CONTEXT

can sleep

## DESCRIPTION

Create an i2c device. Binding is handled through driver model **probe**/**remove** methods. A driver may be bound to this device when we return from this function, or any later moment (e.g. maybe hotplugging will load the driver module). This call is not appropriate for use by mainboard initialization logic, which usually runs during an **arch\_initcall** long before any i2c\_adapter could exist.

This returns the new i2c client, which may be saved for later use with **i2c\_unregister\_device**; or NULL to indicate an error.

## COPYRIGHT
