[U-Boot] [PATCH 0/2] arm nomadik: gpio and i2c

Alessandro Rubini rubini-list at gnudd.com
Mon Jul 20 10:09:55 CEST 2009


> Agreed. So we need an gpio_core.c / .h which defines the following
> functions (just a proposal):

Yes.

> typedef struct gpio_adapter {
> 	int	(*init_pin)(int pin);
> 	int	(*set)(int pin, value);
> 	int	(*get)(int pin);
> 	int	(*dir)(int pin, int direction);	
> 	int	(*level)(int pin, int level);
> }

I don't understand the init_pin function, nor what "level" is.
Actually, even "dir" can be dropped: a get configures as input, a set
configures as output, the extra instruction is very little overhead.

But an alternate function configuration is definitely needed: everybody
has alternate functions associated to the pins. Just say "0" is gpio
and 1...n is SoC-specific.

So, are you going to write it? Or should someone else do that?

thanks
/alessandro


More information about the U-Boot mailing list