Dear Igor,
The interrupt-cells property is already configured for the GPIO contoller's output pins, and yet no expected results.
So we resorted to using the SYSFS way again. So we made a try as to somehow use the existing platform code which is available for level triggering (in gpio-mxc.c, gpio_set_irq_type()) through gpliolib by routing the code flow of edge configuration (i.e. /sys/class/gpio/<gpionum>/edge) to the level trigger configuration code flow.
- i.e. the below code is getting executed every time before the system goes to suspend mode so that the GPIO line would act as wake input:
gpio_set_irq_type()
{
switch (type) {
case IRQ_TYPE_EDGE_RISING:
//edge = GPIO_INT_RISE_EDGE;
edge = GPIO_INT_LOW_LEV;
…
…
if (edge != GPIO_INT_BOTH_EDGES) {
reg += GPIO_ICR1 + ((gpio_idx & 0x10) >> 2); /* lower or upper register */
bit = gpio_idx & 0xf;
val = readl(reg) & ~(0x3 << (bit << 1));
writel(val | (edge << (bit << 1)), reg);
}
writel(1 << gpio_idx, port->base + GPIO_ISR);
return 0;
}
Now level triggering works but the problem is that the ISR (mxc_gpio_irq_handler) runs repeatedly as a tight loop so long as the level is there so other things are getting affected badly and the system become unusable.
Could you please give us guidance as to how to make this level triggering feature usable?
Please help. Thanks.
-
Ayana