Improve selection of Vref.

git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2521 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare committed 2004-05-10 18:57:40 +00:00
1 parent 08091f09b2
commit 8c83ad61c9
1 file changed
+8 -1
+8 -1
View File
@@ -175,6 +175,7 @@ static inline u8 PWM_TO_REG(int val, int inv)
* Temperature registers and conversions
*/
#define PC87365_REG_TEMP_CONFIG 0x08
#define PC87365_REG_TEMP 0x0B
#define PC87365_REG_TEMP_MIN 0x0D
#define PC87365_REG_TEMP_MAX 0x0C
@@ -591,10 +592,16 @@ int pc87360_detect(struct i2c_adapter *adapter, int address,
if ((err = i2c_attach_client(new_client)))
goto ERROR1;
/* Use the correct reference voltage */
/* Use the correct reference voltage
Unless both the VLM and the TMS logical devices agree to
use an external Vref, the internal one is used. */
if (data->innr) {
i = pc87360_read_value(data, LD_IN, NO_BANK,
PC87365_REG_IN_CONFIG);
if (data->tempnr) {
i &= pc87360_read_value(data, LD_TEMP, NO_BANK,
PC87365_REG_TEMP_CONFIG);
}
data->in_vref = (i&0x02) ? 303 : 297;
#ifdef DEBUG
printk(KERN_DEBUG "Using %s reference voltage\n",