summaryrefslogtreecommitdiff
path: root/drivers/cache
diff options
context:
space:
mode:
authorRick Chen <rick@andestech.com>2019-08-28 13:46:04 +0300
committerAndes <uboot@andestech.com>2019-09-03 04:31:03 +0300
commit4d0140ee1aa02c702846f47fe986a19ecc4318a6 (patch)
tree3c0c5ac104f2e1c137dabf2064cf041fb545051b /drivers/cache
parentd58b0a6ee10710b259412fdeaf0eb24474af8401 (diff)
downloadu-boot-4d0140ee1aa02c702846f47fe986a19ecc4318a6.tar.xz
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.c20
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",