thermal-uclass.c 523 B

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