1 in order to realize the separation of device and drive, Linux introduced the platform model . Devices that use the model are typically devices that cannot be "discovered" (it is not enumerated like USB,PCI), such as I2C,SPI devices. For platform devices, we must have a clear understanding of their addresses.
Excerpt from: Kernel-xxx\documentation\driver-model\platform.txt
as in the system. This includes legacy port-based devices andhost bridges to peripheral buses, and most controllers Integratedinto Syste M-on-chip platforms. inch Common is from a CPU bus. Rarely, a platform_device willbe connected through a segment of some other kind of bus; But itsregisters'll still be directly addressable.
2 platform Devices are usually important devices in the system, and they are registered and loaded as early as the system starts, such as a power management chip.
3 platform devices usually have IO configuration, power management and other requirements. As mobile devices running the Linux kernel increase, power management becomes increasingly important.
4 platform device and drivers through the name to binding, of course, we follow the first registration device, then register the driver order.
struct Platform_device { constchar *name; U32 ID; struct device Dev; U32 num_resources; struct Resource *resource;};
structPlatform_driver {int(*probe) (structPlatform_device *); int(*remove) (structPlatform_device *); void(*shutdown) (structPlatform_device *); int(*suspend) (structPlatform_device *, pm_message_t State); int(*resume) (structPlatform_device *); structDevice_driver driver; Const structPLATFORM_DEVICE_ID *id_table;};//No Name? Then look down.structDevice_driver {Const Char* name; structBus_type *bus; structModule *owner; Const Char*mod_name;/*used for built-in modules*/ BOOLSuppress_bind_attrs;/*disables Bind/unbind via Sysfs*/ Const structOF_DEVICE_ID *of_match_table; Const structACPI_DEVICE_ID *acpi_match_table; int(*probe) (structDevice *Dev); int(*remove) (structDevice *Dev); void(*shutdown) (structDevice *Dev); int(*suspend) (structDevice *Dev, pm_message_t State); int(*resume) (structDevice *Dev); Const structAttribute_group * *groups; Const structDev_pm_ops *pm; structDriver_private *p;};
What is platform device?