#include <asm/arch/clock.h>
#include <asm/arch/sys_proto.h>
#include <dm.h>
+#include <dm/device_compat.h>
#include <dm/device-internal.h>
#include <dm/device.h>
#include <errno.h>
return ret;
while (cpu_tmp >= pdata->alert) {
- printf("CPU Temperature (%dC) has beyond alert (%dC), close to critical (%dC)", cpu_tmp, pdata->alert, pdata->critical);
- puts(" waiting...\n");
+ dev_info(dev, "CPU Temperature (%dC) has beyond alert (%dC), close to critical (%dC) waiting...\n",
+ cpu_tmp, pdata->alert, pdata->critical);
mdelay(pdata->polling_delay);
ret = read_temperature(dev, &cpu_tmp);
if (ret)
struct imx_tmu_plat *pdata = dev_get_plat(dev);
ulong drv_data = dev_get_driver_data(dev);
- debug("%s\n", __func__);
+ dev_dbg(dev, "%s\n", __func__);
if (drv_data & (FLAGS_VER2 | FLAGS_VER3))
return 0;
ret = dev_read_u32_array(dev, "fsl,tmu-range", range, 4);
if (ret) {
- printf("TMU: missing calibration range, ret = %d.\n", ret);
+ dev_err(dev, "TMU: missing calibration range, ret = %d.\n", ret);
return ret;
}
calibration = dev_read_prop(dev, "fsl,tmu-calibration", &len);
if (!calibration || len % 8) {
- printf("TMU: invalid calibration data.\n");
+ dev_err(dev, "TMU: invalid calibration data.\n");
return -ENODEV;
}
struct imx_tmu_plat *pdata = dev_get_plat(dev);
ulong drv_data = dev_get_driver_data(dev);
- debug("%s\n", __func__);
+ dev_dbg(dev, "%s\n", __func__);
if (drv_data & FLAGS_VER3) {
/* Disable monitoring */
ulong drv_data = dev_get_driver_data(dev);
u32 reg;
- debug("%s\n", __func__);
+ dev_dbg(dev, "%s\n", __func__);
if (!pdata->regs)
return -EIO;
const void *prop;
int minc, maxc;
- debug("%s dev name %s\n", __func__, dev->name);
+ dev_dbg(dev, "%s\n", __func__);
prop = dev_read_prop(dev, "compatible", NULL);
if (!prop)
dev->driver_data, offset,
NULL);
if (ret)
- printf("Error binding driver '%s': %d\n",
- dev->driver->name, ret);
+ dev_err(dev, "Error binding driver: %d\n", ret);
}
return 0;
ofnode trips_np;
int ret;
- debug("%s dev name %s\n", __func__, dev->name);
+ dev_dbg(dev, "%s\n", __func__);
if (pdata->zone_node) {
pdata->regs = (union tmu_regs *)dev_read_addr_ptr(dev);
else
pdata->id = 0;
- debug("args.args_count %d, id %d\n", args.args_count, pdata->id);
+ dev_dbg(dev, "args.args_count %d, id %d\n", args.args_count, pdata->id);
pdata->polling_delay = dev_read_u32_default(dev, "polling-delay", 1000);
continue;
}
- debug("id %d polling_delay %d, critical %d, alert %d\n",
- pdata->id, pdata->polling_delay, pdata->critical, pdata->alert);
+ dev_dbg(dev, "id %d polling_delay %d, critical %d, alert %d\n",
+ pdata->id, pdata->polling_delay, pdata->critical, pdata->alert);
return 0;
}
ret = imx_tmu_parse_fdt(dev);
if (ret) {
- printf("Error in parsing TMU FDT %d\n", ret);
+ dev_err(dev, "Error in parsing TMU FDT %d\n", ret);
return ret;
}