If NCT is in standby mode, need to initiate one-shot conversion
before reading temperature, otherwise while bootup NCT will report
wrong initial temperature and driver will set wrong temperature
alert limits based on that.
Bug
200161159
Change-Id: I158a73eb692a71c0262496369bcd3bd3d62a40e1
Signed-off-by: Rajkumar Kasirajan <rkasirajan@nvidia.com>
(cherry picked from commit
4164770df219bcd37ffa68950882564181a78e8f)
Reviewed-on: http://git-master/r/929885
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Shreshtha Sahu <ssahu@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit
*
* Driver for NCT1008, temperature monitoring device from ON Semiconductors
*
- * Copyright (c) 2010-2015, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2010-2016, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
if (ret)
goto error;
+ /* Initiate one-shot conversion */
+ nct1008_write_reg(data->client, ONE_SHOT, 0x1);
+
+ /* Give hardware necessary time to finish conversion */
+ msleep(MAX_CONV_TIME_ONESHOT_MS);
+
/* read initial temperature */
ret = nct1008_read_reg(client, LOC_TEMP_RD);
if (ret < 0)