Skip to main content.

5.5.2. How does it all fit together?

Simplified example:

  1. bus driver is loaded (Platform, USB, PCI...)
    • knows how to match devices and drivers
    • usually knows how to detect a device on the bus
    • maybe generates hotplug events for userspace
  2. bus driver detects devices:
    • statically by platform code
    • during bus driver initalization
    • when a device is hotplugged
  3. somewhere during startup some drivers get loaded
    • bus driver tries to match when new drivers or devices appear
  4. matching:
    • driver usually exports table of handled devices
    • matching is bus dependant, can not be implemented generically
    • no match && hotplugging enabled:
      • setup environment
      • call hotplug function (/proc/sys/kernel/hotplug)
      • try to autoload / modprobe correct module
      • if success retry matching
  5. if match:
    • call driver probe() function:
      • if == 0: failure
      • if > 0: ok, driver is bound to device
5.5.1. Driver model and sysfs 1. Denx Training Topics 5.5.3. Driver model and flattened device tree
Prev Home Next