Ye.Li | d049afa | 2014-11-20 21:14:13 +0800 | [diff] [blame] | 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 | /** |
Fabio Estevam | 4cb7b6e | 2015-07-13 22:01:52 -0300 | [diff] [blame] | 16 | * struct dm_thermal_ops - Driver model Thermal operations |
Ye.Li | d049afa | 2014-11-20 21:14:13 +0800 | [diff] [blame] | 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 | * |
Fabio Estevam | 4cb7b6e | 2015-07-13 22:01:52 -0300 | [diff] [blame] | 25 | * This must be called before doing any transfers with a Thermal device. |
| 26 | * It will enable and initialize any Thermal hardware as necessary. |
Ye.Li | d049afa | 2014-11-20 21:14:13 +0800 | [diff] [blame] | 27 | * |
| 28 | * @dev: The Thermal device |
Fabio Estevam | 4cb7b6e | 2015-07-13 22:01:52 -0300 | [diff] [blame] | 29 | * @temp: pointer that returns the measured temperature |
Ye.Li | d049afa | 2014-11-20 21:14:13 +0800 | [diff] [blame] | 30 | */ |
| 31 | int (*get_temp)(struct udevice *dev, int *temp); |
| 32 | }; |
| 33 | |
| 34 | #endif /* _THERMAL_H_ */ |