5.5.2. How does it all fit together?
Simplified example:- 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
- bus driver detects devices:
- statically by platform code
- during bus driver initalization
- when a device is hotplugged
- somewhere during startup some drivers get loaded
- bus driver tries to match when new drivers or devices appear
- matching:
- driver usually exports table of handled devices
- matching is bus dependant, can not be implemented generically
- no match && hotplugging enabled:
- old: setup environment and call hotplug function (/proc/sys/kernel/hotplug)
- today: udev/udevd handles this
- try to autoload / modprobe correct module
- if success retry matching
- if match:
- call driver probe() function:
- if < 0: failure
- if >= 0: ok, driver is bound to device
- call driver probe() function:
5.5.1. Driver model and sysfs | 1. Denx Training Topics | 5.5.3. Driver model and flattened device tree | |||
Prev | Home | Next | |||