static int pmic_tps65910_bind(struct udevice *dev) { ofnode regulators_node; int children; regulators_node = dev_read_subnode(dev, "regulators"); if (!ofnode_valid(regulators_node)) { debug("%s regulators subnode not found\n", dev->name); return -EINVAL; } children = pmic_bind_children(dev, regulators_node, pmic_children_info); if (!children) debug("%s has no children (regulators)\n", dev->name); return 0; }
static int lp873x_bind(struct udevice *dev) { ofnode regulators_node; int children; regulators_node = dev_read_subnode(dev, "regulators"); if (!ofnode_valid(regulators_node)) { debug("%s: %s regulators subnode not found!", __func__, dev->name); return -ENXIO; } children = pmic_bind_children(dev, regulators_node, pmic_children_info); if (!children) printf("%s: %s - no child found\n", __func__, dev->name); /* Always return success for this device */ return 0; }
static int s2mps11_probe(struct udevice *dev) { ofnode regulators_node; int children; regulators_node = dev_read_subnode(dev, "voltage-regulators"); if (!ofnode_valid(regulators_node)) { debug("%s: %s regulators subnode not found!", __func__, dev->name); return -ENXIO; } debug("%s: '%s' - found regulators subnode\n", __func__, dev->name); children = pmic_bind_children(dev, regulators_node, pmic_children_info); if (!children) debug("%s: %s - no child found\n", __func__, dev->name); return 0; }
static int stpmu1_bind(struct udevice *dev) { #ifndef CONFIG_SPL_BUILD ofnode regulators_node; int children; regulators_node = dev_read_subnode(dev, "regulators"); if (!ofnode_valid(regulators_node)) { dev_dbg(dev, "regulators subnode not found!"); return -ENXIO; } dev_dbg(dev, "found regulators subnode\n"); children = pmic_bind_children(dev, regulators_node, stpmu1_children_info); if (!children) dev_dbg(dev, "no child found\n"); #endif /* CONFIG_SPL_BUILD */ return 0; }
static int s5m8767_bind(struct udevice *dev) { int children; ofnode node; node = dev_read_subnode(dev, "regulators"); if (!ofnode_valid(node)) { debug("%s: %s regulators subnode not found!", __func__, dev->name); return -ENXIO; } debug("%s: '%s' - found regulators subnode\n", __func__, dev->name); children = pmic_bind_children(dev, node, pmic_children_info); if (!children) debug("%s: %s - no child found\n", __func__, dev->name); /* Always return success for this device */ return 0; }
static int max77686_bind(struct udevice *dev) { ofnode regulators_node; int children; regulators_node = dev_read_subnode(dev, "voltage-regulators"); if (!ofnode_valid(regulators_node)) { debug("%s: %s regulators subnode not found!\n", __func__, dev->name); return -ENXIO; } debug("%s: '%s' - found regulators subnode\n", __func__, dev->name); children = pmic_bind_children(dev, regulators_node, pmic_children_info); if (!children) debug("%s: %s - no child found\n", __func__, dev->name); /* Always return success for this device */ return 0; }
int cros_ec_decode_ec_flash(struct udevice *dev, struct fdt_cros_ec *config) { ofnode flash_node, node; flash_node = dev_read_subnode(dev, "flash"); if (!ofnode_valid(flash_node)) { debug("Failed to find flash node\n"); return -1; } if (ofnode_read_fmap_entry(flash_node, &config->flash)) { debug("Failed to decode flash node in chrome-ec\n"); return -1; } config->flash_erase_value = ofnode_read_s32_default(flash_node, "erase-value", -1); ofnode_for_each_subnode(node, flash_node) { const char *name = ofnode_get_name(node); enum ec_flash_region region; if (0 == strcmp(name, "ro")) { region = EC_FLASH_REGION_RO; } else if (0 == strcmp(name, "rw")) { region = EC_FLASH_REGION_ACTIVE; } else if (0 == strcmp(name, "wp-ro")) { region = EC_FLASH_REGION_WP_RO; } else { debug("Unknown EC flash region name '%s'\n", name); return -1; } if (ofnode_read_fmap_entry(node, &config->region[region])) { debug("Failed to decode flash region in chrome-ec'\n"); return -1; } } return 0; }