blob: 52a3317fd5485810d697c97ce2b2aa2f3603e305 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Ye.Lie3568d22014-11-20 21:14:13 +08002/*
3 *
4 * (C) Copyright 2014 Freescale Semiconductor, Inc
Ye.Lie3568d22014-11-20 21:14:13 +08005 */
6
7#ifndef _THERMAL_H_
8#define _THERMAL_H_
9
Simon Glass055efe52020-07-19 10:15:41 -060010struct udevice;
Ye.Lie3568d22014-11-20 21:14:13 +080011
12int thermal_get_temp(struct udevice *dev, int *temp);
13
14/**
Fabio Estevam6918f972015-07-13 22:01:52 -030015 * struct dm_thermal_ops - Driver model Thermal operations
Ye.Lie3568d22014-11-20 21:14:13 +080016 *
17 * The uclass interface is implemented by all Thermal devices which use
18 * driver model.
19 */
20struct dm_thermal_ops {
21 /**
22 * Get the current temperature
23 *
Fabio Estevam6918f972015-07-13 22:01:52 -030024 * This must be called before doing any transfers with a Thermal device.
25 * It will enable and initialize any Thermal hardware as necessary.
Ye.Lie3568d22014-11-20 21:14:13 +080026 *
27 * @dev: The Thermal device
Fabio Estevam6918f972015-07-13 22:01:52 -030028 * @temp: pointer that returns the measured temperature
Ye.Lie3568d22014-11-20 21:14:13 +080029 */
30 int (*get_temp)(struct udevice *dev, int *temp);
31};
32
33#endif /* _THERMAL_H_ */