platform.c
platform_bus_init()
{
清理老的资源
注册device platform_bus
注册bus platform_bus
}
platform_driver_register()
{
填充platform_drv_probe,platform_drv_remove,platform_drv_shutdown
注册device_driver
获取platform_driver,platform_device
acpi操作
调用platform_driver -> probe 例如 s3c24xx_spi_probe,at91_adc_probe
{
调用platform_device_register()
}
platform_device_register()
{
初始化各种锁,队列
调用platform_device_add()
}
platform_device_add()
{
填充platform_device
注册device
}
{
查是否已经注册
挂到bus上去
添加驱动组
触发uevent
platform_bus_init()
{
清理老的资源
注册device platform_bus
注册bus platform_bus
}
platform_driver_register()
{
填充platform_drv_probe,platform_drv_remove,platform_drv_shutdown
注册device_driver
}
platform_drv_probe()
{获取platform_driver,platform_device
acpi操作
调用platform_driver -> probe 例如 s3c24xx_spi_probe,at91_adc_probe
}
{
调用platform_device_register()
}
platform_device_register()
{
初始化各种锁,队列
调用platform_device_add()
}
platform_device_add()
{
填充platform_device
注册device
}
driver.c
{
查是否已经注册
挂到bus上去
添加驱动组
触发uevent
}
core.c
device_register()
{
简要初始化device
调用 device_add()
}
device_add()
{
各种初值判断
获取 parent device
创建父子联系
通知平台
创建设备文件
device_add_class_symlinks
device_add_attrs
bus_add_device
dpm_sysfs_add
device_pm_add
blocking_notifier_call_chain
kobject_uevent
bus_probe_device
klist_add_tail
跟class创建联系
}
bus.c
bus_probe_device()
{
调用device_attach
与subsys_interface创立连接
}
dd.c
device_attach()
{
__device_attach() -> driver_probe_device -> really_probe -> dev->bus->probe(dev) | drv->probe(dev)
}