October 2017
Intermediate to advanced
586 pages
14h 8m
English
Any other data whose type is not a part of the resource types enumerated in the preceding section falls here (for example, GPIO). Whatever their type is, the struct platform_device contains a struct device field, which in turn contains a struct platform_data field. Usually, you should embed that data in a structure and pass it to the platform_device.device.platform_data field. Let's say, for example, that you declare a platform device that needs two GPIO numbers as platform data, one IRQ number, and two memory regions as resources. The following example shows how to register platform data along with the device. Here, we use the platform_device_register(struct platform_device *pdev) function, which you use to register a platform ...