1 // SPDX-License-Identifier: GPL-2.0+
4 * Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc
9 #include <fdt_support.h>
10 #include <asm-generic/gpio.h>
13 int fdt_disable_by_ofname(void *rw_fdt_blob, char *ofname)
15 int offset = fdt_path_offset(rw_fdt_blob, ofname);
17 return fdt_status_disabled(rw_fdt_blob, offset);
20 bool dm_i2c_simple_probe(struct udevice *bus, uint chip_addr)
24 return !dm_i2c_probe(bus, chip_addr, DM_I2C_CHIP_RD_ADDRESS |
25 DM_I2C_CHIP_WR_ADDRESS, &dev);
28 int request_gpio_by_name(struct gpio_desc *gpio, const char *gpio_dev_name,
29 uint offset, char *gpio_name)
31 struct udevice *gpio_dev = NULL;
33 if (uclass_get_device_by_name(UCLASS_GPIO, gpio_dev_name, &gpio_dev))
37 gpio->offset = offset;
40 return dm_gpio_request(gpio, gpio_name);