Hi Maxime,

I'm busy using the mechanism Calzo and you have been figuring out to
work with the interrupt of an IO expander, in stead of polling it.

So far, the mechanism goes quite well, but from time to time I get
problems with the interrupt, due to contact bounce.

What I did was looking into your code and I have the following question:

In the function below, you want to clear the interrupt mask, but still
you're setting the content of the register R_IRQ_MASK1_SET to 0x01.
Should that not be the register R_IRQ_MASK1_CLR instead?

I think only then you're clearing the interrupt.

--- In [email protected], "maxime_coquelin"
<[EMAIL PROTECTED]> wrote:
>
> static ssize_t my_read_function(struct file *filp, char *buf, size_t
> count, loff_t *ppos)
>       {
>       // Démasquage de l'interruption
>       // Clear the interrupt mask
>       *R_IRQ_MASK1_SET = IRQ_PA_MASK; 
> 
>       // Mise en sommeil du processus effectuan le read()
>       // Process which do the read() is aslept.
>       wait_event_interruptible(wq, flag != 0);
>       flag = 0;
> 
>       return 0;
>       }

Best rgds,

--Geert

Reply via email to