您的位置:首页 > 财经 > 金融 > platform框架

platform框架

2024/12/23 8:57:58 来源:https://blog.csdn.net/2302_77277624/article/details/141963109  浏览:    关键词:platform框架

platform框架

  • 注册设备进入总线
    • platform_device_register函数
  • 注册驱动进入总线
    • platform_driver_register函数

在这里插入图片描述

注册设备进入总线

platform_device_register函数

int platform_device_register(struct platform_device *pdev)

struct platform_device {const char	* name; 名字与驱动名一定要相同int		id;struct device	dev;u32		num_resources;struct resource	* resource;struct platform_device_id	*id_entry;/* arch specific additions */struct pdev_archdata	archdata;
};

#########

struct device {struct device		*parent;struct device_private	*p;struct kobject kobj;const char		*init_name;/* initial name of the device */struct device_type	*type;struct semaphore	sem;	/* semaphore to synchronize calls to* its driver.*/struct bus_type	*bus;		/* type of bus device is on */struct device_driver *driver;	/* which driver has allocated thisdevice */void		*platform_data;	/* Platform specific data, devicecore doesn't touch it */struct dev_pm_info	power;#ifdef CONFIG_NUMAint		numa_node;	/* NUMA node this device is close to */
#endifu64		*dma_mask;	/* dma mask (if dma'able device) */u64		coherent_dma_mask;/* Like dma_mask, but foralloc_coherent mappings asnot all hardware supports64 bit addresses for consistentallocations such descriptors. */struct device_dma_parameters *dma_parms;struct list_head	dma_pools;	/* dma pools (if dma'ble) */struct dma_coherent_mem	*dma_mem; /* internal for coherent memoverride *//* arch specific additions */struct dev_archdata	archdata;dev_t			devt;	/* dev_t, creates the sysfs "dev" */spinlock_t		devres_lock;struct list_head	devres_head;struct klist_node	knode_class;struct class		*class;const struct attribute_group **groups;	/* optional groups */void	(*release)(struct device *dev);
};

注册驱动进入总线

platform_driver_register函数

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com