summaryrefslogtreecommitdiffstats
path: root/include/dm
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-01-25 08:27:02 -0700
committerSimon Glass <sjg@chromium.org>2015-01-29 17:09:55 -0700
commitba8da9dc43ac8ae3351345df12dc7f9d1cd07ae0 (patch)
tree9564204a9d60215eaa5fd178a9b77a42485abc59 /include/dm
parentcdc133bde9dd221319b9cf7fd99fcb4da8ba195c (diff)
downloadu-boot-ba8da9dc43ac8ae3351345df12dc7f9d1cd07ae0.tar.gz
u-boot-ba8da9dc43ac8ae3351345df12dc7f9d1cd07ae0.tar.xz
u-boot-ba8da9dc43ac8ae3351345df12dc7f9d1cd07ae0.zip
dm: core: Allow uclasses to specify platdata for a device's children
In many cases the child platform data for a device's children is defined by the uclass rather than the individual devices. For example, a SPI bus needs to know the chip select and speed for each of its children. It makes sense to allow this information to be defined the SPI uclass rather than each individual driver. If the device provides a size value for its child platdata, then use it. Failng that, fall back to that provided by the uclass. Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/dm')
-rw-r--r--include/dm/uclass.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/dm/uclass.h b/include/dm/uclass.h
index 2577ae6489..7d92d34bec 100644
--- a/include/dm/uclass.h
+++ b/include/dm/uclass.h
@@ -60,6 +60,10 @@ struct udevice;
* @per_device_auto_alloc_size: Each device can hold private data owned
* by the uclass. If required this will be automatically allocated if this
* value is non-zero.
+ * @per_child_platdata_auto_alloc_size: A bus likes to store information about
+ * its children. If non-zero this is the size of this data, to be allocated
+ * in the child device's parent_platdata pointer. This value is only used as
+ * a falback if this member is 0 in the driver.
* @ops: Uclass operations, providing the consistent interface to devices
* within the uclass.
*/
@@ -74,6 +78,7 @@ struct uclass_driver {
int (*destroy)(struct uclass *class);
int priv_auto_alloc_size;
int per_device_auto_alloc_size;
+ int per_child_platdata_auto_alloc_size;
const void *ops;
};