xref: /openbmc/u-boot/include/thermal.h (revision 23ff8633)
1 /*
2  *
3  * (C) Copyright 2014 Freescale Semiconductor, Inc
4  *
5  * SPDX-License-Identifier:	GPL-2.0+
6  */
7 
8 #ifndef _THERMAL_H_
9 #define _THERMAL_H_
10 
11 #include <dm.h>
12 
13 int thermal_get_temp(struct udevice *dev, int *temp);
14 
15 /**
16  * struct dm_thermal_ops - Driver model Thermal operations
17  *
18  * The uclass interface is implemented by all Thermal devices which use
19  * driver model.
20  */
21 struct dm_thermal_ops {
22 	/**
23 	 * Get the current temperature
24 	 *
25 	 * This must be called before doing any transfers with a Thermal device.
26 	 * It will enable and initialize any Thermal hardware as necessary.
27 	 *
28 	 * @dev:	The Thermal device
29 	 * @temp:	pointer that returns the measured temperature
30 	 */
31 	int (*get_temp)(struct udevice *dev, int *temp);
32 };
33 
34 #endif	/* _THERMAL_H_ */
35