Re: [[RFC PATCH]] gpio: gpio-mxc: make sure gpio is input when request IRQ
From: Linus Walleij <hidden>
Date: 2014-07-25 13:52:02
Also in:
linux-arm-kernel
On Fri, Jul 25, 2014 at 2:52 PM, Markus Niebel [off-list ref] wrote:
Am 25.07.2014 13:38, wrote Linus Walleij:
quoted
I don't know if it'd be a good idea to loop over all gpios in a new irqchip and fetch the direction just to get the flags right, so far we haven't done that and I don't know what the usecase would be.I've came to a situation where it would have been helpful to know - bootloader configured a pin as output and linux tried to configure the pin as IRQ input. *YES I KNOW THIS IS NOT CORRECT* but it took some time to see, what happened.
Hm, maybe we should call gpiod_get_direction() first in gpio_lock_as_irq(), so we check the hardware and know there that the flag is correctly set here?
quoted
If we need that we should do it in gpiolib for all drivers don't you think?A pragmatic / lean solution would be to deny the IRQ configuration when seeing the pin configured as output in hardware and print out an error on the gpio driver level.
I guess that is what I'm suggesting, not sure if I follow correctly. Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html