X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=include%2Fdm%2Fdevice.h;h=fafecceb1ab1137cabe99f0af5fafd050b119bf4;hb=3479253dad2ac9d1c71f4843aae52ea7cd0c7716;hp=81afa8c6281f8f9c55dbd968bfd4b344f8cf872a;hpb=8e3da9dd113699eed2fa05fcde3c55a2ff410913;p=u-boot diff --git a/include/dm/device.h b/include/dm/device.h index 81afa8c628..fafecceb1a 100644 --- a/include/dm/device.h +++ b/include/dm/device.h @@ -12,6 +12,7 @@ #define _DM_DEVICE_H #include +#include #include #include @@ -29,6 +30,9 @@ struct driver_info; /* DM is responsible for allocating and freeing parent_platdata */ #define DM_FLAG_ALLOC_PARENT_PDATA (1 << 3) +/* Allocate driver private data on a DMA boundary */ +#define DM_FLAG_ALLOC_PRIV_DMA (1 << 4) + /** * struct udevice - An instance of a driver * @@ -66,7 +70,7 @@ struct driver_info; * when the device is probed and will be unique within the device's uclass. */ struct udevice { - struct driver *driver; + const struct driver *driver; const char *name; void *platdata; void *parent_platdata; @@ -236,6 +240,16 @@ void *dev_get_priv(struct udevice *dev); */ struct udevice *dev_get_parent(struct udevice *child); +/** + * dev_get_uclass_priv() - Get the private uclass data for a device + * + * This checks that dev is not NULL, but no other checks for now + * + * @dev Device to check + * @return private uclass data for this device, or NULL if none + */ +void *dev_get_uclass_priv(struct udevice *dev); + /** * dev_get_of_data() - get the device tree data used to bind a device * @@ -351,4 +365,13 @@ int device_find_first_child(struct udevice *parent, struct udevice **devp); */ int device_find_next_child(struct udevice **devp); +/** + * dev_get_addr() - Get the reg property of a device + * + * @dev: Pointer to a device + * + * @return addr + */ +fdt_addr_t dev_get_addr(struct udevice *dev); + #endif