thermal-uclass.c 526 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * (C) Copyright 2014 Freescale Semiconductor, Inc
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #include <common.h>
  7. #include <dm.h>
  8. #include <thermal.h>
  9. #include <errno.h>
  10. #include <fdtdec.h>
  11. #include <malloc.h>
  12. #include <asm/io.h>
  13. #include <linux/list.h>
  14. int thermal_get_temp(struct udevice *dev, int *temp)
  15. {
  16. const struct dm_thermal_ops *ops = device_get_ops(dev);
  17. if (!ops->get_temp)
  18. return -ENOSYS;
  19. return ops->get_temp(dev, temp);
  20. }
  21. UCLASS_DRIVER(thermal) = {
  22. .id = UCLASS_THERMAL,
  23. .name = "thermal",
  24. };