diff options
author | Simon Glass | 2020-12-22 19:30:27 -0700 |
---|---|---|
committer | Simon Glass | 2021-01-05 12:24:40 -0700 |
commit | 12559f5bab3e43b603dccfa6c354ffd7da03249c (patch) | |
tree | 91034c495cff6034a6c35ece663db199c81334c7 /include/dm/device-internal.h | |
parent | 806473933adf52740864ab6cdab8c90a84c0b1f3 (diff) |
dm: core: Add functions to set priv/plat
This should not normally be needed in drivers, but add accessors for the
few cases that exist.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/dm/device-internal.h')
-rw-r--r-- | include/dm/device-internal.h | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/include/dm/device-internal.h b/include/dm/device-internal.h index af3b6b2b054..03b092bdf7d 100644 --- a/include/dm/device-internal.h +++ b/include/dm/device-internal.h @@ -190,6 +190,90 @@ static inline int device_chld_remove(struct udevice *dev, struct driver *drv, #endif /** + * dev_set_priv() - Set the private data for a device + * + * This is normally handled by driver model, which automatically allocates + * private data when an 'auto' size if provided by the driver. + * + * Use this function to override normal operation for special situations, such + * as needing to allocate a variable amount of data. + * + * @dev Device to check + * @priv New private-data pointer + */ +void dev_set_priv(struct udevice *dev, void *priv); + +/** + * dev_set_parent_priv() - Set the parent-private data for a device + * + * This is normally handled by driver model, which automatically allocates + * parent-private data when an 'auto' size if provided by the driver. + * + * Use this function to override normal operation for special situations, such + * as needing to allocate a variable amount of data. + * + * @dev: Device to update + * @parent_priv: New parent-private data + */ +void dev_set_parent_priv(struct udevice *dev, void *parent_priv); + +/** + * dev_set_uclass_priv() - Set the uclass private data for a device + * + * This is normally handled by driver model, which automatically allocates + * uclass-private data when an 'auto' size if provided by the driver. + * + * Use this function to override normal operation for special situations, such + * as needing to allocate a variable amount of data. + * + * @dev: Device to update + * @uclass_priv: New uclass private data + */ +void dev_set_uclass_priv(struct udevice *dev, void *uclass_priv); + +/** + * dev_set_plat() - Set the platform data for a device + * + * This is normally handled by driver model, which automatically allocates + * platform data when an 'auto' size if provided by the driver. + * + * Use this function to override normal operation for special situations, such + * as needing to allocate a variable amount of data. + * + * @dev Device to check + * @plat New platform-data pointer + */ +void dev_set_plat(struct udevice *dev, void *priv); + +/** + * dev_set_parent_plat() - Set the parent platform data for a device + * + * This is normally handled by driver model, which automatically allocates + * parent platform data when an 'auto' size if provided by the driver. + * + * Use this function to override normal operation for special situations, such + * as needing to allocate a variable amount of data. + * + * @dev: Device to update + * @parent_plat: New parent platform data + */ +void dev_set_parent_plat(struct udevice *dev, void *parent_plat); + +/** + * dev_set_uclass_plat() - Set the uclass platform data for a device + * + * This is normally handled by driver model, which automatically allocates + * uclass platform data when an 'auto' size if provided by the driver. + * + * Use this function to override normal operation for special situations, such + * as needing to allocate a variable amount of data. + * + * @dev: Device to update + * @uclass_plat: New uclass platform data + */ +void dev_set_uclass_plat(struct udevice *dev, void *uclass_plat); + +/** * simple_bus_translate() - translate a bus address to a system address * * This handles the 'ranges' property in a simple bus. It translates the |