struct resource *platform_get_resource(struct platform_device *dev,unsigned int type, unsigned int num); // 通过类型和名称获取资源 // 参数3:获取资源的名称 struct resource * platform_get_resource_byname(struct platform_device * dev,unsigned int type,const char * name); // 通过编号获取中断资源...
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 ...
probe()总应该核实指定的设备硬件确实存在;平台设置代码有时不能确定这一点. 枚举(probing)可以使用的设备资源包括时钟及设备的platform_data.(译注: platform_data定义在device.txt中的"基本设备结构体"中.) 平台驱动通过普通的方法注册自身 int platform_driver_register(struct platform_driver *drv); 或者, 更常...
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; ...
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); ...
platform_device resource platform_driver platform_device结构体用来描述设备的名称、资源信息等。该结构被定义在include/linux/platform_device.h中,定义原型如下: 17 struct platform_device { 18 const char * name;//设备名 19 int id;//设备编号,配合设备名使用 ...
structresource*res1,res2res1=platform_get_resource_byname(pdev,IORESOURCE_MEM,"config");structdma_chan*dma_chan_rx;dma_chan_rx=dma_request_slave_channel(&pdev->dev,"rx");inttxirqtxirq=platform_get_irq_byname(pdev,"ehci");structclk*clk_per;clk_per=devm_clk_get(&pdev->dev,"per")...
platform_device结构体用来描述设备的名称、资源信息等。该结构被定义在include/linux/platform_device.h中,定义原型如下: struct platform_device { const char * name; //定义平台设备的名称 int id; struct device dev; u32 num_resources; struct resource * resource; //定义平台设备的资源。
_MEM, "control"); fmc->regbase = devm_ioremap_resource...regbase); res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "memory"); fmc->iobase = devm_ioremap_resource...(dev, res); if (IS_ERR(fmc->iobase)) return PTR_ERR(fmc->iobase); fmc->clk = devm_clk_get...