(in kernel file include/linux/platform_device.h, the platform_device struct is defined)
To enroll a device:
1. Register the platform device structure body platform_device s3c_device_leds_ctl in the kernel file arch/arm/mach-exynos/mach-itop4412.c
You need to define name, ID, and so on. In Platform_device *smdk4x12_device[] __initdata you need to define the S3C_DEVICE_LEDS_CTL
2. Ensure that the macro definition is defined in. config
3. Recompile
(in kernel file include/linux/platform_device.h, the int platform_driver_register (struct platform_driver *) function and void platform_ are defined) Driver_unregister (struct Platform_driver *) function for registering and uninstalling drivers)
Defines the platform_driver structure body
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; }
Drive Learning 4-Registering devices and drivers