From 4d0140ee1aa02c702846f47fe986a19ecc4318a6 Mon Sep 17 00:00:00 2001 From: Rick Chen Date: Wed, 28 Aug 2019 18:46:04 +0800 Subject: 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 Cc: KC Lin Reviewed-by: Bin Meng --- drivers/cache/cache-uclass.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'drivers/cache') diff --git a/drivers/cache/cache-uclass.c b/drivers/cache/cache-uclass.c index 97ce0249a4a..3b20a10f087 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", -- cgit v1.3.1