Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 May 2014 21:47:36 -0300
From:      Luiz Otavio O Souza <lists.br@gmail.com>
To:        Sebastian Zietz <mail@sezi.eu>
Cc:        freebsd-embedded <freebsd-embedded@freebsd.org>
Subject:   Re: GPIO interrupts on Carambola2
Message-ID:  <CAB=2f8wjokHoYF6URLmDuf6nVLrQnD6byGuv4CBCEFbCy3nyNQ@mail.gmail.com>
In-Reply-To: <1A78D43F-9406-4DAB-8554-D8802DE8A3E1@sezi.eu>
References:  <1A78D43F-9406-4DAB-8554-D8802DE8A3E1@sezi.eu>

next in thread | previous in thread | raw e-mail | index | archive | help
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 hel=
p me with my problem. I have a hardware button on GPIO pin 22 and can=E2=80=
=99t generate interrupts on it. In sys/mips/atheros/ar71xx_gpio.c I=E2=80=
=99d like to do something like:
>
> 331 static void
> 332 ar71xx_gpio_intr(void *arg)
> 333 {
> 334         struct ar71xx_gpio_softc *sc =3D 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=E2=80=99t managed to come up with pin 22 as input either. I am tha=
nkful 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAB=2f8wjokHoYF6URLmDuf6nVLrQnD6byGuv4CBCEFbCy3nyNQ>