vonnyfly 发表于 2015-06-24 16:49

驱动里怎么设置低电平触发?不生效啊

Hi experts,

I have trouble about interrupt. I need low level trigger the interrupt. My control flow is that when data is less than a threshold, it needs keeping interrupt until data is supplied.

So I use the flag `IRQ_TYPE_LEVEL_LOW `, but it doesn’t work. I have also tried `IRQF_TRIGGER_LOW`, it also doesn’t work.

I have checked the hardware register, the interrupt GPIO is still `falling edges`, not `low level`.

My board is ARM S3C6410 tiny board.


221        /* inkprinter */
222        #define S3C64XX_PA_INKPRINTER (0x30000000)
223        #define S3C64XX_SZ_INKPRINTER SZ_1M
224        static struct resource inkprinter_resources[] = {
225                = {
226                        .start                = S3C64XX_PA_INKPRINTER,
227                        .end                = S3C64XX_PA_INKPRINTER + S3C64XX_SZ_INKPRINTER,
228                        .flags                = IORESOURCE_MEM,
229                },
230                = {
231                        .start                = IRQ_EINT(1),
232                        .end                = IRQ_EINT(1),
233                        .flags = IORESOURCE_IRQ | IRQ_TYPE_LEVEL_LOW,
234                }
235        };
236        static struct platform_device s3c_device_inkprinter = {
237                .name                        = "inkprinter",
238                .num_resources        = ARRAY_SIZE(inkprinter_resources),
239                .resource                = inkprinter_resources,
240        };
241


My question is :

Is `IRQ_TYPE_LEVEL_LOW ` or `IRQF_TRIGGER_LOW `for low level trigger? Or some other problem? Any tips?
Your response will be highly appreciated.

欢迎大家帮忙解答。

linuxlife123 发表于 2015-07-06 09:13

感觉还是老的定义方式,现在新的都是dts了。
我觉得原因可能是你request_irq的时候没有带IRQ_TYPE_LEVEL_LOW这个标记。

vonnyfly 发表于 2015-09-15 13:47

回复 2# linuxlife123
感谢!
后来发现是你说的问题,这里设置没什么大用。


   
页: [1]
查看完整版本: 驱动里怎么设置低电平触发?不生效啊