'\" t .\" Title: i2c_new_secondary_device .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: January 2017 .\" Manual: I2C and SMBus Subsystem .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "I2C_NEW_SECONDARY_DE" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "I2C and SMBus Subsystem" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" i2c_new_secondary_device \- Helper to get the instantiated secondary address and create the associated device .SH "SYNOPSIS" .HP \w'struct\ i2c_client\ *\ i2c_new_secondary_device('u .BI "struct i2c_client * i2c_new_secondary_device(struct\ i2c_client\ *\ " "client" ", const\ char\ *\ " "name" ", u16\ " "default_addr" ");" .SH "ARGUMENTS" .PP \fIclient\fR .RS 4 Handle to the primary client .RE .PP \fIname\fR .RS 4 Handle to specify which secondary address to get .RE .PP \fIdefault_addr\fR .RS 4 Used as a fallback if no secondary address was specified .RE .SH "CONTEXT" .PP can sleep .SH "DESCRIPTION" .PP I2C clients can be composed of multiple I2C slaves bound together in a single component\&. The I2C client driver then binds to the master I2C slave and needs to create I2C dummy clients to communicate with all the other slaves\&. .PP This function creates and returns an I2C dummy client whose I2C address is retrieved from the platform firmware based on the given slave name\&. If no address is specified by the firmware default_addr is used\&. .PP On DT\-based platforms the address is retrieved from the \(lqreg\(rq property entry cell whose \(lqreg\-names\(rq value matches the slave name\&. .PP This returns the new i2c client, which should be saved for later use with \fBi2c_unregister_device\fR; or NULL to indicate an error\&. .SH "COPYRIGHT" .br