Linux-powered platform devices

Source: Internet
Author: User

A platform Subsystem

1. Description of the platform device

struct Platform_device {
const char* name; Device Name
IntID -1
struct Devicedev; General Equipment Description
U32num_resources; Number of resources
struct resource* resource;//Resources

If the match succeeds in the id_table of driver, Id_entry will record the id_table match.
const struct Platform_device_id*id_entry;

/* Arch Specific additions */
struct pdev_archdataarchdata;//private data for platform devices
};

2. Description of the platform driver

struct Platform_driver {
Int (*probe) (struct platform_device *); Call when the driver matches the device
Int (*remove) (struct platform_device *);//The drive is disconnected from the device when called
struct Device_driver driver;//General driver description
const struct PLATFORM_DEVICE_ID *id_table;//support device
};

struct Device_driver
{
Const Char*name; Drive name
struct Module*owner;//this_module
...
}

3. Register platform Driver

int Platform_driver_register (struct platform_driver *drv);

4. Registration platform Set up

int Platform_device_register (struct platform_device *pdev);


5. Platform device and platform driver matching process
[1] Through the name of the device with the driving id_table + drive name
[2] Match success
[1] In device record matching drive
[2] Calling the probe function provided by the driver

Linux-powered platform devices

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.