Re: [RFC] generic GPIO parameter API

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Guennadi Liakhovetski <g.liakhovetski@...>
Cc: David Brownell <david-b@...>, <linux-kernel@...>
Date: Monday, June 2, 2008 - 7:13 pm

On Mon, 2008-06-02 at 19:54 +0200, Guennadi Liakhovetski wrote:

I like the idea in general.  The biggest worry I have is trying to find
the parameter for you to fiddle with.  The driver which is going to want
to set the parameters is going to have the gpio number, not the
gpio_chip.  Also, the fact that the parameters are uniquely identified
by strings is a bit awkward.  I can see people registering the same kind
of parameter for different chips like "pullup", "Pullup", "pu" etc
making the driver's task even harder.

So, I reckon if we're to do this we should stick with the current style
of gpio calls for the outside interface, maybe something more like

int gpio_set_param(int gpio, int param, int val);
int gpio_get_param(int gpio, int param);

with the different parameters defined as an enum in some gpio.h
somewhere.  Where to keep the gpio_parameters and how to search/find
them should be up to the implementation (though the gpiolib
implementation would probably look quite like what you've got above).

Note you'll probably want a char *name in there somewhere for the sysfs
interface, but I don't think it should be the primary mechanism for
identification.

Anyway, that's my $0.02  :-)

	--Ben.


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC] generic GPIO parameter API, Guennadi Liakhovetski, (Mon Jun 2, 1:22 pm)
Re: [RFC] generic GPIO parameter API, David Brownell, (Fri Jun 6, 1:29 am)
Re: [RFC] generic GPIO parameter API, Guennadi Liakhovetski, (Mon Jun 9, 12:23 pm)
Re: [RFC] generic GPIO parameter API, Mark Brown, (Mon Jun 9, 12:54 pm)
Re: [RFC] generic GPIO parameter API, Guennadi Liakhovetski, (Mon Jun 9, 1:09 pm)
Re: [RFC] generic GPIO parameter API, Mark Brown, (Tue Jun 10, 5:43 am)
Re: [RFC] generic GPIO parameter API, Guennadi Liakhovetski, (Fri Jun 6, 1:50 am)
Re: [RFC] generic GPIO parameter API, Guennadi Liakhovetski, (Mon Jun 2, 1:54 pm)
Re: [RFC] generic GPIO parameter API, Ben Nizette, (Mon Jun 2, 7:13 pm)
Re: [RFC] generic GPIO parameter API, Guennadi Liakhovetski, (Tue Jun 3, 2:42 am)
Re: [RFC] generic GPIO parameter API, Ben Nizette, (Tue Jun 3, 3:32 am)
Re: [RFC] generic GPIO parameter API, Guennadi Liakhovetski, (Tue Jun 3, 4:29 am)
Re: [RFC] generic GPIO parameter API, Ben Nizette, (Tue Jun 3, 6:02 pm)