'\" t .\" Title: i2c_register_board_info .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: May 2018 .\" Manual: I2C and SMBus Subsystem .\" Source: Kernel Hackers Manual 3.16.56 .\" Language: English .\" .TH "I2C_REGISTER_BOARD_I" "9" "May 2018" "Kernel Hackers Manual 3\&.16\&" "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_register_board_info \- statically declare I2C devices .SH "SYNOPSIS" .HP \w'int\ i2c_register_board_info('u .BI "int i2c_register_board_info(int\ " "busnum" ", struct\ i2c_board_info\ const\ *\ " "info" ", unsigned\ " "len" ");" .SH "ARGUMENTS" .PP \fIbusnum\fR .RS 4 identifies the bus to which these devices belong .RE .PP \fIinfo\fR .RS 4 vector of i2c device descriptors .RE .PP \fIlen\fR .RS 4 how many descriptors in the vector; may be zero to reserve the specified bus number\&. .RE .SH "DESCRIPTION" .PP Systems using the Linux I2C driver stack can declare tables of board info while they initialize\&. This should be done in board\-specific init code near \fBarch_initcall\fR time, or equivalent, before any I2C adapter driver is registered\&. For example, mainboard init code could define several devices, as could the init code for each daughtercard in a board stack\&. .PP The I2C devices will be created later, after the adapter for the relevant bus has been registered\&. After that moment, standard driver model tools are used to bind \(lqnew style\(rq I2C drivers to the devices\&. The bus number for any device declared using this routine is not available for dynamic allocation\&. .PP The board info passed can safely be __initdata, but be careful of embedded pointers (for platform_data, functions, etc) since that won\*(Aqt be copied\&. .SH "COPYRIGHT" .br