Re: [patch/rfc 2/4] pcf875x I2C GPIO expander driver

From: Ben Nizette
Date: Fri Apr 04 2008 - 00:51:31 EST



On Thu, 2008-04-03 at 20:33 -0700, Trent Piepho wrote:

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

I've got something similar myself; mine's more complex, handles and
reports IRQs but isn't near releasable. Happens :-)

>
> 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
>
simple_gpio allows
echo "O1" > /dev/gpioN
to do what you've got above, no extra points there ;-)

> 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.

Creating the device file is largely mdev/udev's job, most people don't
have to worry about it.

As I mentioned before (and in my review of simple_gpio) I really like
the idea of having labels attached to the gpio numbers in some way; as
it stands I see that as simple_gpio's only major weakness.

David, you're kinda the gatekeeper here; any input from you on which
approach is to be preferred, essential features etc?

--Ben.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/