[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0806021841500.30390@axis700.grange>
Date: Mon, 2 Jun 2008 19:22:10 +0200 (CEST)
From: Guennadi Liakhovetski <g.liakhovetski@....de>
To: David Brownell <david-b@...bell.net>
cc: linux-kernel@...r.kernel.org
Subject: [RFC] generic GPIO parameter API
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists