mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-21 22:51:37 +00:00
fdt: Add function for decoding multiple gpios globally available
Samsung's SDHCI bindings require multiple gpios to be parsed and configured at a time. Export the already available fdtdec_decode_gpios for this purpose. Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com> Commit-Ready: Che-Liang Chiou <clchiou@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
f20c461984
commit
5921f6a292
2 changed files with 18 additions and 3 deletions
|
@ -344,6 +344,22 @@ int fdtdec_get_bool(const void *blob, int node, const char *prop_name);
|
||||||
int fdtdec_decode_gpio(const void *blob, int node, const char *prop_name,
|
int fdtdec_decode_gpio(const void *blob, int node, const char *prop_name,
|
||||||
struct fdt_gpio_state *gpio);
|
struct fdt_gpio_state *gpio);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Decode a list of GPIOs from an FDT. This creates a list of GPIOs with no
|
||||||
|
* terminating item.
|
||||||
|
*
|
||||||
|
* @param blob FDT blob to use
|
||||||
|
* @param node Node to look at
|
||||||
|
* @param prop_name Node property name
|
||||||
|
* @param gpio Array of gpio elements to fill from FDT. This will be
|
||||||
|
* untouched if either 0 or an error is returned
|
||||||
|
* @param max_count Maximum number of elements allowed
|
||||||
|
* @return number of GPIOs read if ok, -FDT_ERR_BADLAYOUT if max_count would
|
||||||
|
* be exceeded, or -FDT_ERR_NOTFOUND if the property is missing.
|
||||||
|
*/
|
||||||
|
int fdtdec_decode_gpios(const void *blob, int node, const char *prop_name,
|
||||||
|
struct fdt_gpio_state *gpio, int max_count);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set up a GPIO pin according to the provided gpio information. At present this
|
* Set up a GPIO pin according to the provided gpio information. At present this
|
||||||
* just requests the GPIO.
|
* just requests the GPIO.
|
||||||
|
|
|
@ -426,9 +426,8 @@ int fdtdec_get_bool(const void *blob, int node, const char *prop_name)
|
||||||
* @return number of GPIOs read if ok, -FDT_ERR_BADLAYOUT if max_count would
|
* @return number of GPIOs read if ok, -FDT_ERR_BADLAYOUT if max_count would
|
||||||
* be exceeded, or -FDT_ERR_NOTFOUND if the property is missing.
|
* be exceeded, or -FDT_ERR_NOTFOUND if the property is missing.
|
||||||
*/
|
*/
|
||||||
static int fdtdec_decode_gpios(const void *blob, int node,
|
int fdtdec_decode_gpios(const void *blob, int node, const char *prop_name,
|
||||||
const char *prop_name, struct fdt_gpio_state *gpio,
|
struct fdt_gpio_state *gpio, int max_count)
|
||||||
int max_count)
|
|
||||||
{
|
{
|
||||||
const struct fdt_property *prop;
|
const struct fdt_property *prop;
|
||||||
const u32 *cell;
|
const u32 *cell;
|
||||||
|
|
Loading…
Add table
Reference in a new issue