Hello,
I am trying to control the ADP558 device using your linux driver:
https://wiki.analog.com/resources/tools-software/linux-drivers/input-keyboard/adp5588
As you know the GPIO sysfs is deprecated now and the right way to access is through the GPIO char device. I want to request a GPIO interrupt using the gpio-event-mon.c tool under /linux/tools/gpio: https://github.com/torvalds/linux/blob/master/tools/gpio/gpio-event-mon.c
The problem is that when i try to use this tool in the driver is followed the next sequence:
[ 4594.022049] adp5588 1-0020: adp5588_gpio_direction input is called
[ 4594.032877] adp5588 1-0020: adp5588_irq_bus_lock is called
[ 4594.043672] adp5588 1-0020: adp5588_irq_bus_sync_unlock is called
[ 4594.066650] adp5588 1-0020: adp5588_irq_bus_lock is called
[ 4594.072008] adp5588 : adp5588_irq_set_type is called
[ 4594.077328] adp5588 : adp5588_irq_unmask is called
[ 4594.083673] adp5588 1-0020: adp5588_irq_bus_sync_unlock is called
My doubt is:
Why the irq_unmask() callback function is called after the irq_bus_sync_unlock() one when the gpio char device access trhough the tool is used? Checking your driver the unmask of the GPIO interrupt is done in the irq_unmask() function. If irq_unmask() is called after irq_bus_sync_unlock(), then the unmask value is not transmitted to the device through I2C via the irq_bus_sync_unlock() function.
To make the interrupts work I should unmask the gpio interrupt in the irq_bus_sync_unlock() function so that the interrupt is launched. Am i right? Could you take a look to this?
Thanks
Alberto