summaryrefslogtreecommitdiff
path: root/include/dm/test.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-07-23 12:55:20 (GMT)
committerSimon Glass <sjg@chromium.org>2014-07-23 13:08:37 (GMT)
commite59f458de6999b8a786da857e653db6777f675ca (patch)
tree0e57f9b83b6a484fce0543562c7c313e66b89c75 /include/dm/test.h
parent997c87bb0b1981fd33e34cefc26d9138f27326ce (diff)
downloadu-boot-e59f458de6999b8a786da857e653db6777f675ca.tar.xz
dm: Introduce per-child data for devices
Some device types can have child devices and want to store information about them. For example a USB flash stick attached to a USB host controller would likely use this space. The controller can hold information about the USB state of each of its children. The data is stored attached to the child device in the 'parent_priv' member. It can be auto-allocated by dm when the child is probed. To do this, add a per_child_auto_alloc_size value to the parent driver. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/dm/test.h')
-rw-r--r--include/dm/test.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/dm/test.h b/include/dm/test.h
index e8e1c0b..7b04850 100644
--- a/include/dm/test.h
+++ b/include/dm/test.h
@@ -82,6 +82,15 @@ struct dm_test_uclass_priv {
int total_add;
};
+/**
+ * struct dm_test_parent_data - parent's information on each child
+ *
+ * @sum: Test value used to check parent data works correctly
+ */
+struct dm_test_parent_data {
+ int sum;
+};
+
/*
* Operation counts for the test driver, used to check that each method is
* called correctly