[PATCH] [GPIO]: Handle GPIO shadowing with generic GPIOs

Jonas Bonn jonas.bonn at gmail.com
Mon Oct 13 09:38:21 CEST 2008

>> Is this kind of change to
>> arch/arm/mach-s3c2410/include/mach/gpio.h
>> generally going to be acceptable upstream?  This is a workaround for an
>> output GPIO which is loaded so heavily on some board revisions here the
>> input register for it does not read back the true drive level.

My reading of the generic GPIO API (Documentation/gpio.txt) is that
<mach/gpio.h> is the correct place to make machine-specific
implementations of gpio_set/get_value.  The simplest case is what we
had before I added the GTA02 bits (defer to chip-specific routines),
but the option of adding inline functions there is explicitly
suggested in the documentation.

I can see that perhaps we don't want to clutter that file too much, in
which case we could pull our GTA02 bits out into a file
<mach/gpio-gta02.h> which gets pulled in for GTA02 only; this doesn't
really change the fact that we need to make at least some minor
modification to <mach/gpio.h>, though.

Of course, all this is moot if "generic shadowing" is added, but that
really seems like overkill to me at this point, especially considering
that this is a workaround for buggy hardware.

Just my two cents worth.


More information about the openmoko-kernel mailing list