diff options
author | Simon Glass <sjg@chromium.org> | 2017-05-30 21:47:09 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2017-06-01 07:03:10 -0600 |
commit | 150c5afe5bafa90e4fe398e59af32ad3cdbfe5b7 (patch) | |
tree | 15188b7974860d263fb7e5a0a19123a8897a63d4 /drivers/i2c | |
parent | 95795ad6cef37b29fcba5365860a8fa9c2f43898 (diff) |
dm: gpio: Add live tree support
Add support for requesting GPIOs with a live device tree.
This involves adjusting the function signature for the legacy function
gpio_request_by_name_nodev(), so fix up all callers.
Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes to stm32f746-disco.c:
Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/mxc_i2c.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c index 3258ae7ced4..110b9d61192 100644 --- a/drivers/i2c/mxc_i2c.c +++ b/drivers/i2c/mxc_i2c.c @@ -773,12 +773,12 @@ static int mxc_i2c_probe(struct udevice *bus) if (ret < 0) { debug("i2c bus %d at 0x%2lx, no gpio pinctrl state.\n", bus->seq, i2c_bus->base); } else { - ret = gpio_request_by_name_nodev(fdt, node, "scl-gpios", - 0, &i2c_bus->scl_gpio, - GPIOD_IS_OUT); - ret2 = gpio_request_by_name_nodev(fdt, node, "sda-gpios", - 0, &i2c_bus->sda_gpio, - GPIOD_IS_OUT); + ret = gpio_request_by_name_nodev(offset_to_ofnode(node), + "scl-gpios", 0, &i2c_bus->scl_gpio, + GPIOD_IS_OUT); + ret2 = gpio_request_by_name_nodev(offset_to_ofnode(node), + "sda-gpios", 0, &i2c_bus->sda_gpio, + GPIOD_IS_OUT); if (!dm_gpio_is_valid(&i2c_bus->sda_gpio) | !dm_gpio_is_valid(&i2c_bus->scl_gpio) | ret | ret2) { |