From: Magnus D. <mag...@gm...> - 2007-08-14 10:45:36
|
On 8/14/07, Paul Mundt <le...@li...> wrote: > On Mon, Aug 13, 2007 at 11:49:21AM +0900, Magnus Damm wrote: > > On 8/10/07, EXTERNAL Brunner Markus (Praktikant; ST-FIR/Eng) > > <ext...@de...> wrote: > > > It was caused by the smc911x driver it requested the irq with > > > IRQF_TRIGGER_FALLING and overwrote my settings in the board setup. > > > After changing this to LOW it worked. > > > > I wonder if it would make sense to extend the interrupt api to provide > > a bitmap of all supported sense configurations supported by the > > driver... That way the driver would tell the interrupt controller > > which configurations it supports and it's up to the interrupt > > controller pick one of them. Then the driver reads back which > > configuration that was selected by the interrupt controller and sets > > up the hardware it controls accordingly. > > > > Or maybe that is too complicated, I'm not sure. But the current > > framework seems a bit too limited IMO, especially if the interrupt > > controller only supports a certain sense configuration. > > > > The best solution may be the other way around though, where the > > interrupt controller provides a bitmap of supported sense > > configurations that the driver may choose from... > > > The current API works fine for this. the trigger flag is going to be > board-specific in the terms of most drivers, and conventional wisdom > dictates that the pin said peripheral's interrupt line is connected to is > able to do sense selection based on what the peripheral mandates. > > There are of course cases where folks take edge-triggered devices and > plug them in to a level-only line or some combination thereof, but that's > not an API problem. The driver already has to know at request_irq() time > what trigger type it requires. How do we handle the case when say an ethernet controller can be configured as either edge or level, but the stupid FPGA interrupt controller only does only support one of them? The driver for the ethernet controller is of course totally disconnected from the interrupt controller code. But the ethernet controller hardware does support both edge and level triggered interrupts - just configure a certain register to switch mode. Can we handle that today? I don't have a use case for this atm, so it's purely academic... / magnus |