October 2017
Intermediate to advanced
586 pages
14h 8m
English
This match style has been around for a long time, and is based on the struct device_id structure. All device ID structures are defined in include/linux/mod_devicetable.h. To find the right structure name, you need to prefix device_id with the bus name your device driver sits on. Examples are struct i2c_device_id for I2C, struct platform_device_id for platform devices (which don't sit on a real physical bus), spi_device_id for SPI devices, usb_device_id for USB, and so on. The typical structure of a device_id table for a platform device is as follows:
struct platform_device_id {
char name[PLATFORM_NAME_SIZE];
kernel_ulong_t driver_data;
};
Anyway, if an ID table is registered, it will be walked through whenever the kernel ...