[RFC] generic GPIO parameter API

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: David Brownell <david-b@...>
Cc: <linux-kernel@...>
Date: Monday, June 2, 2008 - 1:22 pm

Hi,

as far as I understand, the current GPIO API only presents very basic GPIO 
functionality: direction and level reading and writing. Whereas many GPIO 
controllers have many further configurable parameters: pull-ups and 
pull-downs, drive strength, slew rate, etc. And it is desirable to be able 
to access those features too. Of course, we cannot extent the API with all 
these possible functions. Would a generic GPIO parameter handling API be 
desirable? Like

struct gpio_parameter {
	char *name;
	void *arg;
	int (*get)(struct gpio_chip *chip, void *arg, unsigned offset, 
			int value);
	int (*set)(struct gpio_chip *chip, void *arg, unsigned offset, 
			int value);
};

int gpio_register_parameter(struct gpio_chip *chip, struct gpio_parameter 
				*param);
struct gpio_parameter *gpio_find_parameter(struct gpio_chip *chip, char 
						*name);

The parameters should be accessible from the kernel and over sysfs, based 
on the gpio-sysfs interface. Would this be useful?

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
--
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)