mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC] generic GPIO parameter API
@ 2008-06-02 17:22 Guennadi Liakhovetski
  2008-06-02 17:54 ` Guennadi Liakhovetski
  2008-06-06  5:29 ` David Brownell
  0 siblings, 2 replies; 13+ messages in thread
From: Guennadi Liakhovetski @ 2008-06-02 17:22 UTC (permalink / raw)
  To: David Brownell; +Cc: linux-kernel

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2008-06-10  9:44 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-02 17:22 [RFC] generic GPIO parameter API Guennadi Liakhovetski
2008-06-02 17:54 ` Guennadi Liakhovetski
2008-06-02 23:13   ` Ben Nizette
2008-06-03  6:42     ` Guennadi Liakhovetski
2008-06-03  7:32       ` Ben Nizette
2008-06-03  8:29         ` Guennadi Liakhovetski
2008-06-03 22:02           ` Ben Nizette
2008-06-06  5:29 ` David Brownell
2008-06-06  5:50   ` Guennadi Liakhovetski
2008-06-09 16:23   ` Guennadi Liakhovetski
2008-06-09 16:54     ` Mark Brown
2008-06-09 17:09       ` Guennadi Liakhovetski
2008-06-10  9:43         ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®