(struct tdm_clock *)(TDM_CLKREG_OFFSET + (u8 *)priv->tdm_regs);/* irqs mapping for tdm err/dmac err, dmac done */priv->tdm_err_intr =irq_of_parse_and_map(ofdev->node,0);if(priv->tdm_err_intr == NO_IRQ) { ret = -EINVAL;gotoerr_tdmerr_irqmap; } priv->dmac_done_intr...
1.驱动框架 2.常用通过设备树获取信息的of函数 3.驱动io模型(用一个常用的poll非阻塞,仅实现read) 4.添加锁,添加中断(暂不加timer软中断的按键滤波,无需下半部的work thread)。 只有read+中断。那么需求互斥锁进行write同步了。只要原子锁即可。 一,驱动加载完,app运行正确 image.png //设备树applekey{compatib...
i2c_dev->irq = irq_of_parse_and_map(np,0);if(!i2c_dev->irq) { dev_err(&pdev->dev,"irq missing or invalid\n");return-EINVAL; } i2c_dev->clk = of_clk_get(np,0);if(IS_ERR(i2c_dev->clk)) { dev_err(&pdev->dev,"unable to request clock\n");returnPTR_ERR(i2c_dev->...
The irq_of_parse_and_map() returns 0 on failure, not a negative ERRNO. Fixes: f48e699 ("irqchip/aspeed-i2c-ic: Add I2C IRQ controller for Aspeed") Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore....
irq = irq_of_parse_and_map(node,0);if(!irq) panic("Failed to get INTC IRQ");if(of_address_to_resource(node,0, &res)) panic("Failed to get intc memory range");if(request_mem_region(res.start, resource_size(&res), res.name) <0) ...
virq = irq_of_parse_and_map(dn,0);if(virq == NO_IRQ)continue; printk(KERN_INFO"%s : hooking up to IRQ %d\n", dn->full_name, virq);irq_set_handler_data(virq, mpic); irq_set_chained_handler(virq, cell_mpic_cascade); ...
virq = irq_of_parse_and_map(dn,0);if(virq == NO_IRQ)continue; printk(KERN_INFO"%s : hooking up to IRQ %d\n", dn->full_name, virq); set_irq_data(virq, mpic);set_irq_chained_handler(virq, cell_mpic_cascade); }
bgf_irq_num = irq_of_parse_and_map(node,0);/* get the interrupt line behaviour */if(of_property_read_u32_array(node,"interrupts", irq_info, ARRAY_SIZE(irq_info))) { WMT_PLAT_ERR_FUNC("get irq flags from DTS fail!!\n");returniret; ...
irq = irq_of_parse_and_map(np, i); combiner_init_one(&combiner_data[i], i, combiner_base + (i >>2) *0x10, irq); combiner_cascade_irq(&combiner_data[i], irq); } } 开发者ID:AK101111,项目名称:linux,代码行数:29,代码来源:exynos-combiner.c ...
irq_map[cpuid].irq_act.dev_id = clk;irq_set_affinity(clk->irq, clk->cpumask); clockevents_config_and_register(clk, CLOCK_TICK_RATE_32KHZ, MIN_DELTA, MAX_DELTA); enable_irq(clk->irq);/* the broadcast clockevent is no longer needed */if(cpuid ==0) { ...