Skip to contentSkip to conversation

x86/mid/thermal: Turn off thermistor

tip:x86/platform tip-bot for Mika Westerberg 1 participant 1 message Mar 6, 2012 x86 platform drivers

lore
Share & tools
lore
#0 lore raw
Commit-ID:  1b7ccabcc372152d1492241610e52b8ea14b0968
Gitweb:     http://git.kernel.org/tip/1b7ccabcc372152d1492241610e52b8ea14b0968
Author:     Mika Westerberg <[email protected]>
AuthorDate: Mon, 5 Mar 2012 15:01:04 -0800
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 6 Mar 2012 09:01:26 +0100

x86/mid/thermal: Turn off thermistor

Instead of complaining that the voltage is on, we can just ask the MSIC to turn the voltage off. This should save some power.

Voltage for thermistors is turned on when ADC conversion is initiated.

---
 drivers/platform/x86/intel_mid_thermal.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/platform/x86/intel_mid_thermal.c +4 -2
index 5917b3c..2ee9766 100644
@@ -360,8 +360,10 @@ static int mid_initialize_adc(struct device *dev)
 	if (ret)
 		return ret;
 
-	if (data & MSIC_ADCTHERM_MASK)
-		dev_warn(dev, "ADCTHERM already set");
+	data &= ~MSIC_ADCTHERM_MASK;
+	ret = intel_msic_reg_write(INTEL_MSIC_ADC1CNTL3, data);
+	if (ret)
+		return ret;
 
 	/* Index of the first channel in which the stop bit is set */
 	channel_index = find_free_channel();