cache-uclass.c 756 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (C) 2019 Intel Corporation <www.intel.com>
  4. */
  5. #include <common.h>
  6. #include <cache.h>
  7. #include <dm.h>
  8. int cache_get_info(struct udevice *dev, struct cache_info *info)
  9. {
  10. struct cache_ops *ops = cache_get_ops(dev);
  11. if (!ops->get_info)
  12. return -ENOSYS;
  13. return ops->get_info(dev, info);
  14. }
  15. int cache_enable(struct udevice *dev)
  16. {
  17. struct cache_ops *ops = cache_get_ops(dev);
  18. if (!ops->enable)
  19. return -ENOSYS;
  20. return ops->enable(dev);
  21. }
  22. int cache_disable(struct udevice *dev)
  23. {
  24. struct cache_ops *ops = cache_get_ops(dev);
  25. if (!ops->disable)
  26. return -ENOSYS;
  27. return ops->disable(dev);
  28. }
  29. UCLASS_DRIVER(cache) = {
  30. .id = UCLASS_CACHE,
  31. .name = "cache",
  32. .post_bind = dm_scan_fdt_dev,
  33. };