thermal.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. *
  3. * (C) Copyright 2014 Freescale Semiconductor, Inc
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #ifndef _THERMAL_H_
  8. #define _THERMAL_H_
  9. #include <dm.h>
  10. int thermal_get_temp(struct udevice *dev, int *temp);
  11. /**
  12. * struct struct dm_thermal_ops - Driver model Thermal operations
  13. *
  14. * The uclass interface is implemented by all Thermal devices which use
  15. * driver model.
  16. */
  17. struct dm_thermal_ops {
  18. /**
  19. * Get the current temperature
  20. *
  21. * The device provided is the slave device. It's parent controller
  22. * will be used to provide the communication.
  23. *
  24. * This must be called before doing any transfers with a Thermal slave.
  25. * It will enable and initialize any Thermal hardware as necessary,
  26. * and make sure that the SCK line is in the correct idle state. It is
  27. * not allowed to claim the same bus for several slaves without
  28. * releasing the bus in between.
  29. *
  30. * @dev: The Thermal device
  31. *
  32. * Returns: 0 if the bus was claimed successfully, or a negative value
  33. * if it wasn't.
  34. */
  35. int (*get_temp)(struct udevice *dev, int *temp);
  36. };
  37. #endif /* _THERMAL_H_ */