????Linux2.6?????????????????μ??豸???????-??(platform)?豸?????????豸??????????豸(platform_device)????????(platform_driver)?????豸?????????Linux?豸????????????????
??????????豸
???????豸???壺
1 struct platform_device {
2     const char    * name;                      /* ?豸?? */
3     int        id;
4     struct device    dev;                     /* ?豸???? */
5     u32        num_resources;                   /* ?豸??????? */
6     struct resource    * resource;              /* ?豸??? */
7
8     const struct platform_device_id    *id_entry;
9
10     /* arch specific additions */
11     struct pdev_archdata    archdata;
12 };
???????豸????????豸????????????????????resource??豸??????飬??????IORESOURCE_IO??IORESOURCE_MEM??IORESOURCE_IRQ??IORESOURCE_DMA??IORESOURCE_DMA???????????????о?DM9000???????????
1 static struct resource dm9000_resources[] = {
2     [0] = {
3         .start        = S3C64XX_PA_DM9000??
4         .end        = S3C64XX_PA_DM9000 + 3??
5         .flags        = IORESOURCE_MEM??
6     }??
7     [1] = {
8         .start        = S3C64XX_PA_DM9000 + 4??
9         .end        = S3C64XX_PA_DM9000 + S3C64XX_SZ_DM9000 - 1??
10         .flags        = IORESOURCE_MEM??
11     }??
12     [2] = {
13         .start        = IRQ_EINT(7)??
14         .end        = IRQ_EINT(7)??
15         .flags        = IORESOURCE_IRQ | IRQF_TRIGGER_HIGH??
16     }??
17 };
????dm9000_resources???????????豸???????????IORESOURCE_MEM????????????????????????????S3C64XX_PA_DM9000????????S3C64XX_PA_DM9000 + 3???????????IORESOURCE_MEM????????????????????????????S3C64XX_PA_DM9000 + 4????????S3C64XX_PA_DM9000 + S3C64XX_SZ_DM9000 - 1?????????IORESOURCE_IRQ???????????ж???IRQ_EINT(7)??
1 struct device {
2     struct device        *parent;
3
4     struct device_private    *p;
5
6     struct kobject kobj;
7     const char        *init_name; /* initial name of the device */
8     struct device_type    *type;
9
10     struct mutex        mutex;    /* mutex to synchronize calls to
11                      * its driver.
12                      */
13
14     struct bus_type    *bus;        /* type of bus device is on */
15     struct device_driver *driver;    /* which driver has allocated this
16                        device */
17     void        *platform_data;    /* Platform specific data?? device
18                        core doesn't touch it */
19     ...
20 };
????struct device???????????????????platform_data?????????豸????????????????????????????