diff options
author | Wolfgang Denk <wd@denx.de> | 2010-01-12 23:47:03 +0100 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2010-01-12 23:47:03 +0100 |
commit | 2ff6922280025c1315c53fa2eb4ab33f0c9591de (patch) | |
tree | 8061843b797eac0669f51b3b14d361bdae1dbe3b /board/davinci/common/misc.c | |
parent | f8b365ceb64e0b86bea243d783ff94687302cba9 (diff) | |
parent | 06f95959bc5421e516a9a25012e303dea8833385 (diff) | |
download | u-boot-imx-2ff6922280025c1315c53fa2eb4ab33f0c9591de.zip u-boot-imx-2ff6922280025c1315c53fa2eb4ab33f0c9591de.tar.gz u-boot-imx-2ff6922280025c1315c53fa2eb4ab33f0c9591de.tar.bz2 |
Merge branch 'master' of git://git.denx.de/u-boot-arm
Diffstat (limited to 'board/davinci/common/misc.c')
-rw-r--r-- | board/davinci/common/misc.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/board/davinci/common/misc.c b/board/davinci/common/misc.c index 9fab76f..25ca326 100644 --- a/board/davinci/common/misc.c +++ b/board/davinci/common/misc.c @@ -155,3 +155,34 @@ int davinci_configure_pin_mux(const struct pinmux_config *pins, return 0; } + +/* + * Configure multiple pinmux resources. + * + * Takes an pinmux_resource array of pinmux_config and pin counts: + * + * const struct pinmux_resource pinmuxes[] = { + * PINMUX_ITEM(uart_pins), + * PINMUX_ITEM(i2c_pins), + * }; + * + * The number of items in the array must be passed (ARRAY_SIZE can provide + * this value conveniently). + * + * Each item entry is configured in the defined order. If configuration + * of any item fails, -1 is returned and none of the following items are + * configured. On success, 0 is returned. + */ +int davinci_configure_pin_mux_items(const struct pinmux_resource *item, + const int n_items) +{ + int i; + + for (i = 0; i < n_items; i++) { + if (davinci_configure_pin_mux(item[i].pins, + item[i].n_pins) != 0) + return -1; + } + + return 0; +} |