FIXUP: FROMLIST: thermal: rockchip: fixes the exception interrupts
authorCaesar Wang <wxt@rock-chips.com>
Wed, 22 Jun 2016 10:13:57 +0000 (18:13 +0800)
committerGerrit Code Review <gerrit@rock-chips.com>
Thu, 7 Jul 2016 03:03:15 +0000 (11:03 +0800)
commit2b3943b3e4b6283446b87358250523450fa9d307
tree8f40b8ace9075b1c4f16ac5d483870f172b6b6b2
parent7ee13c9f89a5e2daea67de3b3b942b4c1ebf3386
FIXUP: FROMLIST: thermal: rockchip: fixes the exception interrupts

The hardware-tracked trips will set the alarm interrupt value for
registers. Then when the thermal zone has no trips to be set,
That make the thermal trips callback a over range value.

The root cause is the rk_tsadcv2_temp_to_code() function to handle the
invalid temperature range is indeed incorrect, let's fix it on now.
Otherwise, the thermal alarm interrupt will be triggered all the time
on some SoCs.

Fox example:
localhost tmp # grep thermal /proc/interrupts; sleep 5;
grep thermal /proc/interrupts

23:     994830  ..    GICv3 129 Level     rockchip_thermal
23:    1003423  ..    GICv3 129 Level     rockchip_thermal

Change-Id: I0ddbd0b2dd9c03e785e588f5f339f1eeed4e1c5c
Reported-by: Rocky Hao <rocky.hao@rock-chips.com>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Eduardo Valentin <edubezval@gmail.com>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: linux-pm@vger.kernel.org
(am from https://patchwork.kernel.org/patch/9192357/)
drivers/thermal/rockchip_thermal.c