From owner-freebsd-hackers@FreeBSD.ORG Wed May 7 14:57:22 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E67D7C1B for ; Wed, 7 May 2014 14:57:22 +0000 (UTC) Received: from mail-ie0-x22b.google.com (mail-ie0-x22b.google.com [IPv6:2607:f8b0:4001:c03::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B336B1AB for ; Wed, 7 May 2014 14:57:22 +0000 (UTC) Received: by mail-ie0-f171.google.com with SMTP id to1so1128720ieb.2 for ; Wed, 07 May 2014 07:57:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=K56Zp7RCFH+lRzSM//yBSkLPFz2XUNXZUcnQzAYjy4s=; b=yhyTrDzCn0Fl4yKakTPOwigEqBgrz4XnQNaN26CHBdVB51TOTd3s5Pno8UYOEPi5eP G/UKCzCaCqNaIO3u0bNFfIiWHvCUXKPiGS0AuDLueM5w9yRDdCOPfDYKQiQE1HpAqpp/ 3hHDYOoVB1mrsAwCninDX+A0GIer+JtfDI9mOavMVOIcvYwB389k9VAKq89r7+0Np9Ul BhsKpt4QtuGag8hnJ+D9Yg/JYjxF/jqVPVRkgk7SgcqFTw1LccRLm5kEiPwrj/k508d2 kDFkf7ad5nuuCLQjfE4CkRjvW3KtE0+Tp95R9MQwHTjbYj1GmH60bkxoSnAqfOcKYgUT nXHw== MIME-Version: 1.0 X-Received: by 10.51.15.161 with SMTP id fp1mr44254066igd.25.1399474642177; Wed, 07 May 2014 07:57:22 -0700 (PDT) Sender: ermal.luci@gmail.com Received: by 10.50.159.134 with HTTP; Wed, 7 May 2014 07:57:22 -0700 (PDT) In-Reply-To: <20140507144631.GA24565@gta.com> References: <20140422020109.GA57760@gta.com> <69BC3E8E-A5D1-4CAD-96A0-9139FFBD8AA3@netgate.com> <20140507144631.GA24565@gta.com> Date: Wed, 7 May 2014 16:57:22 +0200 X-Google-Sender-Auth: WVF3nprJDo_x6rO-5btZX6jfkSI Message-ID: Subject: Re: apu1c led driver From: =?UTF-8?Q?Ermal_Lu=C3=A7i?= To: Larry Baird Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: Freebsd hackers list , Jim Thompson X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 14:57:23 -0000 On Wed, May 7, 2014 at 4:46 PM, Larry Baird wrote: > On Wed, May 07, 2014 at 10:19:39AM +0200, Ermal Lu??i wrote: > > Hello, > > > > find attached the driver as written today. > > It needs some reshaping to be integrate with led(4) and gpio(4). > > > > I will see to have the reshaping done and submit it for inclusion. > > The idea as it is today is that it expses an gpioapu device to which you > > can write a string with 3 digits "101" for each led. > > If you read from this device you just get the status of the switch on the > > APU. > > I was about to submit a version of my own. Instead I will take some > code from my verison and add it to yours. I attached a modified version > that > uses the led(4) framework to create: > /dev/led/led1, /dev/led/led2, and /dev/led/led3. > > I am curious about the gpioapu_close() function. what is it attempting > to do? My first thought was it was tring to put the leds back to a know > state. But it is writing to the mode switch? > > Heh trying to restore leds to the original state :) Have to fix that part. Also you have a leak of led devs in your loop while attaching if something goes wrong. Need to fix that or i can fix that when i come to it! > Larry > > > > -- > ------------------------------------------------------------------------ > Larry Baird > Global Technology Associates, Inc. 1992-2012 | http://www.gta.com > Celebrating Twenty Years of Software Innovation | Orlando, FL > Email: lab@gta.com | TEL 407-380-0220 > -- Ermal