From 5421539136390405e7f30ecce4fdb7f029357494 Mon Sep 17 00:00:00 2001 From: chewitt Date: Tue, 2 Jul 2019 21:33:46 +0000 Subject: [PATCH] amlogic: fix cputemp for AMLG12 devices --- projects/Amlogic/filesystem/usr/bin/cputemp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/projects/Amlogic/filesystem/usr/bin/cputemp b/projects/Amlogic/filesystem/usr/bin/cputemp index 66e13bf88e..801603b096 100755 --- a/projects/Amlogic/filesystem/usr/bin/cputemp +++ b/projects/Amlogic/filesystem/usr/bin/cputemp @@ -3,6 +3,14 @@ # SPDX-License-Identifier: GPL-2.0 # Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv) -TEMP=$(cat /sys/class/hwmon/hwmon0/temp1_input) +case $(dtsoc) in + amlogic,g12*) + TEMP=$(cat /sys/devices/virtual/thermal/thermal_zone1/temp) + ;; + *) + TEMP=$(cat /sys/class/hwmon/hwmon0/temp1_input) + ;; +esac + TEMP="$(( $TEMP / 1000 ))" echo "${TEMP} C"