[U-Boot] [PATCH v2 3/8] sandbox: gpio: Add basic driver for simulating GPIOs

Mike Frysinger vapier at gentoo.org
Wed Jan 25 00:06:40 CET 2012


On Tuesday 24 January 2012 16:35:00 Mike Frysinger wrote:
> On Monday 23 January 2012 01:20:16 Simon Glass wrote:
> > On Fri, Jan 20, 2012 at 10:59 AM, Mike Frysinger wrote:
> > > On Tuesday 10 January 2012 19:45:47 Simon Glass wrote:
> > >> --- /dev/null
> > >> +++ b/arch/sandbox/include/asm/gpio.h
> > >> 
> > >> +int sandbox_gpio_get_value(int gp);
> > > 
> > > why bother with parallel sandbox gpio API ?  why can't we just
> > > implement the gpio API directly and throw away sandbox_gpio_xxx ? 
> > > then we can also stub out sandbox/include/asm/gpio.h ...
> > 
> > Because the current state of the GPIOs needs to be stored somewhere.
> > Test code which wants a GPIO to appear to be high to U-Boot can call
> > sandbox_gpio_set_value() and that value will be recorded and provided
> > to future gpio_get_value() calls.
> > 
> > Without this virtualisation, the driver would have no purpose.
> 
> i'm not seeing it.  why does external code need to reach into the guts at
> all when we have a gpio API for them to use ?

ok, you clarified it for me, so now we just need some comments in asm/gpio.h 
explaining the expected users of the internal API
-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/20120124/ee78d5d2/attachment.pgp>


More information about the U-Boot mailing list