On Mon, Jun 11 2018, Sergio Paracuellos wrote:

> Instead of create a custom irq_domain for this chip, use
> 'gpiochip_set_chained_irqchip' from GPIOLIB_IRQCHIP. It
> is ok to call this function several times. You only have to
> mark the line with 'IRQF_SHARED' and then loop over the
> three banks until you find a hit. There were some problems
> with removing an irqchip like that but this driver is a bool
> so it might work just fine. After this changes the functions
> 'mediatek_gpio_to_irq' is not needed anymore and also the
> 'gpio_irq_domain' field from the state container. Instead of
> use the custom irq domain in the irq handler use the associated
> domain from the gpio_chip in 'irq_find_mapping' function.
> Function 'mediatek_gpio_bank_probe' has been moved a it to the
> botton to have all the irq related functions together and avoid
> some forward declarations to resolve some symbols along the code.
>
> Signed-off-by: Sergio Paracuellos <sergio.paracuel...@gmail.com>

Thanks for this.
The patch has two problems.
1/ it doesn't compile unless CONFIG_GPIOLIB_IRQCHIP is selected.
  So we need "select GPIOLIB_IRQCHIP" in Kconfig

2/ The interrupt line has not been marked IRQF_SHARED.
 I cannot figure out how to mark it as IRQF_SHARED.
 If I hack the code so that mediatek_gpio_bank_probe()
 is only called for the first bank, then interrupt from
 that bank work fine.
 If I let it be called for all three banks, then on the first interrupt,
 the system starts to hang.

Thanks,
NeilBrown

Attachment: signature.asc
Description: PGP signature

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to