platform-x86: intel_mid_thermal: turn off thermistor voltage by default
authorMika Westerberg <mika.westerberg@linux.intel.com>
Thu, 15 Dec 2011 22:28:24 +0000 (22:28 +0000)
committerMatthew Garrett <mjg@redhat.com>
Tue, 20 Mar 2012 16:02:20 +0000 (12:02 -0400)
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.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
drivers/platform/x86/intel_mid_thermal.c

index b07f93d64a91a3f08545ac1c677e31b39f97f616..acd7d2d3d9126aa5f2822a28dd3c59b3e312028d 100644 (file)
@@ -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();