Re: [PATCH v2 1/2] gpio: max77620: Initialize interrupts state

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 8, 2020 at 6:58 PM Dmitry Osipenko <digetx@xxxxxxxxx> wrote:
>
> I noticed on Nexus 7 that after rebooting from downstream kernel to
> upstream, the GPIO interrupt is triggering non-stop despite of interrupts

despite interrupts

> being disabled for all of GPIOs. This happens because Nexus 7 uses a
> soft-reboot, meaning that bootloader should take care of resetting
> hardware, but bootloader doesn't do it well. In a result, GPIO interrupt

but the bootloader

As a result

> may be left ON at a boot time. Let's mask all GPIO interrupts at the
> driver's initialization time in order to resolve the issue.

...

>         mgpio->gpio_chip.ngpio = MAX77620_GPIO_NR;
>         mgpio->gpio_chip.can_sleep = 1;
>         mgpio->gpio_chip.base = -1;
> +       mgpio->gpio_chip.irq.init_hw = max77620_gpio_irq_init_hw,

Now this seems a bit awkward. Perhaps you need first to switch to use
GPIO IRQ chip structure?
It's also in the TODO of the GPIO subsystem ;-)

...

>  #ifdef CONFIG_OF_GPIO
>         mgpio->gpio_chip.of_node = pdev->dev.parent->of_node;
>  #endif

This seems to be done by GPIO library.

Also point to improve: don't shadow error from platform_get_irq().

-- 
With Best Regards,
Andy Shevchenko



[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux