October 2017
Intermediate to advanced
586 pages
14h 8m
English
We must inform the kernel about which devices are physically present on the system. There are two ways to achieve that: in the DT, as we will see later in the chapter, or through the board configuration file (which is the old and deprecated way). Let's see how to do it in the board configuration file:
struct i2c_board_info is the structure used to represent an I2C device on our board. The structure is defined as follows:
struct i2c_board_info {
char type[I2C_NAME_SIZE];
unsigned short addr;
void *platform_data;
int irq;
};
Once again, elements not relevant to us have been removed from the structure.
In the preceding structure, type should contain the same ...