mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 16:52:14 +02:00
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>
This commit is contained in:
20
drivers/cache/cache-uclass.c
vendored
20
drivers/cache/cache-uclass.c
vendored
@@ -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",
|
||||
|
Reference in New Issue
Block a user