Signed-off-by: 陈亮 <cl@rock-chips.com>
#include <linux/slab.h>
#include <linux/sysfs.h>
#include <linux/workqueue.h>
+#include <linux/rockchip/common.h>
#include "hwmon-rockchip.h"
continue;
temp = data->ops.read_sensor(i);
- if (temp == 150) {
+ if (temp == INVALID_TEMP) {
dev_err(&data->pdev->dev, "TSADC read failed\n");
continue;
}
#include <linux/of_platform.h>
#include <linux/of.h>
#include <linux/of_device.h>
+#include <linux/rockchip/common.h>
#include "hwmon-rockchip.h"
*code = 0;
if (!g_dev || chn > 4){
- *temp = 150;
+ *temp = INVALID_TEMP;
return ;
}
#if 0
int rockchip_clear_system_status(unsigned long status);
unsigned long rockchip_get_system_status(void);
+#define INVALID_TEMP INT_MAX
#if IS_ENABLED(CONFIG_SENSORS_ROCKCHIP_TSADC)
int rockchip_tsadc_get_temp(int chn);
#else
-static inline int rockchip_tsadc_get_temp(int chn) { return 0; }
+static inline int rockchip_tsadc_get_temp(int chn) { return INVALID_TEMP; }
#endif
#ifdef CONFIG_RK_LAST_LOG