uboot/include
Simon Glass ed3ee5cd06 fdt: Add basic support for decoding GPIO definitions
This adds some support into fdtdec for reading GPIO definitions from
the fdt. We permit up to FDT_GPIO_MAX GPIOs in the system. Each GPIO
is of the form:

gpio-function-name = <phandle gpio_num flags>;

where:

phandle is a pointer to the GPIO node
gpio_num is the number of the GPIO (0 to 223)
flags is a flag, as follows:

   bit    meaning
   0      0=polarity normal, 1=active low (inverted)

An example is:

enable-propounder-gpios = <&gpio 43 0>;

which means that GPIO 43 is used to enable the propounder (setting the
GPIO high), or that you can detect that the propounder is enabled by
checking if the GPIO is high (the fdt does not indicate input/output).

Two main functions are provided:

fdtdec_decode_gpio() reads a GPIO property from an fdt node and decodes it
into a structure.

fdtdec_setup_gpio() sets up the GPIO by calling gpio_request for you.

Both functions can cope with the property being missing, which is taken to
mean that that GPIO function is not available or is not needed.

[For reference, from Stephen Warren <swarren@nvidia.com>. It may be that
we add this extra complexity later if needed:

The correct way to parse such a GPIO property in general is:

* Read the first cell.
* Find the node referenced by the phandle (the controller).
* Ensure property gpio-controller is present in the controller node.
* Read property #gpio-cells from the controller node.
* Extract #gpio-cells from the original property.
* Keep processing more cells from the original property; there may be
multiple GPIOs listed.

According to the binding documentation in the Linux kernel, Samsung
Exynos4 doesn't use this format, and while all other chips do have a
flags cell, about 50% of the controllers indicate the cell is unused.
]

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2012-03-29 08:12:47 +02:00
..
andestech andes_pcu.h: header file of andes_pcu power control unit 2011-11-09 16:35:27 +08:00
asm-generic gpio: Modify common gpio.h to more closely match Linux 2012-01-09 20:10:32 -06:00
bedbug ppc: Fix DBSR_IAx defines in <bedbug/regs.h> 2011-10-09 22:20:44 +02:00
configs i.MX28: Make use of the bounce buffer 2012-03-29 07:56:53 +02:00
cramfs
faraday
galileo
jffs2
linux nand: reinstate lazy bad block scanning 2012-02-28 14:03:39 -06:00
lzma
mtd
pcmcia
synopsys dwcddr21mctl: Synopsys DWC DDR2/1 Memory Controller 2011-11-09 16:35:27 +08:00
u-boot
usb usb:udc:samsung:fix Remove the req_config flag 2012-03-19 00:08:25 +01:00
.gitignore tools: logo: split bmp arrays from bmp_logo.h 2011-11-15 23:58:26 +01:00
74xx_7xx.h
ACEX1K.h
MCD_dma.h
MCD_progCheck.h
MCD_tasksInit.h
SA-1100.h
_exports.h
addr_map.h
ahci.h
ali512x.h
altera.h
amba_clcd.h
ambapp.h
api_public.h api: export LCD device to external apps 2011-11-15 23:58:27 +01:00
arm925t.h
armcoremodule.h
asm-offsets.h
at45.h
at91rm9200_i2c.h
at91rm9200_net.h
ata.h CPCI750: Add CPCI-HD/2 support 2012-03-18 20:10:02 +01:00
atmel_lcdc.h
atmel_mci.h atmel_mci.h: remove outdated register macros 2012-03-13 14:29:14 +01:00
bcd.h
bcm5221.h
bmp_layout.h
bootstage.h bootstage: Implement core microsecond boot time measurement 2012-03-18 21:42:14 +01:00
bus_vcxk.h
bzlib.h
circbuf.h
clps7111.h
cmd_spl.h Add cmd_spl command 2012-03-27 22:05:28 +02:00
command.h Add cmd_process() to process commands in one place 2012-03-06 21:09:41 +01:00
common.h Revert "Add board_pre_console_putc to deal with early console output" 2012-03-23 21:27:32 +01:00
commproc.h
compiler.h Define uintptr_t as long int to simplify printf() format strings 2011-11-22 08:39:24 +01:00
config_cmd_all.h
config_cmd_default.h
config_cmd_defaults.h
config_defaults.h
config_phylib_all_drivers.h phylib: Enable AR8021 phy support 2011-11-11 07:48:59 -06:00
crc.h
da9030.h
dataflash.h dataflash: fix parameters order in write_dataflash() 2011-11-27 19:46:27 +01:00
ddr_spd.h mpc8xxx: update module_type values from JEDEC DDR3 SPD Specification 2011-11-29 08:48:06 -06:00
div64.h
dm9000.h
dm9161.h
dp83848.h
ds1722.h
ds4510.h
dtt.h hwmon: Provide dtt_init() 2011-10-22 01:22:21 +02:00
e500.h
elf.h
environment.h env: remove value from boolean defines 2012-01-05 16:35:54 +01:00
errno.h
exports.h Standalone Apps: Standalone apps should need only exports.h. 2011-12-06 20:52:35 +01:00
ext2fs.h
fat.h FAT: Add FAT write feature 2011-10-26 21:40:44 +02:00
fdc.h
fdt.h
fdt_support.h powerpc/8xxx:Add MPH controller support in USB device-tree fixup 2012-02-15 16:50:14 -06:00
fdtdec.h fdt: Add basic support for decoding GPIO definitions 2012-03-29 08:12:47 +02:00
fis.h
flash.h
fm_eth.h fm-eth: Add ability for board code to disable a port 2011-10-03 08:52:15 -05:00
fpga.h
fsl_diu_fb.h
fsl_esdhc.h
fsl_mdio.h
fsl_nfc.h
fsl_pmic.h misc: pmic: Freescale PMIC switches to generic PMIC driver 2011-10-27 21:56:31 +02:00
gdsys_fpga.h ppc4xx: Setup HICB on Io64 2012-01-09 09:19:47 +01:00
hush.h common: add run_command2 for running simple or hush commands 2011-10-17 22:25:34 +02:00
hwconfig.h
i2c.h fix: error ATMEL_FIO_BASE undeclared, if use I2C_Soft on AT91 2012-01-11 08:03:46 +01:00
i8042.h
ide.h
image.h Add cmd_spl command 2012-03-27 22:05:28 +02:00
iomux.h
ioports.h
ipu_pixfmt.h MX5: Make IPU display output and pixel format configurable 2011-10-17 22:25:32 +02:00
keyboard.h
kgdb.h
ks8721.h
lattice.h Remove execute permissions from source files 2012-03-04 21:56:15 +01:00
lcd.h PXA: Rename CONFIG_PXA2[57]X to CONFIG_CPU_PXA2[57]X 2011-12-06 23:59:32 +01:00
lcdvideo.h
led-display.h
lh7a40x.h
lh7a400.h
lh7a404.h
libata.h
libfdt.h
libfdt_env.h
linux_logo.h
lmb.h
logbuff.h
lpd7a400_cpld.h
lxt971a.h
lynxkdi.h
malloc.h
max8998_pmic.h usb:gadget:s5p Enable the USB Gadget framework at Exynos4210 (C210 Universal) 2011-12-16 21:37:17 +01:00
mb862xx.h
mc9sdz60.h
mc13783.h mc13783.h: create and add regulator mode 0 and 1 2012-02-12 10:11:27 +01:00
mc13892.h MC13892: Add REGMODE0 bits definitions 2011-12-06 23:59:39 +01:00
menu.h common, menu: show menu on startup if CONFIG_MENU_SHOW is defined 2012-02-12 10:11:24 +01:00
mg_disk.h
micrel.h net: phy: add support for Micrel's KSZ9021 2012-02-27 21:19:25 +01:00
mii_phy.h
miiphy.h net/miiphy/serial: drop duplicate "NAMESIZE" define 2012-03-18 20:11:22 +01:00
mk48t59.h
mmc.h ATMEL: use generic mmc framework 2012-03-13 12:06:41 +01:00
mpc5xx.h
mpc5xxx.h
mpc5xxx_sdma.h
mpc8xx.h
mpc8xx_irq.h
mpc83xx.h mpc83xx: Cleanup usage of DDR constants 2011-11-03 18:27:55 -05:00
mpc85xx.h
mpc86xx.h powerpc/mpc86xx: Disable translation for BAT setup 2011-10-09 17:57:54 -05:00
mpc106.h
mpc824x.h
mpc8220.h
mpc8260.h
mpc8260_irq.h
mtd_node.h
mvmfp.h
nand.h nand/fsl_elbc: Convert to self-init 2012-01-26 16:09:06 -06:00
net.h net: force PKTALIGN to ARCH_DMA_MINALIGN 2012-03-29 07:57:10 +02:00
netdev.h net: add Calxeda xgmac driver 2012-01-05 20:10:38 +01:00
nios2-epcs.h
nios2-io.h
nios2-yanu.h
nios2.h
nomadik.h
ns9750_bbus.h
ns9750_mem.h
ns9750_ser.h
ns9750_sys.h
ns16550.h NS16550: trivial code clean for checkpatch 2011-10-23 20:19:53 +02:00
ns87308.h
onenand_uboot.h OneNAND: Add simple OneNAND SPL 2011-11-15 22:24:50 +01:00
os.h sandbox: mark os_exit as noreturn 2012-03-12 11:06:48 -04:00
part.h
pc_keyb.h
pca953x.h
pca9564.h
pca9698.h gpio: Adapt PCA9698 to standard GPIO API 2011-11-18 14:04:25 +01:00
pci.h pci: move pciauto_config_init() to pci.h 2012-03-04 21:13:33 +01:00
pci_ids.h Update pci_ids.h from current Linux sources 2011-12-09 17:28:29 +01:00
pcmcia.h PXA: Remove PXA PCMCIA support 2012-03-26 23:09:23 +02:00
phy.h net: phy: add support for Micrel's KSZ9021 2012-02-27 21:19:25 +01:00
pmic.h misc:pmic:core New generic PMIC driver 2011-10-27 21:56:31 +02:00
post.h POST: add new memory regions test 2011-10-05 22:03:11 +02:00
ppc_asm.tmpl
ppc_defs.h
ps2mult.h
pwm.h
radeon.h
reiserfs.h
rtc.h
s6e63d6.h
s_record.h
sata.h
scsi.h
sdhci.h mmc: mv_sdhci: Fix host version read for Armada100 2011-11-25 17:43:05 -06:00
search.h env: allow to export only selected variables 2011-11-08 13:20:42 +01:00
sed156x.h
sed13806.h
serial.h net/miiphy/serial: drop duplicate "NAMESIZE" define 2012-03-18 20:11:22 +01:00
sha1.h
sha256.h
sja1000.h
sm501.h
smiLynxEM.h
spartan2.h
spartan3.h fpga: add definition for Xilinx Spartan-6 XC6SLX4 2012-01-05 16:18:30 +01:00
spd.h
spd_sdram.h
spi.h
spi_flash.h sf: Add spi_boot() to allow booting from SPI flash in an SPL 2011-12-24 10:23:30 +01:00
status_led.h sbc82xx: delete support for obsolete SBC8240/SBC8260 2011-10-01 21:57:13 +02:00
stdio_dev.h
stratixII.h
sym53c8xx.h
systemace.h
timestamp.h Move timestamp and version files into 'generated' subdir 2011-10-17 23:57:00 +02:00
tpm.h Introduce generic TPM support in u-boot 2011-12-07 08:45:51 +01:00
tsec.h
tsi108.h
tsi148.h
twl4030.h omap: TWL4030 Bump VMMC1 interface voltage from 3V to 3.15V 2011-12-09 17:28:28 +01:00
twl6030.h
tws.h
ubi_uboot.h
universe.h
usb.h usb: replace wait_ms() with mdelay() 2012-03-19 00:08:16 +01:00
usb_cdc_acm.h
usb_defs.h
usb_ether.h
usbdescriptors.h USB: Use (get|put)_unaligned for accessing wMaxPacketSize 2011-12-16 21:37:17 +01:00
usbdevice.h
version.h Move timestamp and version files into 'generated' subdir 2011-10-17 23:57:00 +02:00
video.h
video_ad7176.h
video_ad7177.h
video_ad7179.h
video_easylogo.h
video_fb.h
video_font.h font: split font data from video_font.h 2011-11-15 23:58:26 +01:00
video_font_data.h font: split font data from video_font.h 2011-11-15 23:58:26 +01:00
video_logo.h
virtex2.h
vsc7385.h
vsprintf.h vsprintf: Move function documentation into header file 2011-12-17 23:34:01 +01:00
vxworks.h
w83c553f.h
watchdog.h
xilinx.h
xyzModem.h