diff options
author | Ye.Li <B37916@freescale.com> | 2014-11-20 21:14:13 +0800 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2014-11-21 15:30:01 +0100 |
commit | e3568d2ecadda3e6c24ffab1670b77763df7419f (patch) | |
tree | 7cf42cfaf1907666407b8ff28cfb6aaaea59fa87 /drivers/thermal/thermal-uclass.c | |
parent | cf202d268b5d27b84a8c6df1d749ed3967451be4 (diff) | |
download | u-boot-e3568d2ecadda3e6c24ffab1670b77763df7419f.tar.gz |
DM: thermal: Add imx thermal DM driver
Add a new thermal uclass for thermal sensor and implement the imx
thermal driver basing on this uclass.
Signed-off-by: Ye.Li <B37916@freescale.com>
Acked-by: Stefano Babic <sbabic@denx.de>
Diffstat (limited to 'drivers/thermal/thermal-uclass.c')
-rw-r--r-- | drivers/thermal/thermal-uclass.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/thermal/thermal-uclass.c b/drivers/thermal/thermal-uclass.c new file mode 100644 index 00000000000..3bee1a7dc7a --- /dev/null +++ b/drivers/thermal/thermal-uclass.c @@ -0,0 +1,30 @@ +/* + * (C) Copyright 2014 Freescale Semiconductor, Inc + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <dm.h> +#include <thermal.h> +#include <errno.h> +#include <fdtdec.h> +#include <malloc.h> +#include <asm/io.h> +#include <linux/list.h> + + +int thermal_get_temp(struct udevice *dev, int *temp) +{ + const struct dm_thermal_ops *ops = device_get_ops(dev); + + if (!ops->get_temp) + return -ENOSYS; + + return ops->get_temp(dev, temp); +} + +UCLASS_DRIVER(thermal) = { + .id = UCLASS_THERMAL, + .name = "thermal", +}; |