From e3568d2ecadda3e6c24ffab1670b77763df7419f Mon Sep 17 00:00:00 2001 From: "Ye.Li" Date: Thu, 20 Nov 2014 21:14:13 +0800 Subject: 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 Acked-by: Stefano Babic --- drivers/thermal/thermal-uclass.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 drivers/thermal/thermal-uclass.c (limited to 'drivers/thermal/thermal-uclass.c') diff --git a/drivers/thermal/thermal-uclass.c b/drivers/thermal/thermal-uclass.c new file mode 100644 index 0000000..3bee1a7 --- /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 +#include +#include +#include +#include +#include +#include +#include + + +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", +}; -- cgit v1.1