Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Nov 2011 08:32:03 +0800
From:      Adrian Chadd <adrian@freebsd.org>
To:        Stefan Bethke <stb@lassitu.de>
Cc:        freebsd-embedded@freebsd.org
Subject:   Re: TL-WR1043: LEDs
Message-ID:  <CAJ-Vmo=Vo72MQXNReRSrh92OgCHKh0mWhjydFXMvOGKzWrb_ww@mail.gmail.com>
In-Reply-To: <E612E671-6F2A-49A3-BF5D-A80FEF8AA583@lassitu.de>
References:  <E612E671-6F2A-49A3-BF5D-A80FEF8AA583@lassitu.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On 29 November 2011 06:12, Stefan Bethke <stb@lassitu.de> wrote:
> Here's a quick and dirty hack to use the ar71xx GPIO module to get the pi=
n configuration from a hint.
>
> Add
> =A0device =A0gpio
> =A0device =A0gpioled
> to your kernel config to enable these. =A0See gpioctl(1) and led(4) for h=
ow to control them. =A0The 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-Vmo=Vo72MQXNReRSrh92OgCHKh0mWhjydFXMvOGKzWrb_ww>