BACKPORT: thermal/drivers/hisi: Fix configuration register setting
authorDaniel Lezcano <daniel.lezcano@linaro.org>
Thu, 19 Oct 2017 17:05:50 +0000 (19:05 +0200)
committerKevin Wangtao <kevin.wangtao@hisilicon.com>
Fri, 26 Jan 2018 01:59:30 +0000 (09:59 +0800)
commitb5f9b8c241b9c8b1d2536cb0a8a6d948ac11cece
tree8457893480f091f1f4afeadf4a9477330c3675cc
parentb1c334bb13f335db4560cf36db79f1ad088af26e
BACKPORT: thermal/drivers/hisi: Fix configuration register setting

The TEMP0_CFG configuration register contains different field to set up the
temperature controller. However in the code, nothing prevents a setup to
overwrite the previous one: eg. writing the hdak value overwrites the sensor
selection, the sensor selection overwrites the hdak value.

In order to prevent such thing, use a regmap-like mechanism by reading the
value before, set the corresponding bits and write the result.

Change-Id: Iecb3eb216337430842c1eb7eb5ff4cc35e8fcc43
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
(cherry picked from commit b424315a287c70eeb5f920f84c92492bd2f5658e)
Signed-off-by: Kevin Wangtao <kevin.wangtao@hisilicon.com>
drivers/thermal/hisi_thermal.c