1 thought on “How to play platoform”

  1. Platform's soul is: Device (device) Driver (drive) Platform_bus (Platform bus), which is characterized by equipment, driving layered dynamic management and loading When registering to the virtual bus (kernel), if the device is the driver's device, the driver is the driver of the device. When they register, they will find each other I played after finding it). The process of finding this is done by Platform_bus, and we will be looking for for the time being. If the name string in Device and Driver wants the same
    platform_bus, you will call the .probe function in the driver. This process that matches the probe is automatically completed. This process starts from registration. The relationship between the device and the driver from the end of the PROBE is more to one -to -one, that is, multiple same devices can use one driver, which is different from the ID number in Device
    Platform In fact, the use is four steps:
    1) Initialize the Resource structure variable
    2) initialization of PLATFORM_DEVICE structure variable
    3) Register to the system: Platform_device_register.
    4) Want system registration driver: [platform_driver_register ()]
    The method of copying after logging in
    Drvier and Device: Looking for matching Driver on the bus. Platform device is generally registered when the system starts very early
    * When a driver register [Platform_driver_register ()], he will traverse all the devices on all bus to find matching. The registration of the startup process is generally late, or when the module is loaded
    * When a driver register [Platform_driver_probe ()], the function is the same as using Platform_driver_register (). The only difference is it. Can't be probice in the future, that is to say, this Driver can only bind
    eg: Define a driver

Leave a Comment