[U-Boot] [PATCH v2] gpio: Add PCA9698 40-bit I2C I/O port

Mike Frysinger vapier at gentoo.org
Wed Oct 19 16:41:50 CEST 2011


On Wednesday 19 October 2011 02:34:00 Dirk Eibach wrote:
> --- /dev/null
> +++ b/include/pca9698.h
>
> +#ifndef __PCA9698_H_
> +#define __PCA9698_H_

missing copyright/license/etc... comment block at top of file

> +int pca9698_direction_input(u8 chip, unsigned offset);
> +int pca9698_direction_output(u8 chip, unsigned offset);
> +int pca9698_get_input(u8 chip, unsigned offset);
> +int pca9698_set_output(u8 chip, unsigned offset, int value);

what is "chip" ?  an i2c addr ?  and "offset" is some internal value indicating 
which pin to drive ?  if so, better names might be "u8 addr" and "unsigned 
gpio".  a single comment here would go a long way.

in terms of conforming to existing API:
 - the direction_output() function needs to take a "value"
 - get_input() should be get_value()
 - set_output() should be set_value()
 - you should have a request() func to validate the GPIO
 - add a stub free() func
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20111019/5bf55da6/attachment.pgp 


More information about the U-Boot mailing list