From owner-freebsd-embedded@FreeBSD.ORG Tue Nov 29 00:32:05 2011 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 209DA1065673 for ; Tue, 29 Nov 2011 00:32:05 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id CD7A08FC08 for ; Tue, 29 Nov 2011 00:32:04 +0000 (UTC) Received: by vcbfk1 with SMTP id fk1so5480113vcb.13 for ; Mon, 28 Nov 2011 16:32:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Qx6EQ8CGD7lToI0IZ814fEEv5gMVyZehiPsR0qCo8Mo=; b=i52C3vcV4IN+C0Yfxe6q0x5jXuJ5XvE7bJy0wjG4XOVk+RpfTDCrrXjPG1ePE6SNPl c13XIfnostDsLOKU9y/px+KrRvkEoT6BLqIZkOBMFAw5wZFGIwO7q2VS2t3E34CAuPoE 6oH+mL22fkiHUJc8YgpGqnZeLevIfv/hfrIhU= MIME-Version: 1.0 Received: by 10.220.108.197 with SMTP id g5mr5252988vcp.44.1322526723528; Mon, 28 Nov 2011 16:32:03 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.52.186.74 with HTTP; Mon, 28 Nov 2011 16:32:03 -0800 (PST) In-Reply-To: References: Date: Tue, 29 Nov 2011 08:32:03 +0800 X-Google-Sender-Auth: k68mvScBSpVGAZORlGqfBVswSCE Message-ID: From: Adrian Chadd To: Stefan Bethke Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-embedded@freebsd.org Subject: Re: TL-WR1043: LEDs X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2011 00:32:05 -0000 On 29 November 2011 06:12, Stefan Bethke 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