Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Ye.Li | d049afa | 2014-11-20 21:14:13 +0800 | [diff] [blame] | 2 | /* |
| 3 | * |
| 4 | * (C) Copyright 2014 Freescale Semiconductor, Inc |
Ye.Li | d049afa | 2014-11-20 21:14:13 +0800 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #ifndef _THERMAL_H_ |
| 8 | #define _THERMAL_H_ |
| 9 | |
| 10 | #include <dm.h> |
| 11 | |
| 12 | int thermal_get_temp(struct udevice *dev, int *temp); |
| 13 | |
| 14 | /** |
Fabio Estevam | 4cb7b6e | 2015-07-13 22:01:52 -0300 | [diff] [blame] | 15 | * struct dm_thermal_ops - Driver model Thermal operations |
Ye.Li | d049afa | 2014-11-20 21:14:13 +0800 | [diff] [blame] | 16 | * |
| 17 | * The uclass interface is implemented by all Thermal devices which use |
| 18 | * driver model. |
| 19 | */ |
| 20 | struct dm_thermal_ops { |
| 21 | /** |
| 22 | * Get the current temperature |
| 23 | * |
Fabio Estevam | 4cb7b6e | 2015-07-13 22:01:52 -0300 | [diff] [blame] | 24 | * This must be called before doing any transfers with a Thermal device. |
| 25 | * It will enable and initialize any Thermal hardware as necessary. |
Ye.Li | d049afa | 2014-11-20 21:14:13 +0800 | [diff] [blame] | 26 | * |
| 27 | * @dev: The Thermal device |
Fabio Estevam | 4cb7b6e | 2015-07-13 22:01:52 -0300 | [diff] [blame] | 28 | * @temp: pointer that returns the measured temperature |
Ye.Li | d049afa | 2014-11-20 21:14:13 +0800 | [diff] [blame] | 29 | */ |
| 30 | int (*get_temp)(struct udevice *dev, int *temp); |
| 31 | }; |
| 32 | |
| 33 | #endif /* _THERMAL_H_ */ |