coreboot/src
Julius Werner 9e04902ada gpio: Extend common GPIO header, simplify function names
We've had gpiolib.h which defines a few common GPIO access functions for
a while, but it wasn't really complete. This patch adds the missing
gpio_output() function, and also renames the unwieldy
gpio_get_in_value() and gpio_set_out_value() to the much easier to
handle gpio_get() and gpio_set(). The header is renamed to the simpler
gpio.h while we're at it (there was never really anything "lib" about
it, and it was presumably just chosen due to the IPQ806x include/
conflict problem that is now resolved).

It also moves the definition of gpio_t into SoC-specific code, so that
different implementations are free to encode their platform-specific
GPIO parameters in those 4 bytes in the most convenient way (such as the
rk3288 with a bitfield struct). Every SoC intending to use this common
API should supply a <soc/gpio.h> that typedefs gpio_t to a type at most
4 bytes in length. Files accessing the API only need to include <gpio.h>
which may pull in additional things (like a gpio_t creation macro) from
<soc/gpio.h> on its own.

For now the API is still only used on non-x86 SoCs. Whether it makes
sense to expand it to x86 as well should be separately evaluated at a
later point (by someone who understands those systems better). Also,
Exynos retains its old, incompatible GPIO API even though it would be a
prime candidate, because it's currently just not worth the effort.

BUG=None
TEST=Compiled on Daisy, Peach_Pit, Nyan_Blaze, Rush_Ryu, Storm and
Veyron_Pinky.

Change-Id: I6c1e7d1e154d9b02288aabedb397e21e1aadfa15
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/220975
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2014-10-22 04:06:14 +00:00
..
arch rk3288: Change all SoC headers to <soc/headername.h> system 2014-10-22 04:05:32 +00:00
console console: add configs to support Marvell bg4cd uart 2014-10-17 03:24:42 +00:00
cpu New mechanism to define SRAM/memory map with automatic bounds checking 2014-10-03 09:09:36 +00:00
device PCIe: Add L1 Sub-State support. 2014-10-10 04:36:50 +00:00
drivers verstage should include the CBFS SPI wrapper, when configured 2014-10-17 03:25:20 +00:00
ec chromeec: Add wakeup delay after SPI /CS assertion 2014-10-01 06:53:27 +00:00
include gpio: Extend common GPIO header, simplify function names 2014-10-22 04:06:14 +00:00
lib gpio: Extend common GPIO header, simplify function names 2014-10-22 04:06:14 +00:00
mainboard gpio: Extend common GPIO header, simplify function names 2014-10-22 04:06:14 +00:00
northbridge Makefile: Preprocess linker scripts and other general improvements 2014-10-02 07:02:10 +00:00
soc gpio: Extend common GPIO header, simplify function names 2014-10-22 04:06:14 +00:00
southbridge Makefile: Preprocess linker scripts and other general improvements 2014-10-02 07:02:10 +00:00
superio superio: ite8772f: Exit extemp busy state 2014-09-27 07:09:25 +00:00
vendorcode chromeos: move VPD MAC address retrieval function 2014-10-21 00:45:10 +00:00
Kconfig Clean up architecture-specific Kconfigs 2014-10-02 07:02:16 +00:00