MCU: FAN: fix VIM1 V14 temperature read issue
authorNick Xie <nick@khadas.com>
Sat, 21 Sep 2019 08:33:17 +0000 (16:33 +0800)
committerNick Xie <nick@khadas.com>
Sat, 21 Sep 2019 08:33:17 +0000 (16:33 +0800)
Signed-off-by: Nick Xie <nick@khadas.com>
drivers/misc/khadas-mcu.c

index a7b09ad..e0cd365 100644 (file)
@@ -255,7 +255,8 @@ static void fan_work_func(struct work_struct *_work)
                int temp = -EINVAL;
                struct mcu_fan_data *fan_data = &g_mcu_data->fan_data;
 
-               if (KHADAS_BOARD_VIM2 == g_mcu_data->board)
+               if ((KHADAS_BOARD_VIM1 == g_mcu_data->board) ||
+                       (KHADAS_BOARD_VIM2 == g_mcu_data->board))
                        temp = get_cpu_temp();
                else if (KHADAS_BOARD_VIM3 == g_mcu_data->board)
                        temp = meson_get_temperature();
@@ -390,7 +391,8 @@ static ssize_t show_fan_temp(struct class *cls,
 {
        int temp = -EINVAL;
 
-       if (KHADAS_BOARD_VIM2 == g_mcu_data->board)
+       if ((KHADAS_BOARD_VIM1 == g_mcu_data->board) ||
+               (KHADAS_BOARD_VIM2 == g_mcu_data->board))
                temp = get_cpu_temp();
        else if (KHADAS_BOARD_VIM3 == g_mcu_data->board)
                temp = meson_get_temperature();