[U-Boot] General gpio interface?

Mike Frysinger vapier at gentoo.org
Tue Jul 12 21:11:36 CEST 2011


On Tue, Jul 12, 2011 at 04:48, Simon Schwarz wrote:
> am I right that there is no standard gpio interface in u-boot or did I miss it?

in general you missed it, but probably not your fault as i dont think
it's documented :P.  and not everyone supports it (yet).

the API being adopted is the same as Linux.  asm/gpio.h provides:
int gpio_request(unsigned gpio, const char *label)
void gpio_free(unsigned gpio)
int gpio_direction_input(unsigned gpio)
int gpio_direction_output(unsigned gpio, int value)
int gpio_get_value(unsigned gpio)
void gpio_set_value(unsigned gpio, int value)
int gpio_is_valid(int number)

it also optionally provides magic defines specific to your CPU so you
can do something like gpio_request(GPIO_PF10) rather than
gpio_request(14).
-mike


More information about the U-Boot mailing list