From: Rajkumar Kasirajan Date: Wed, 24 Feb 2016 10:07:50 +0000 (+0800) Subject: thermal: nct72: fix shutdown during bootup X-Git-Tag: tegra-l4t-r23.2.update-01^0 X-Git-Url: https://rtime.felk.cvut.cz/gitweb/sojka/nv-tegra/linux-3.10.git/commitdiff_plain/baaa7aad03a9a49fb86f5f58c783920b906b0ee2 thermal: nct72: fix shutdown during bootup While nct driver probe, enable oneshot conversion after setting shutdown limits for local and external sensors. Bug 1723265 Change-Id: I9080579be749fb26f51d4d1c28911db4b6538a70 Signed-off-by: Rajkumar Kasirajan Reviewed-on: http://git-master/r/1018100 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Laxman Dewangan GVS: Gerrit_Virtual_Submit --- diff --git a/drivers/misc/nct1008.c b/drivers/misc/nct1008.c index b23ee9f9f42..7761f6b3907 100644 --- a/drivers/misc/nct1008.c +++ b/drivers/misc/nct1008.c @@ -1340,22 +1340,6 @@ static int nct1008_configure_sensor(struct nct1008_data *data) 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) - goto error; - else - value = ret; - - temp = value_to_temperature(pdata->extended_range, value); - dev_dbg(&client->dev, "\n initial local temp = %d ", temp); - if (ext_err) return ext_err; /* skip configuration of EXT sensor */ @@ -1375,6 +1359,25 @@ static int nct1008_configure_sensor(struct nct1008_data *data) if (ret) goto error; + /* Initiate one-shot conversion */ + ret = nct1008_write_reg(data->client, ONE_SHOT, 0x1); + if (ret) + goto error; + + /* Give hardware necessary time to finish conversion */ + msleep(MAX_CONV_TIME_ONESHOT_MS); + + /* read initial local temperature */ + ret = nct1008_read_reg(client, LOC_TEMP_RD); + if (ret < 0) + goto error; + else + value = ret; + + temp = value_to_temperature(pdata->extended_range, value); + dev_dbg(&client->dev, "\n initial local temp = %d ", temp); + + /* read initial ext temperature */ ret = nct1008_read_reg(client, EXT_TEMP_LO_RD); if (ret < 0) goto error;