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