dm: gpio: Refactor to prepare for live tree support

Move the main part of the GPIO request function into a separate function
so that it can be used by the live tree function when added. Update the
xlate method to use a node reference.

Update all GPIO drivers to handle the modified xlate() method.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass 2017-05-18 20:09:18 -06:00
parent 6fb2f57916
commit 3a57123e59
8 changed files with 41 additions and 29 deletions

View file

@ -8,6 +8,7 @@
#include <fdtdec.h>
#include <malloc.h>
#include <asm/gpio.h>
#include <dm/of.h>
#include <dt-bindings/gpio/gpio.h>
DECLARE_GLOBAL_DATA_PTR;
@ -165,7 +166,7 @@ static int sb_gpio_get_function(struct udevice *dev, unsigned offset)
}
static int sb_gpio_xlate(struct udevice *dev, struct gpio_desc *desc,
struct fdtdec_phandle_args *args)
struct ofnode_phandle_args *args)
{
desc->offset = args->args[0];
if (args->args_count < 2)