blob: 11d75256e085967ace76791c9a58c18873f9a5c6 [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
10#include <dm.h>
11
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_ */