October 2017
Intermediate to advanced
586 pages
14h 8m
English
In the previous section, we used platform_device_id.platform_data as a pointer. Your driver may need to support more than one device type. In this situation, you will need specific device data for each device type you support. You should then use the device ID as an index to an array that contains every possible device data, and not as a pointer address anymore. The following are detailed steps in an example:
enum abx80x_chip {
AB0801,
AB0803,
AB0804,
AB0805,
AB1801,
AB1803,
AB1804,
AB1805,
ABX80X
};
struct abx80x_cap {
u16 pn;
bool has_tc;
};
Read now
Unlock full access