GPIO interrupts on Carambola2
Luiz Otavio O Souza
lists.br at gmail.com
Thu May 8 00:47:38 UTC 2014
On 7 May 2014 16:48, Sebastian Zietz wrote:
> Hi all,
>
> since I am not much into device driver programming jet I hope you can help me with my problem. I have a hardware button on GPIO pin 22 and can’t generate interrupts on it. In sys/mips/atheros/ar71xx_gpio.c I’d like to do something like:
>
> 331 static void
> 332 ar71xx_gpio_intr(void *arg)
> 333 {
> 334 struct ar71xx_gpio_softc *sc = arg;
> 335 GPIO_LOCK(sc);
> 336 /* TODO: something useful */
> 337 devctl_notify("GPIO", "pin22", "notify", NULL);
> 338 GPIO_UNLOCK(sc);
> 339 }
>
>
> To get it working I tried this without success:
>
> 410 /* Configure all pins as input */
> 411 /* disable interrupts for all pins */
> 412 GPIO_WRITE(sc, AR71XX_GPIO_INT_MASK, 0);
> 413 GPIO_WRITE(sc, AR71XX_GPIO_INT_MASK, (1 << 22));
>
>
> I didn’t managed to come up with pin 22 as input either. I am thankful for any help!
Sebastian,
I'm adding GPIO interrupt support and ar71xx is one of my reference
platforms so this should be working soon.
I'm using kqueue to delivery the interrupt notification to userland,
but eventually i'll also support devctl_notify().
The patch(es) should be posted soon now.
Luiz
More information about the freebsd-embedded
mailing list