mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-23 23:42:32 +00:00
gpio_drv: mask IRQ until it is acknowledged
When working with GPIO interrupts on i.MX6SX for Ethernet PHYs it became obvious that the GPIO driver repeatedly receives interrupts for the same event, because it acknowledges the interrupt before a client has handled the event. Ref #2750
This commit is contained in:
parent
f653be1ebc
commit
7949c194e9
@ -49,8 +49,10 @@ class Imx_driver : public Gpio::Driver
|
||||
|
||||
for(unsigned i = 0; i < MAX_PINS; i++) {
|
||||
if ((status & (1 << i)) && _irq_enabled[i] &&
|
||||
_sig_cap[i].valid())
|
||||
_sig_cap[i].valid()) {
|
||||
Genode::Signal_transmitter(_sig_cap[i]).submit();
|
||||
_reg.write<Gpio_reg::Int_mask>(0, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -113,6 +115,7 @@ class Imx_driver : public Gpio::Driver
|
||||
void ack_irq(int pin)
|
||||
{
|
||||
_reg.write<Gpio_reg::Int_stat>(1, pin);
|
||||
if (_irq_enabled[pin]) _reg.write<Gpio_reg::Int_mask>(1, pin);
|
||||
}
|
||||
|
||||
void sigh(int pin, Genode::Signal_context_capability cap) {
|
||||
|
Loading…
Reference in New Issue
Block a user