* @irq_startup: start up the interrupt (defaults to ->enable if NULL) * @irq_shutdown: shut down the interrupt (defaults to ->disable if NULL) * @irq_enable: enable the interrupt (defaults to chip->unmask if NUL
一个SPI设备会被转换为一个spi_device结构体,中断号会保存在spi_device的irq成员里,代码如下(drivers/spi/spi.c): 3.3. 调用of_irq_get获得中断号 如果你的设备节点既不能转换为platform_device,它也不是I2C设备,不是SPI设备,那么在驱动程序中可以自行调用of_irq_get函数去解析设备树,得到中断号。 3.4. 对于G...
int of_get_named_gpio(struct device_nodenp, const charpropname, int index); 提取irq属性API / of_irq_count从设备树中提取中断的数量 @np - 设备节点指针 成功:大于等于0,实际中断数量,0则表示没有中断 / int of_irq_count(struct device_nodedev); / of_irq_get- 从设备树中提取中断号 @np - ...
> IRQ编号可以通过irq_of_parse_and_map()获得(如您所述);此函数不仅返回IRQ号,还存储IRQ号的IRQ标志(最终通过调用irqd_set_trigger_type());存储的IRQ标志将在devm_request_irq()中自动使用,如果您没有向其传递IRQ触发器类型(例如,您可以传递flags = 0) > IRQ标志可以在irq_get_trigger_type()获得,但...
函数原型:int platform_get_irq(struct platform_device *dev, unsigned int num) 定义文件:drivers\base\platform.c 一、调用流程 中断号获取函数platform_get_irq()调用流程如下: platform_get_irq()-> of_irq_get()-> of_irq_parse_one() ## 解析dts中中断相关属性,填充结构体of_phandle_args中的args[...
of_irq_get() 调用of_irq_parse_one() 从dts中收集该中断的相关信息如触发方式,中断号,中断类型等信息并记录在oirq结构体中。然后调用irq_create_of_mapping()进行中断映射并返回软件中断号。 irq_create_of_mapping() => irq_create_fwspec_mapping()通过irq_domain_translate()调用 gic_of_init()过程中...
然后对应每一个irq 调用of_irq_to_resource() => of_irq_get() 获取软件中断号。of_irq_get() 调用of_irq_parse_one() 从dts中收集该中断的相关信息如触发方式,中断号,中断类型等信息并记录在oirq结构体中。然后调用irq_create_of_mapping()进行中断映射并返回软件中断号。
3.中断发生以后进入IRQ中断服务函数,IRQ的中断服务函数在irqTable里面查找具体的中断处理函数,找到以后执行相应的中断处理函数 Linux中断处理API函数 request_irq request_irq函数用于申请中断,但是可能会导致睡眠,因此不能在中断上下文或者其他禁止睡眠的代码段中使用request_irq函数。request_irq函数会使能中断,所以不需要我...
-> irq_of_parse_and_map(child,0);//将中断解析并映射到linux virq空间( -> of_node_get(child);//将OF节点与设备结构相关联 -> phy->dev.of_node = child; -> phy_device_register(phy)// 注册phy设备 ->if(phydev->bus->phy_map[phydev->addr])//判断PHY是否已经注册了 ...
of_get_parent函数 (内核源码/include/linux/of.h) 1 struct device_node *of_get_parent(const struct device_node *node) 参数: node: 指定谁(节点)要查找父节点。 返回值: device_node: device_node类型的结构体指针,保存获取得到的节点。同样,如果失败返回NULL。8.3...