Skip to Content
Linux Device Drivers Development
book

Linux Device Drivers Development

by John Madieu
October 2017
Intermediate to advanced
586 pages
14h 8m
English
Packt Publishing
Content preview from Linux Device Drivers Development

Instantiating I2C devices in the board configuration file (old and deprecated way)

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Linux Device Drivers, Second Edition

Linux Device Drivers, Second Edition

Jonathan Corbet, Alessandro Rubini
Linux Device Drivers, 3rd Edition

Linux Device Drivers, 3rd Edition

Jonathan Corbet, Alessandro Rubini, Greg Kroah-Hartman

Publisher Resources

ISBN: 9781785280009Supplemental Content