devm_platform_ioremap_resource_byname(struct platform_device *pdev, const char *name); extern int platform_get_irq(struct platform_device *, unsigned int); platform_device_register、platform_device_unregister,Platform设备的注册/注销接口,和底层的device_register等接口类似。 arch_setup_pdev_archdata,设...
structplatform_device{constchar*name;// 设备名称intid;// 设备号boolid_auto;structdevicedev;u32 num_resources;structresource*resource;conststructplatform_device_id*id_entry;char*driver_override;/* Driver name to force a match *//* MFD cell pointer */structmfd_cell*mfd_cell;/* arch specific ...
int (*probe)(struct platform_device *); int (*remove)(struct platform_device *); void (*shutdown)(struct platform_device *); int (*suspend)(struct platform_device *, pm_message_t state); int (*resume)(struct platform_device *); struct device_driver driver; const struct platform_device...
Linux中大部分的设备驱动,都可以使用这套机制,设备用platform_device表示,驱动用platform_driver进行注册。 Linux platform. driver机制和传统的device driver 机制(通过driver_register函数进行注册)相比,一个十分明显的优势在于platform机制将设备本身的资源注册进内核,由内核统一管理,在驱动程序中使用这些资源时通过platform...
platform_device结构体用来描述设备的名称、资源信息等。该结构被定义在include/linux/platform_device.h中,定义原型如下: struct platform_device { const char * name; //定义平台设备的名称 int id; struct device dev; u32 num_resources; struct resource * resource; //定义平台设备的资源。
1: /* include/linux/platform_device.h, line 22 */ 1. 2: struct platform_device { 1. 3: const char *name; 1. 4: int id; 1. 5: bool id_auto; 1. 6: struct device dev; 1. 7: u32 num_resources; 1. 8: struct resource *resource; ...
int platform_get_irq(struct platform_device *dev, unsigned int num) 通过名字(name)返回该dev 的某类型(type)资源: struct resource *platform_get_resource_byname(struct platform_device *dev,unsigned int type,const char *name) 通过名字(name)返回该 dev 的中断号: ...
extern int platform_get_irq_byname(struct platform_device *, char *); extern int platform_add_devices(struct platform_device **, int); extern struct platform_device *platform_device_register_simple(char *, unsigned int, struct resource *, unsigned int); ...
struct resource * platform_get_resource(struct platform_device *dev, unsigned int type, unsigned int num); 根据参数type所指定类型,例如IORESOURCE_MEM,来获取指定的资源。 struct int platform_get_irq(struct platform_device *dev, unsigned int num); ...
platform.c导出了一系列内核全局操作接口集: EXPORT_SYMBOL_GPL(platform_bus);EXPORT_SYMBOL_GPL(__platform_driver_register);EXPORT_SYMBOL_GPL(__platform_driver_probe);EXPORT_SYMBOL_GPL(platform_get_resource_byname);EXPORT_SYMBOL_GPL(platform_get_irq_byname);... 那么...