TL-WR1043: LEDs

Adrian Chadd adrian at freebsd.org
Tue Nov 29 00:32:05 UTC 2011


On 29 November 2011 06:12, Stefan Bethke <stb at lassitu.de> wrote:
> Here's a quick and dirty hack to use the ar71xx GPIO module to get the pin configuration from a hint.
>
> Add
>  device  gpio
>  device  gpioled
> to your kernel config to enable these.  See gpioctl(1) and led(4) for how to control them.  The buttons can be polled with gpioctl.

The trouble is that the gpio lines themselves are
hard-coded/enumerated in the chip specific gpio driver (eg
sys/mips/atheros/ar71xx_gpio.c).

ray@ and I have discussed fleshing out a way to use hints to enumerate:

* which gpio lines to configure;
* what their default "flavour" should be (in, out, pullup, pulldown, etc);

As well as cpu specific hints:

* chip specific gpio setup - ie, for CPUs whose GPIO pins share
functions, a way to configure a per-board function mask (since some
boards may disable things like USB and enable those as GPIO lines.)

That way we can fully customise what's going on through a kernel
configuration file and hints file, without having to patch the kernel
for different boards.

If someone would like to tackle the above generic GPIO hints stuff
(the LED code lets you define LED lines, but I couldn't figure out how
to do the same with the GPIO lines themselves) then we'll be in a much
better position to ship functional images. I really would like to be
able to ship functioning buttons on these units so I can enable
failover and WPS. :)

Thanks,


Adrian


More information about the freebsd-embedded mailing list