Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions | Variables
i2c-boardinfo.c File Reference
#include <linux/kernel.h>
#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/export.h>
#include <linux/rwsem.h>
#include "i2c-core.h"

Go to the source code of this file.

Functions

 DECLARE_RWSEM (__i2c_board_lock)
 
 EXPORT_SYMBOL_GPL (__i2c_board_lock)
 
 LIST_HEAD (__i2c_board_list)
 
 EXPORT_SYMBOL_GPL (__i2c_board_list)
 
 EXPORT_SYMBOL_GPL (__i2c_first_dynamic_bus_num)
 
int __init i2c_register_board_info (int busnum, struct i2c_board_info const *info, unsigned len)
 

Variables

int __i2c_first_dynamic_bus_num
 

Function Documentation

DECLARE_RWSEM ( __i2c_board_lock  )
EXPORT_SYMBOL_GPL ( __i2c_board_lock  )
EXPORT_SYMBOL_GPL ( __i2c_board_list  )
EXPORT_SYMBOL_GPL ( __i2c_first_dynamic_bus_num  )
int __init i2c_register_board_info ( int  busnum,
struct i2c_board_info const info,
unsigned  len 
)

i2c_register_board_info - statically declare I2C devices : identifies the bus to which these devices belong : vector of i2c device descriptors : how many descriptors in the vector; may be zero to reserve the specified bus number.

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 arch_initcall() 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.

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 "new style" I2C drivers to the devices. The bus number for any device declared using this routine is not available for dynamic allocation.

The board info passed can safely be __initdata, but be careful of embedded pointers (for platform_data, functions, etc) since that won't be copied.

Definition at line 65 of file i2c-boardinfo.c.

LIST_HEAD ( __i2c_board_list  )

Variable Documentation

int __i2c_first_dynamic_bus_num

Definition at line 38 of file i2c-boardinfo.c.