spi: fsl_dspi: Drop nondm code
[oweals/u-boot.git] / drivers / core / read.c
index 1f999b1b316c01fabb643c5ccfa631a50549a130..047089c886711411e66316c5aeb093f0bc93ce88 100644 (file)
@@ -4,12 +4,12 @@
  * Written by Simon Glass <sjg@chromium.org>
  */
 
-#include <asm/types.h>
-#include <asm/io.h>
 #include <common.h>
 #include <dm.h>
-#include <mapmem.h>
 #include <dm/of_access.h>
+#include <mapmem.h>
+#include <asm/types.h>
+#include <asm/io.h>
 
 int dev_read_u32(const struct udevice *dev, const char *propname, u32 *outp)
 {
@@ -22,6 +22,19 @@ int dev_read_u32_default(const struct udevice *dev, const char *propname,
        return ofnode_read_u32_default(dev_ofnode(dev), propname, def);
 }
 
+int dev_read_u32_index(struct udevice *dev, const char *propname, int index,
+                      u32 *outp)
+{
+       return ofnode_read_u32_index(dev_ofnode(dev), propname, index, outp);
+}
+
+u32 dev_read_u32_index_default(struct udevice *dev, const char *propname,
+                              int index, u32 def)
+{
+       return ofnode_read_u32_index_default(dev_ofnode(dev), propname, index,
+                                            def);
+}
+
 int dev_read_s32(const struct udevice *dev, const char *propname, s32 *outp)
 {
        return ofnode_read_u32(dev_ofnode(dev), propname, (u32 *)outp);
@@ -242,6 +255,22 @@ const void *dev_read_prop(const struct udevice *dev, const char *propname,
        return ofnode_get_property(dev_ofnode(dev), propname, lenp);
 }
 
+int dev_read_first_prop(const struct udevice *dev, struct ofprop *prop)
+{
+       return ofnode_get_first_property(dev_ofnode(dev), prop);
+}
+
+int dev_read_next_prop(struct ofprop *prop)
+{
+       return ofnode_get_next_property(prop);
+}
+
+const void *dev_read_prop_by_prop(struct ofprop *prop,
+                                 const char **propname, int *lenp)
+{
+       return ofnode_get_property_by_prop(prop, propname, lenp);
+}
+
 int dev_read_alias_seq(const struct udevice *dev, int *devnump)
 {
        ofnode node = dev_ofnode(dev);
@@ -323,3 +352,8 @@ fdt_addr_t dev_read_addr_pci(const struct udevice *dev)
 
        return addr;
 }
+
+int dev_get_child_count(const struct udevice *dev)
+{
+       return ofnode_get_child_count(dev_ofnode(dev));
+}