Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Ye.Li | e3568d2 | 2014-11-20 21:14:13 +0800 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2014 Freescale Semiconductor, Inc |
Ye.Li | e3568d2 | 2014-11-20 21:14:13 +0800 | [diff] [blame] | 4 | */ |
| 5 | |
Patrick Delaunay | b953ec2 | 2021-04-27 11:02:19 +0200 | [diff] [blame] | 6 | #define LOG_CATEGORY UCLASS_THERMAL |
| 7 | |
Ye.Li | e3568d2 | 2014-11-20 21:14:13 +0800 | [diff] [blame] | 8 | #include <common.h> |
| 9 | #include <dm.h> |
| 10 | #include <thermal.h> |
| 11 | #include <errno.h> |
| 12 | #include <fdtdec.h> |
| 13 | #include <malloc.h> |
| 14 | #include <asm/io.h> |
| 15 | #include <linux/list.h> |
| 16 | |
| 17 | |
| 18 | int thermal_get_temp(struct udevice *dev, int *temp) |
| 19 | { |
| 20 | const struct dm_thermal_ops *ops = device_get_ops(dev); |
| 21 | |
| 22 | if (!ops->get_temp) |
| 23 | return -ENOSYS; |
| 24 | |
| 25 | return ops->get_temp(dev, temp); |
| 26 | } |
| 27 | |
| 28 | UCLASS_DRIVER(thermal) = { |
| 29 | .id = UCLASS_THERMAL, |
| 30 | .name = "thermal", |
| 31 | }; |