[U-Boot] [PATCH v2 3/8] sandbox: gpio: Add basic driver for simulating GPIOs
Simon Glass
sjg at chromium.org
Wed Feb 15 23:34:19 CET 2012
Hi Mike,
On Tue, Jan 24, 2012 at 3:06 PM, Mike Frysinger <vapier at gentoo.org> wrote:
> 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
OK I will add a few more comments.
Regards,
Simon
More information about the U-Boot
mailing list