diff options
author | Rick Chen <rick@andestech.com> | 2019-08-28 18:46:04 +0800 |
---|---|---|
committer | Andes <uboot@andestech.com> | 2019-09-03 09:31:03 +0800 |
commit | 4d0140ee1aa02c702846f47fe986a19ecc4318a6 (patch) | |
tree | 3c0c5ac104f2e1c137dabf2064cf041fb545051b /drivers/cache | |
parent | d58b0a6ee10710b259412fdeaf0eb24474af8401 (diff) | |
download | u-boot-4d0140ee1aa02c702846f47fe986a19ecc4318a6.tar.gz |
dm: cache: Add enable and disable ops for cache uclass
Add cache enable/disable ops to the DM cache uclass driver
Signed-off-by: Rick Chen <rick@andestech.com>
Cc: KC Lin <kclin@andestech.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'drivers/cache')
-rw-r--r-- | drivers/cache/cache-uclass.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/cache/cache-uclass.c b/drivers/cache/cache-uclass.c index 97ce0249a4..3b20a10f08 100644 --- a/drivers/cache/cache-uclass.c +++ b/drivers/cache/cache-uclass.c @@ -17,6 +17,26 @@ int cache_get_info(struct udevice *dev, struct cache_info *info) return ops->get_info(dev, info); } +int cache_enable(struct udevice *dev) +{ + struct cache_ops *ops = cache_get_ops(dev); + + if (!ops->enable) + return -ENOSYS; + + return ops->enable(dev); +} + +int cache_disable(struct udevice *dev) +{ + struct cache_ops *ops = cache_get_ops(dev); + + if (!ops->disable) + return -ENOSYS; + + return ops->disable(dev); +} + UCLASS_DRIVER(cache) = { .id = UCLASS_CACHE, .name = "cache", |