Drive Learning 4-Registering devices and drivers

Source: Internet
Author: User

(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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.