Your references are good but lack a definition of what is a platform device. There is one on LWN. What we can learn from this page:
Platform driver is for those devices that are on chip.Not true (in theory, but true in practice). i2c devices are not onChip, but are platform devices because they are not discoverable. Also we can think of onChip devices which are normal devices. Example: an integrated PCI GPU chip on a modern x86 processor. It is discoverable, thus not a platform device. Normal device driver are for those that are interfaced to the processor chip. before coming across one i2c driver.Not true. Many normal devices are interfaced to the processor, but not through an i2c bus. Example: a USB mouse. [EDIT] In your case, have a look to drivers/usb/host/ohci-pnx4008.c ,
which is a USB host controller platform device (Here the USB host
controller is not discoverable, whereas USB devices, which will connect
to it, are). It is a platform device registered by the board file (arch/arm/mach-pnx4008/core.c:pnx4008_init ). And within its probe function, it registers its i2c device to the bus with i2c_register_driver . We can infer that the USB Host controller chipset talks to the CPU through an i2c bus.Why that architecture? Because on one hand, this device can be considered a bare i2c device providing some functionalities to the system. On the other hand, it is a USB Host capable device. It needs to register to the USB stack ( usb_create_hcd ). So probing only i2c will be insufficient. Have a look to Documentation/i2c/instantiating-devices . |
Thursday, 30 October 2014
platform device driver
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment