lkml.org 
[lkml]   [2008]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch/rfc 2/4] pcf875x I2C GPIO expander driver
On Fri, 4 Apr 2008, Ben Nizette wrote:
> On Thu, 2008-04-03 at 19:06 -0700, Trent Piepho wrote:
>> On Fri, 30 Nov 2007, David Brownell wrote:
>>> On Friday 30 November 2007, Jean Delvare wrote:
>>>>
>>>> So the user-space interface would be part of the generic GPIO
>>>> infrastructure? I like the idea.
>>>
>>> I thought that would make sense too! :) Someone would need to
>>> write the code though. Having such a mechanism would provide
>>> another "carrot" to migrate folk towards the gpiolib core.
>>
>> Here's some code to do this. It's not entirely perfect yet, but it is
>> usable.
>
> I quite like the fact that this easily tracks labels but I like the
> interface of simple_gpio posted a few days back:
> http://lkml.org/lkml/2008/3/26/87
>
> Either way, anything unified is good.

Always too slow posting my patches. I wrote this two months ago when there
wasn't anything else.

A char device allows better permissions and could be more efficient, if one
really wants to do extensive control of gpio lines from userspace. I can see
how it might be preferrable in some instances.

The nice thing about sysfs is that you don't need any extra software to
interact with it. It's very convienent when you're just trying to debug the
gpio driver you're writing or verify that the gpio lines you just connected
are doing things. It's also nice to be able to say something like:
# run these commands to un-write protect flash
echo out > /sys/class/gpio/MPC85XX:5/direction
echo 1 > /sys/class/gpio/MPC85XX:5/value

Instead of a complicated process that includes directions for creating the
correct device file, compiling a program that will set gpio lines, downloading
said program's source, and so on.


\
 
 \ /
  Last update: 2008-04-04 05:41    [W:0.061 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site