Thermal: int3406_thermal: fix thermal sysfs I/F
authorZhang Rui <rui.zhang@intel.com>
Thu, 20 Jul 2017 02:22:47 +0000 (10:22 +0800)
committerZhang Rui <rui.zhang@intel.com>
Fri, 1 Sep 2017 01:03:29 +0000 (09:03 +0800)
commit9ef08d7a4438bb85856ee158f2b5e3e02c479279
treefbe3c2e439b8b786ae6a8757be46692aaa57fd62
parent595536e0b2475a9eac23709cd461143178c12e0e
Thermal: int3406_thermal: fix thermal sysfs I/F

there are three concepts represent backlight in int3406_thermal driver.
1. the raw brightness value from native graphics driver.
2. the percentage numbers from ACPI _BCL control method.
3. the consecutive numbers represent cooling states.

int3406_thermal driver
1. uses value from DDDL/DDPC as the lower/upper limit, which is consistent
   with ACPI _BCL control methods.
2. reads current and maximum brightness from the native graphics driver.
3. expose them to thermal sysfs I/F

This patch fixes the code that switches between the raw brightness value
and the cooling state, which results in bogus value in thermal sysfs I/F.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
drivers/thermal/int340x_thermal/int3406_thermal.c